Skip to content

Commit 62254e5

Browse files
Krzysztof Chomskigkonefal-reef
Krzysztof Chomski
authored andcommitted
BLD: since we already use setuptools, let's remove the optional logic in setup.py (GH18113).
1 parent c634352 commit 62254e5

File tree

2 files changed

+5
-26
lines changed

2 files changed

+5
-26
lines changed

doc/source/whatsnew/v0.22.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -195,5 +195,6 @@ Other
195195
^^^^^
196196

197197
- Improved error message when attempting to use a Python keyword as an identifier in a numexpr query (:issue:`18221`)
198+
- BLD: since we already use setuptools, let's remove the optional logic in setup.py (:issue:`18113`)
198199
-
199200
-

setup.py

+4-26
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
import os
1010
from os.path import join as pjoin
1111

12+
import pkg_resources
1213
import sys
1314
import shutil
1415
from distutils.version import LooseVersion
16+
from setuptools import setup, Command
1517

1618
# versioning
1719
import versioneer
@@ -38,14 +40,6 @@ def is_platform_mac():
3840
except ImportError:
3941
_CYTHON_INSTALLED = False
4042

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
4943

5044
setuptools_kwargs = {}
5145
min_numpy_ver = '1.9.0'
@@ -56,10 +50,6 @@ def is_platform_mac():
5650
'pytz >= 2011k',
5751
'numpy >= %s' % min_numpy_ver],
5852
'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-
6353
else:
6454
setuptools_kwargs = {
6555
'install_requires': ['python-dateutil',
@@ -69,16 +59,6 @@ def is_platform_mac():
6959
'zip_safe': False,
7060
}
7161

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-
8262
from distutils.extension import Extension # noqa:E402
8363
from distutils.command.build import build # noqa:E402
8464
from distutils.command.build_ext import build_ext as _build_ext # noqa:E402
@@ -695,7 +675,7 @@ def pxd(name):
695675
# ----------------------------------------------------------------------
696676
# ujson
697677

698-
if suffix == '.pyx' and 'setuptools' in sys.modules:
678+
if suffix == '.pyx':
699679
# undo dumb setuptools bug clobbering .pyx sources back to .c
700680
for ext in extensions:
701681
if ext.sources[0].endswith(('.c', '.cpp')):
@@ -729,9 +709,7 @@ def pxd(name):
729709
sources=['pandas/util/move.c'])
730710
extensions.append(_move_ext)
731711

732-
733-
if _have_setuptools:
734-
setuptools_kwargs["test_suite"] = "nose.collector"
712+
setuptools_kwargs["test_suite"] = "nose.collector"
735713

736714
# The build cache system does string matching below this point.
737715
# if you change something, be careful.

0 commit comments

Comments
 (0)