Skip to content

Commit da384f1

Browse files
committed
test
1 parent 1d64f78 commit da384f1

1 file changed

Lines changed: 71 additions & 1 deletion

File tree

Formula/python@3.9.rb

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ class PythonAT39 < Formula
8585
end
8686
end
8787

88+
patch :DATA
89+
8890
def install
8991
# Unset these so that installing pip and setuptools puts them where we want
9092
# and not into some other Python the user has installed.
@@ -121,7 +123,7 @@ def install
121123
cflags << "-I#{MacOS.sdk_path}/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers"
122124
end
123125
# Avoid linking to libgcc https://mail.python.org/pipermail/python-dev/2012-February/116205.html
124-
args << "MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}"
126+
args << "MACOSX_DEPLOYMENT_TARGET=11"
125127

126128
# We want our readline! This is just to outsmart the detection code,
127129
# superenv makes cc always find includes/libs!
@@ -347,3 +349,71 @@ def caveats
347349
system bin/"pip3", "list", "--format=columns"
348350
end
349351
end
352+
__END__
353+
commit cd26ccbbf97be0d729196df3ec2a25ef4f0c57f8
354+
Author: FX Coudert <fxcoudert@gmail.com>
355+
Date: 2020-11-29 16:26:44 +0100
356+
357+
setup.py: fix for MACOSX_DEPLOYMENT_TARGET=11
358+
359+
diff --git a/Lib/distutils/spawn.py b/Lib/distutils/spawn.py
360+
index 0d1bd0391e..e705f19e79 100644
361+
--- a/Lib/distutils/spawn.py
362+
+++ b/Lib/distutils/spawn.py
363+
@@ -57,7 +57,7 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0):
364+
_cfg_target = sysconfig.get_config_var(
365+
'MACOSX_DEPLOYMENT_TARGET') or ''
366+
if _cfg_target:
367+
- _cfg_target_split = [int(x) for x in _cfg_target.split('.')]
368+
+ _cfg_target_split = [int(x) for x in str(_cfg_target).split('.')]
369+
if _cfg_target:
370+
# ensure that the deployment target of build process is not less
371+
# than that used when the interpreter was built. This ensures
372+
diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py
373+
index 6bb009a86f..d7e32f456f 100644
374+
--- a/Lib/distutils/tests/test_build_ext.py
375+
+++ b/Lib/distutils/tests/test_build_ext.py
376+
@@ -456,7 +456,7 @@ def test_deployment_target_higher_ok(self):
377+
deptarget = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
378+
if deptarget:
379+
# increment the minor version number (i.e. 10.6 -> 10.7)
380+
- deptarget = [int(x) for x in deptarget.split('.')]
381+
+ deptarget = [int(x) for x in str(deptarget).split('.')]
382+
deptarget[-1] += 1
383+
deptarget = '.'.join(str(i) for i in deptarget)
384+
self._try_compile_deployment_target('<', deptarget)
385+
@@ -489,7 +489,7 @@ def _try_compile_deployment_target(self, operator, target):
386+
387+
# get the deployment target that the interpreter was built with
388+
target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
389+
- target = tuple(map(int, target.split('.')[0:2]))
390+
+ target = tuple(map(int, str(target).split('.')[0:2]))
391+
# format the target value as defined in the Apple
392+
# Availability Macros. We can't use the macro names since
393+
# at least one value we test with will not exist yet.
394+
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
395+
index a522717751..7a112ef724 100644
396+
--- a/Lib/test/test_posix.py
397+
+++ b/Lib/test/test_posix.py
398+
@@ -1056,7 +1056,7 @@ def test_getgroups(self):
399+
if sys.platform == 'darwin':
400+
import sysconfig
401+
dt = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') or '10.0'
402+
- if tuple(int(n) for n in dt.split('.')[0:2]) < (10, 6):
403+
+ if tuple(int(n) for n in str(dt).split('.')[0:2]) < (10, 6):
404+
raise unittest.SkipTest("getgroups(2) is broken prior to 10.6")
405+
406+
# 'id -G' and 'os.getgroups()' should return the same
407+
diff --git a/setup.py b/setup.py
408+
index b7a7d26c53..0c9a425016 100644
409+
--- a/setup.py
410+
+++ b/setup.py
411+
@@ -1014,7 +1014,7 @@ def detect_readline_curses(self):
412+
os_release = int(os.uname()[2].split('.')[0])
413+
dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
414+
if (dep_target and
415+
- (tuple(int(n) for n in dep_target.split('.')[0:2])
416+
+ (tuple(int(n) for n in str(dep_target).split('.')[0:2])
417+
< (10, 5) ) ):
418+
os_release = 8
419+
if os_release < 9:

0 commit comments

Comments
 (0)