From 2bd0ffc523060832c2eb02f3fc1ef90affa3acd3 Mon Sep 17 00:00:00 2001 From: Krzysztof Chomski Date: Tue, 7 Nov 2017 14:50:17 +0100 Subject: [PATCH] BLD: since we already use setuptools, let's remove the optional logic in setup.py (GH18113). --- doc/source/whatsnew/v0.22.0.txt | 2 +- setup.py | 28 +++------------------------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/doc/source/whatsnew/v0.22.0.txt b/doc/source/whatsnew/v0.22.0.txt index 943b6bb84fb47b..46442de05eed58 100644 --- a/doc/source/whatsnew/v0.22.0.txt +++ b/doc/source/whatsnew/v0.22.0.txt @@ -157,6 +157,6 @@ Categorical Other ^^^^^ -- +- BLD: since we already use setuptools, let's remove the optional logic in setup.py (:issue:`18113`) - - diff --git a/setup.py b/setup.py index bd7c8f175607c2..4453e08868f441 100755 --- a/setup.py +++ b/setup.py @@ -9,9 +9,11 @@ import os from os.path import join as pjoin +import pkg_resources import sys import shutil from distutils.version import LooseVersion +from setuptools import setup, Command # versioning import versioneer @@ -38,14 +40,6 @@ def is_platform_mac(): except ImportError: _CYTHON_INSTALLED = False -try: - import pkg_resources - from setuptools import setup, Command - _have_setuptools = True -except ImportError: - # no setuptools installed - from distutils.core import setup, Command - _have_setuptools = False setuptools_kwargs = {} min_numpy_ver = '1.9.0' @@ -56,10 +50,6 @@ def is_platform_mac(): 'pytz >= 2011k', 'numpy >= %s' % min_numpy_ver], 'setup_requires': ['numpy >= %s' % min_numpy_ver]} - if not _have_setuptools: - sys.exit("need setuptools/distribute for Py3k" - "\n$ pip install distribute") - else: setuptools_kwargs = { 'install_requires': ['python-dateutil', @@ -69,16 +59,6 @@ def is_platform_mac(): 'zip_safe': False, } - if not _have_setuptools: - try: - import numpy # noqa:F401 - import dateutil # noqa:F401 - setuptools_kwargs = {} - except ImportError: - sys.exit("install requires: 'python-dateutil < 2','numpy'." - " use pip or easy_install." - "\n $ pip install 'python-dateutil < 2' 'numpy'") - from distutils.extension import Extension # noqa:E402 from distutils.command.build import build # noqa:E402 from distutils.command.build_ext import build_ext as _build_ext # noqa:E402 @@ -696,9 +676,7 @@ def pxd(name): sources=['pandas/util/move.c']) extensions.append(_move_ext) - -if _have_setuptools: - setuptools_kwargs["test_suite"] = "nose.collector" +setuptools_kwargs["test_suite"] = "nose.collector" # The build cache system does string matching below this point. # if you change something, be careful.