Skip to content

Commit 2bd0ffc

Browse files
committed
BLD: since we already use setuptools, let's remove the optional logic in setup.py (GH18113).
1 parent 537e880 commit 2bd0ffc

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

doc/source/whatsnew/v0.22.0.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,6 @@ Categorical
157157
Other
158158
^^^^^
159159

160-
-
160+
- BLD: since we already use setuptools, let's remove the optional logic in setup.py (:issue:`18113`)
161161
-
162162
-

setup.py

Lines changed: 3 additions & 25 deletions
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
@@ -696,9 +676,7 @@ def pxd(name):
696676
sources=['pandas/util/move.c'])
697677
extensions.append(_move_ext)
698678

699-
700-
if _have_setuptools:
701-
setuptools_kwargs["test_suite"] = "nose.collector"
679+
setuptools_kwargs["test_suite"] = "nose.collector"
702680

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

0 commit comments

Comments
 (0)