From 3d0a79356593b9d9f9f891bd411e9d547a517417 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Wed, 6 Mar 2019 08:20:48 -0600 Subject: [PATCH 1/2] BLD: Fixed pip install with no numpy --- setup.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index c8d29a2e4be5a..a83e07b50ed57 100755 --- a/setup.py +++ b/setup.py @@ -477,6 +477,11 @@ def maybe_cythonize(extensions, *args, **kwargs): # Avoid running cythonize on `python setup.py clean` # See https://github.com/cython/cython/issues/1495 return extensions + if not cython: + # Avoid trying to look up numpy when installing from sdist + # https://github.com/pandas-dev/pandas/issues/25193 + # TODO: See if this can be removed after pyproject.toml added. + return extensions numpy_incl = pkg_resources.resource_filename('numpy', 'core/include') # TODO: Is this really necessary here? @@ -485,11 +490,8 @@ def maybe_cythonize(extensions, *args, **kwargs): numpy_incl not in ext.include_dirs): ext.include_dirs.append(numpy_incl) - if cython: - build_ext.render_templates(_pxifiles) - return cythonize(extensions, *args, **kwargs) - else: - return extensions + build_ext.render_templates(_pxifiles) + return cythonize(extensions, *args, **kwargs) def srcpath(name=None, suffix='.pyx', subdir='src'): From e2a327286e95f531ace5427b2f3550aa480a7413 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Wed, 6 Mar 2019 10:33:34 -0600 Subject: [PATCH 2/2] whatsnew --- doc/source/whatsnew/v0.24.2.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/whatsnew/v0.24.2.rst b/doc/source/whatsnew/v0.24.2.rst index f864fcd04e3d4..4ca9d57f3a2e5 100644 --- a/doc/source/whatsnew/v0.24.2.rst +++ b/doc/source/whatsnew/v0.24.2.rst @@ -30,6 +30,7 @@ Fixed Regressions - Fixed regression in :class:`TimedeltaIndex` where ``np.sum(index)`` incorrectly returned a zero-dimensional object instead of a scalar (:issue:`25282`) - Fixed regression in ``IntervalDtype`` construction where passing an incorrect string with 'Interval' as a prefix could result in a ``RecursionError``. (:issue:`25338`) - Fixed regression in :class:`Categorical`, where constructing it from a categorical ``Series`` and an explicit ``categories=`` that differed from that in the ``Series`` created an invalid object which could trigger segfaults. (:issue:`25318`) +- Fixed pip installing from source into an environment without NumPy (:issue:`25193`) .. _whatsnew_0242.enhancements: