99import os
1010from os .path import join as pjoin
1111
12+ import pkg_resources
1213import sys
1314import shutil
1415from distutils .version import LooseVersion
16+ from setuptools import setup , Command
1517
1618# versioning
1719import versioneer
@@ -38,14 +40,6 @@ def is_platform_mac():
3840except 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
5044setuptools_kwargs = {}
5145min_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-
6353else :
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-
8262from distutils .extension import Extension # noqa:E402
8363from distutils .command .build import build # noqa:E402
8464from 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' ])
730710extensions .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