9
9
import argparse
10
10
from distutils .sysconfig import get_config_vars
11
11
from distutils .version import LooseVersion
12
+ import multiprocessing
12
13
import os
13
14
from os .path import join as pjoin
14
15
import platform
@@ -35,17 +36,6 @@ def is_platform_mac():
35
36
min_numpy_ver = "1.13.3"
36
37
min_cython_ver = "0.29.13" # note: sync with pyproject.toml
37
38
38
- setuptools_kwargs = {
39
- "install_requires" : [
40
- "python-dateutil >= 2.6.1" ,
41
- "pytz >= 2017.2" ,
42
- f"numpy >= { min_numpy_ver } " ,
43
- ],
44
- "setup_requires" : [f"numpy >= { min_numpy_ver } " ],
45
- "zip_safe" : False ,
46
- }
47
-
48
-
49
39
try :
50
40
import Cython
51
41
@@ -532,11 +522,6 @@ def maybe_cythonize(extensions, *args, **kwargs):
532
522
elif parsed .j :
533
523
nthreads = parsed .j
534
524
535
- # GH#30356 Cythonize doesn't support parallel on Windows
536
- if is_platform_windows () and nthreads > 0 :
537
- print ("Parallel build for cythonize ignored on Windows" )
538
- nthreads = 0
539
-
540
525
kwargs ["nthreads" ] = nthreads
541
526
build_ext .render_templates (_pxifiles )
542
527
return cythonize (extensions , * args , ** kwargs )
@@ -749,37 +734,51 @@ def srcpath(name=None, suffix=".pyx", subdir="src"):
749
734
# ----------------------------------------------------------------------
750
735
751
736
752
- # The build cache system does string matching below this point.
753
- # if you change something, be careful.
754
-
755
- setup (
756
- name = DISTNAME ,
757
- maintainer = AUTHOR ,
758
- version = versioneer .get_version (),
759
- packages = find_packages (include = ["pandas" , "pandas.*" ]),
760
- package_data = {"" : ["templates/*" , "_libs/*.dll" ]},
761
- ext_modules = maybe_cythonize (extensions , compiler_directives = directives ),
762
- maintainer_email = EMAIL ,
763
- description = DESCRIPTION ,
764
- license = LICENSE ,
765
- cmdclass = cmdclass ,
766
- url = URL ,
767
- download_url = DOWNLOAD_URL ,
768
- project_urls = PROJECT_URLS ,
769
- long_description = LONG_DESCRIPTION ,
770
- classifiers = CLASSIFIERS ,
771
- platforms = "any" ,
772
- python_requires = ">=3.6.1" ,
773
- extras_require = {
774
- "test" : [
775
- # sync with setup.cfg minversion & install.rst
776
- "pytest>=4.0.2" ,
777
- "pytest-xdist" ,
778
- "hypothesis>=3.58" ,
779
- ]
780
- },
781
- entry_points = {
782
- "pandas_plotting_backends" : ["matplotlib = pandas:plotting._matplotlib" ]
783
- },
784
- ** setuptools_kwargs ,
785
- )
737
+ def setup_package ():
738
+ setuptools_kwargs = {
739
+ "install_requires" : [
740
+ "python-dateutil >= 2.6.1" ,
741
+ "pytz >= 2017.2" ,
742
+ f"numpy >= { min_numpy_ver } " ,
743
+ ],
744
+ "setup_requires" : [f"numpy >= { min_numpy_ver } " ],
745
+ "zip_safe" : False ,
746
+ }
747
+
748
+ setup (
749
+ name = DISTNAME ,
750
+ maintainer = AUTHOR ,
751
+ version = versioneer .get_version (),
752
+ packages = find_packages (include = ["pandas" , "pandas.*" ]),
753
+ package_data = {"" : ["templates/*" , "_libs/*.dll" ]},
754
+ ext_modules = maybe_cythonize (extensions , compiler_directives = directives ),
755
+ maintainer_email = EMAIL ,
756
+ description = DESCRIPTION ,
757
+ license = LICENSE ,
758
+ cmdclass = cmdclass ,
759
+ url = URL ,
760
+ download_url = DOWNLOAD_URL ,
761
+ project_urls = PROJECT_URLS ,
762
+ long_description = LONG_DESCRIPTION ,
763
+ classifiers = CLASSIFIERS ,
764
+ platforms = "any" ,
765
+ python_requires = ">=3.6.1" ,
766
+ extras_require = {
767
+ "test" : [
768
+ # sync with setup.cfg minversion & install.rst
769
+ "pytest>=4.0.2" ,
770
+ "pytest-xdist" ,
771
+ "hypothesis>=3.58" ,
772
+ ]
773
+ },
774
+ entry_points = {
775
+ "pandas_plotting_backends" : ["matplotlib = pandas:plotting._matplotlib" ]
776
+ },
777
+ ** setuptools_kwargs ,
778
+ )
779
+
780
+
781
+ if __name__ == "__main__" :
782
+ # Freeze to support parallel compilation when using spawn instead of fork
783
+ multiprocessing .freeze_support ()
784
+ setup_package ()
0 commit comments