File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 4
4
import sys
5
5
import shlex
6
6
import pkg_resources
7
+ import platform
8
+ from distutils .sysconfig import get_config_var
9
+ from distutils .version import LooseVersion
7
10
from glob import glob
8
11
from setuptools import setup , Extension
9
12
from setuptools .command .test import test as TestCommand
@@ -25,6 +28,25 @@ def is_installed(requirement):
25
28
else :
26
29
return True
27
30
31
+
32
+ def is_platform_mac ():
33
+ return sys .platform == 'darwin'
34
+
35
+
36
+ # For mac, ensure extensions are built for macos 10.9 when compiling on a
37
+ # 10.9 system or above, overriding distuitls behaviour which is to target
38
+ # the version that python was built for. This may be overridden by setting
39
+ # MACOSX_DEPLOYMENT_TARGET before calling setup.py
40
+ # https://github.com/pandas-dev/pandas/issues/23424#issuecomment-446393981
41
+ if is_platform_mac ():
42
+ if 'MACOSX_DEPLOYMENT_TARGET' not in os .environ :
43
+ current_system = LooseVersion (platform .mac_ver ()[0 ])
44
+ python_target = LooseVersion (
45
+ get_config_var ('MACOSX_DEPLOYMENT_TARGET' ))
46
+ if python_target < '10.9' and current_system >= '10.9' :
47
+ os .environ ['MACOSX_DEPLOYMENT_TARGET' ] = '10.9'
48
+
49
+
28
50
# Resolving Cython dependency via 'setup_requires' requires setuptools >= 18.0:
29
51
# https://github.com/pypa/setuptools/commit/a811c089a4362c0dc6c4a84b708953dde9ebdbf8
30
52
setuptools_req = "setuptools >= 18.0"
You can’t perform that action at this time.
0 commit comments