Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLD: since we already use setuptools, let's remove the optional logic… #18448

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.22.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,5 @@ Other
- Fixed a bug where creating a Series from an array that contains both tz-naive and tz-aware values will result in a Series whose dtype is tz-aware instead of object (:issue:`16406`)
- Fixed construction of a :class:`Series` from a ``dict`` containing ``NaN`` as key (:issue:`18480`)
- Adding a ``Period`` object to a ``datetime`` or ``Timestamp`` object will now correctly raise a ``TypeError`` (:issue:`17983`)
- Simplified setup due to explicit dependence on setuptools (:issue:`18113`)
-
54 changes: 12 additions & 42 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -38,46 +40,18 @@ 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'
if sys.version_info[0] >= 3:
setuptools_kwargs = {
'install_requires': [
'python-dateutil >= 2' if sys.version_info[0] >= 3 else 'python-dateutil',
'pytz >= 2011k',
'numpy >= %s' % min_numpy_ver,
],
'setup_requires': ['numpy >= %s' % min_numpy_ver],
'zip_safe': False,
}

setuptools_kwargs = {'zip_safe': False,
'install_requires': ['python-dateutil >= 2',
'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',
'pytz >= 2011k',
'numpy >= %s' % min_numpy_ver],
'setup_requires': ['numpy >= %s' % min_numpy_ver],
'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
Expand Down Expand Up @@ -695,7 +669,7 @@ def pxd(name):
# ----------------------------------------------------------------------
# ujson

if suffix == '.pyx' and 'setuptools' in sys.modules:
if suffix == '.pyx':
# undo dumb setuptools bug clobbering .pyx sources back to .c
for ext in extensions:
if ext.sources[0].endswith(('.c', '.cpp')):
Expand Down Expand Up @@ -729,10 +703,6 @@ def pxd(name):
sources=['pandas/util/move.c'])
extensions.append(_move_ext)


if _have_setuptools:
setuptools_kwargs["test_suite"] = "nose.collector"

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

Expand Down