From 256faf2011a12424e684a42c147e1ba7ac32c6fb Mon Sep 17 00:00:00 2001 From: Rob Buckley Date: Mon, 10 Dec 2018 23:34:39 +0000 Subject: [PATCH 1/5] BLD: mac builds target 10.9 on newer systems GH23424 --- setup.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/setup.py b/setup.py index cb52db98905d3..8d5b3bcd93822 100755 --- a/setup.py +++ b/setup.py @@ -24,6 +24,10 @@ def is_platform_windows(): return sys.platform == 'win32' or sys.platform == 'cygwin' +def is_platform_mac(): + return sys.platform == 'darwin' + + min_numpy_ver = '1.12.0' setuptools_kwargs = { 'install_requires': [ @@ -434,6 +438,20 @@ def get_tag(self): extra_compile_args = ['-Wno-unused-function'] +# For mac, ensure extensions are built for macos 10.9 when compiling on a 10.9 system or above, +# overriding distuitls behaviour which is to target the version that python was built for. +# This may be overridden by setting MACOSX_DEPLOYMENT_TARGET before calling setup.py +if is_platform_mac(): + import _osx_support + import distutils.sysconfig + if not 'MACOSX_DEPLOYMENT_TARGET' in os.environ: + current_system = list(map(int, _osx_support._get_system_version().split('.'))) + python_osx_target_str = distutils.sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') + python_osx_target = list(map(int, python_osx_target_str.split('.'))) + if python_osx_target < [10, 9] and current_system >= [10, 9]: + os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.9' + + # enable coverage by building cython files by setting the environment variable # "PANDAS_CYTHON_COVERAGE" (with a Truthy value) or by running build_ext # with `--with-cython-coverage`enabled From d98693ec29d897a7eaafd38eeab617bd528c0436 Mon Sep 17 00:00:00 2001 From: Rob Buckley Date: Tue, 11 Dec 2018 23:03:25 +0000 Subject: [PATCH 2/5] PEP8 fixes --- setup.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 8d5b3bcd93822..bd1979a2e42a1 100755 --- a/setup.py +++ b/setup.py @@ -438,15 +438,18 @@ def get_tag(self): extra_compile_args = ['-Wno-unused-function'] -# For mac, ensure extensions are built for macos 10.9 when compiling on a 10.9 system or above, -# overriding distuitls behaviour which is to target the version that python was built for. -# This may be overridden by setting MACOSX_DEPLOYMENT_TARGET before calling setup.py +# For mac, ensure extensions are built for macos 10.9 when compiling on a +# 10.9 system or above, overriding distuitls behaviour which is to target +# the version that python was built for. This may be overridden by setting +# MACOSX_DEPLOYMENT_TARGET before calling setup.py if is_platform_mac(): import _osx_support import distutils.sysconfig - if not 'MACOSX_DEPLOYMENT_TARGET' in os.environ: - current_system = list(map(int, _osx_support._get_system_version().split('.'))) - python_osx_target_str = distutils.sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') + if 'MACOSX_DEPLOYMENT_TARGET' not in os.environ: + current_system = \ + list(map(int, _osx_support._get_system_version().split('.'))) + python_osx_target_str = \ + distutils.sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') python_osx_target = list(map(int, python_osx_target_str.split('.'))) if python_osx_target < [10, 9] and current_system >= [10, 9]: os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.9' From 9c5dc9f60221a602e2ae98d8addb8e535e01d946 Mon Sep 17 00:00:00 2001 From: Rob Buckley Date: Wed, 12 Dec 2018 23:28:38 +0000 Subject: [PATCH 3/5] use platform instead of _osx_support module --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index bd1979a2e42a1..824553ec326f1 100755 --- a/setup.py +++ b/setup.py @@ -10,6 +10,8 @@ from os.path import join as pjoin import pkg_resources +import platform +import distutils.sysconfig import sys import shutil from distutils.version import LooseVersion @@ -443,11 +445,9 @@ def get_tag(self): # the version that python was built for. This may be overridden by setting # MACOSX_DEPLOYMENT_TARGET before calling setup.py if is_platform_mac(): - import _osx_support - import distutils.sysconfig if 'MACOSX_DEPLOYMENT_TARGET' not in os.environ: current_system = \ - list(map(int, _osx_support._get_system_version().split('.'))) + list(map(int, platform.mac_ver()[0].split('.')[:2])) python_osx_target_str = \ distutils.sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') python_osx_target = list(map(int, python_osx_target_str.split('.'))) From 7e1f12bca28d08fc20cf0d7e976eb6d2ab5529f8 Mon Sep 17 00:00:00 2001 From: Rob Buckley Date: Sat, 15 Dec 2018 11:49:49 +0000 Subject: [PATCH 4/5] switch to LooseVersion, implicit line breaks --- setup.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 824553ec326f1..6cd359b281b56 100755 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ import pkg_resources import platform -import distutils.sysconfig +from distutils.sysconfig import get_config_var import sys import shutil from distutils.version import LooseVersion @@ -446,12 +446,10 @@ def get_tag(self): # MACOSX_DEPLOYMENT_TARGET before calling setup.py if is_platform_mac(): if 'MACOSX_DEPLOYMENT_TARGET' not in os.environ: - current_system = \ - list(map(int, platform.mac_ver()[0].split('.')[:2])) - python_osx_target_str = \ - distutils.sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') - python_osx_target = list(map(int, python_osx_target_str.split('.'))) - if python_osx_target < [10, 9] and current_system >= [10, 9]: + current_system = LooseVersion(platform.mac_ver()[0]) + python_target = LooseVersion( + get_config_var('MACOSX_DEPLOYMENT_TARGET')) + if python_target < '10.9' and current_system >= '10.9': os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.9' From 34fca3fd1433d0c6415ce903a012db629b4ec46e Mon Sep 17 00:00:00 2001 From: Rob Buckley Date: Thu, 20 Dec 2018 22:18:39 +0000 Subject: [PATCH 5/5] udpate whatsnew --- doc/source/whatsnew/v0.24.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v0.24.0.rst b/doc/source/whatsnew/v0.24.0.rst index 4d0373e4571da..cae927295666b 100644 --- a/doc/source/whatsnew/v0.24.0.rst +++ b/doc/source/whatsnew/v0.24.0.rst @@ -1562,7 +1562,7 @@ Build Changes - Building pandas for development now requires ``cython >= 0.28.2`` (:issue:`21688`) - Testing pandas now requires ``hypothesis>=3.58``. You can find `the Hypothesis docs here `_, and a pandas-specific introduction :ref:`in the contributing guide `. (:issue:`22280`) -- +- Building pandas on macOS now targets minimum macOS 10.9 if run on macOS 10.9 or above (:issue:`23424`) Other ^^^^^