Skip to content

Commit d84f62f

Browse files
authored
1 parent 418a335 commit d84f62f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

setup.py

+17
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,24 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313

14+
from distutils.sysconfig import get_config_var
15+
from distutils.version import LooseVersion
16+
import os
17+
import platform
1418
from setuptools import setup, Extension
19+
# From https://github.com/pandas-dev/pandas/pull/24274:
20+
# For mac, ensure extensions are built for macos 10.9 when compiling on a
21+
# 10.9 system or above, overriding distuitls behaviour which is to target
22+
# the version that python was built for. This may be overridden by setting
23+
# MACOSX_DEPLOYMENT_TARGET before calling setup.py
24+
if sys.platform == 'darwin':
25+
if 'MACOSX_DEPLOYMENT_TARGET' not in os.environ:
26+
current_system = LooseVersion(platform.mac_ver()[0])
27+
python_target = LooseVersion(
28+
get_config_var('MACOSX_DEPLOYMENT_TARGET'))
29+
if python_target < '10.9' and current_system >= '10.9':
30+
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.9'
31+
1532

1633
sasl_module = Extension('sasl.saslwrapper',
1734
sources=['sasl/saslwrapper.cpp'],

0 commit comments

Comments
 (0)