9
9
import os
10
10
from os .path import join as pjoin
11
11
12
+ import pkg_resources
12
13
import sys
13
14
import shutil
14
15
from distutils .version import LooseVersion
16
+ from setuptools import setup , Command
15
17
16
18
# versioning
17
19
import versioneer
@@ -38,14 +40,6 @@ def is_platform_mac():
38
40
except ImportError :
39
41
_CYTHON_INSTALLED = False
40
42
41
- try :
42
- import pkg_resources
43
- from setuptools import setup , Command
44
- _have_setuptools = True
45
- except ImportError :
46
- # no setuptools installed
47
- from distutils .core import setup , Command
48
- _have_setuptools = False
49
43
50
44
setuptools_kwargs = {}
51
45
min_numpy_ver = '1.9.0'
@@ -56,10 +50,6 @@ def is_platform_mac():
56
50
'pytz >= 2011k' ,
57
51
'numpy >= %s' % min_numpy_ver ],
58
52
'setup_requires' : ['numpy >= %s' % min_numpy_ver ]}
59
- if not _have_setuptools :
60
- sys .exit ("need setuptools/distribute for Py3k"
61
- "\n $ pip install distribute" )
62
-
63
53
else :
64
54
setuptools_kwargs = {
65
55
'install_requires' : ['python-dateutil' ,
@@ -69,16 +59,6 @@ def is_platform_mac():
69
59
'zip_safe' : False ,
70
60
}
71
61
72
- if not _have_setuptools :
73
- try :
74
- import numpy # noqa:F401
75
- import dateutil # noqa:F401
76
- setuptools_kwargs = {}
77
- except ImportError :
78
- sys .exit ("install requires: 'python-dateutil < 2','numpy'."
79
- " use pip or easy_install."
80
- "\n $ pip install 'python-dateutil < 2' 'numpy'" )
81
-
82
62
from distutils .extension import Extension # noqa:E402
83
63
from distutils .command .build import build # noqa:E402
84
64
from distutils .command .build_ext import build_ext as _build_ext # noqa:E402
@@ -695,7 +675,7 @@ def pxd(name):
695
675
# ----------------------------------------------------------------------
696
676
# ujson
697
677
698
- if suffix == '.pyx' and 'setuptools' in sys . modules :
678
+ if suffix == '.pyx' :
699
679
# undo dumb setuptools bug clobbering .pyx sources back to .c
700
680
for ext in extensions :
701
681
if ext .sources [0 ].endswith (('.c' , '.cpp' )):
@@ -729,9 +709,7 @@ def pxd(name):
729
709
sources = ['pandas/util/move.c' ])
730
710
extensions .append (_move_ext )
731
711
732
-
733
- if _have_setuptools :
734
- setuptools_kwargs ["test_suite" ] = "nose.collector"
712
+ setuptools_kwargs ["test_suite" ] = "nose.collector"
735
713
736
714
# The build cache system does string matching below this point.
737
715
# if you change something, be careful.
0 commit comments