Skip to content

Commit dfcd2b2

Browse files
robbuckleyjreback
authored andcommitted
BLD: fix build error for PyPy on macOS (#26536) (#26862)
1 parent ba69f95 commit dfcd2b2

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

doc/source/whatsnew/v0.25.0.rst

+5
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,11 @@ Sparse
776776
- Introduce a better error message in :meth:`Series.sparse.from_coo` so it returns a ``TypeError`` for inputs that are not coo matrices (:issue:`26554`)
777777
- Bug in :func:`numpy.modf` on a :class:`SparseArray`. Now a tuple of :class:`SparseArray` is returned (:issue:`26946`).
778778

779+
Build Changes
780+
^^^^^^^^^^^^^
781+
782+
- Fix install error with PyPy on macOS (:issue:`26536`)
783+
779784
Other
780785
^^^^^
781786

setup.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import pkg_resources
1313
import platform
14-
from distutils.sysconfig import get_config_var
14+
from distutils.sysconfig import get_config_vars
1515
import sys
1616
import shutil
1717
from distutils.version import LooseVersion
@@ -442,19 +442,19 @@ def run(self):
442442
if debugging_symbols_requested:
443443
extra_compile_args.append('-g')
444444

445-
# For mac, ensure extensions are built for macos 10.9 when compiling on a
446-
# 10.9 system or above, overriding distuitls behaviour which is to target
447-
# the version that python was built for. This may be overridden by setting
445+
# Build for at least macOS 10.9 when compiling on a 10.9 system or above,
446+
# overriding CPython distuitls behaviour which is to target the version that
447+
# python was built for. This may be overridden by setting
448448
# MACOSX_DEPLOYMENT_TARGET before calling setup.py
449449
if is_platform_mac():
450450
if 'MACOSX_DEPLOYMENT_TARGET' not in os.environ:
451-
current_system = LooseVersion(platform.mac_ver()[0])
452-
python_target = LooseVersion(
453-
get_config_var('MACOSX_DEPLOYMENT_TARGET'))
454-
if python_target < '10.9' and current_system >= '10.9':
451+
current_system = platform.mac_ver()[0]
452+
python_target = get_config_vars().get('MACOSX_DEPLOYMENT_TARGET',
453+
current_system)
454+
if (LooseVersion(python_target) < '10.9' and
455+
LooseVersion(current_system) >= '10.9'):
455456
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.9'
456457

457-
458458
# enable coverage by building cython files by setting the environment variable
459459
# "PANDAS_CYTHON_COVERAGE" (with a Truthy value) or by running build_ext
460460
# with `--with-cython-coverage`enabled

0 commit comments

Comments
 (0)