From 3e213af9d5481d8b6940e06e22e100d012d2bd58 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Mon, 4 Nov 2019 00:10:13 +0100 Subject: [PATCH 1/9] macosx platform tag do not support minor bugfix release --- wheel/pep425tags.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/wheel/pep425tags.py b/wheel/pep425tags.py index 100d0b47..b185fa04 100644 --- a/wheel/pep425tags.py +++ b/wheel/pep425tags.py @@ -144,12 +144,8 @@ def calculate_macosx_platform_tag(archive_root, platform_tag): if len(versions_dict) > 0: base_version = max(base_version, max(versions_dict.values())) - if base_version[-1] == 0: - fin_base_version = base_version[:-1] - else: - fin_base_version = base_version - - fin_base_version = "_".join([str(x) for x in fin_base_version]) + # macosx platform tag do not support minor bugfix release + fin_base_version = "_".join([str(x) for x in base_version[:-1]]) if start_version < base_version: problematic_files = [k for k, v in versions_dict.items() if v > start_version] problematic_files = "\n".join(problematic_files) From 1a907d36eb4921efa0c9e7dce6b570aa5f84d7f5 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Tue, 26 Nov 2019 12:19:40 +0100 Subject: [PATCH 2/9] add regression test for minor bugfix release problem --- tests/test_macosx_libfile.py | 25 +++++++++++++++--- .../test_lib_10_10_10.dylib | Bin 0 -> 756 bytes 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 tests/testdata/macosx_minimal_system_version/test_lib_10_10_10.dylib diff --git a/tests/test_macosx_libfile.py b/tests/test_macosx_libfile.py index 9c96b822..04674aa5 100644 --- a/tests/test_macosx_libfile.py +++ b/tests/test_macosx_libfile.py @@ -6,7 +6,7 @@ from wheel.pep425tags import get_platform -def test_read_from_dynlib(): +def test_read_from_dylib(): dirname = os.path.dirname(__file__) dylib_dir = os.path.join(dirname, "testdata", "macosx_minimal_system_version") @@ -20,13 +20,16 @@ def test_read_from_dynlib(): ("test_lib_10_6_386.dylib", "10.6"), ("test_lib_10_10_386.dylib", "10.10"), ("test_lib_10_14_386.dylib", "10.14"), - ("test_lib_multiple_fat.dylib", "10.14") + ("test_lib_multiple_fat.dylib", "10.14"), + ("test_lib_10_10_10.dylib", "10.10.10") ] for file_name, ver in versions: extracted = extract_macosx_min_system_version( os.path.join(dylib_dir, file_name) ) - str_ver = str(extracted[0]) + "." + str(extracted[1]) + if extracted[-1] == 0: + extracted = extracted[:-1] + str_ver = ".".join([str(x) for x in extracted]) assert str_ver == ver assert extract_macosx_min_system_version( os.path.join(dylib_dir, "test_lib.c") @@ -95,6 +98,22 @@ def test_bump_platform_tag_by_env_variable(self, monkeypatch, capsys): captured = capsys.readouterr() assert captured.err == "" + def test_bugfix_release_platform_tag(self, monkeypatch, capsys): + dirname = os.path.dirname(__file__) + dylib_dir = os.path.join(dirname, "testdata", "macosx_minimal_system_version") + monkeypatch.setattr(distutils.util, "get_platform", return_factory("macosx-10.9-x86_64")) + monkeypatch.setattr(os, "walk", return_factory( + [(dylib_dir, [], ["test_lib_10_6.dylib", "test_lib_10_6_fat.dylib", + "test_lib_10_10_10.dylib"])] + )) + assert get_platform(dylib_dir) == "macosx_10_10_x86_64" + captured = capsys.readouterr() + assert "This wheel needs higher macosx version" in captured.err + monkeypatch.setenv("MACOSX_DEPLOYMENT_TARGET", "10.9") + assert get_platform(dylib_dir) == "macosx_10_10_x86_64" + captured = capsys.readouterr() + assert "This wheel needs higher macosx version" in captured.err + def test_warning_on_to_low_env_variable(self, monkeypatch, capsys): dirname = os.path.dirname(__file__) dylib_dir = os.path.join(dirname, "testdata", "macosx_minimal_system_version") diff --git a/tests/testdata/macosx_minimal_system_version/test_lib_10_10_10.dylib b/tests/testdata/macosx_minimal_system_version/test_lib_10_10_10.dylib new file mode 100644 index 0000000000000000000000000000000000000000..229d115f8fb6c018c2232fdec1419997d0fddff4 GIT binary patch literal 756 zcmX^A>+L^w1_nlE1|R{%EI_;g#83cYAdm!N3lJX%_yHBa096Cy1I=UrVUW2X5FcNX zT2TUFL---C5g`aZj5P(y0GS7J3mmX8G{D(FMtpp7er`cxa!Gt?UU_C-N_@PJ3$pwS zC`SQGXD~tBaso(0oeE?jKzw{^MtoXPVs0u#EIuC9eLJ8^9iVgv)I2Dcft!IL1I7l? zDnKj%#9Ull3=Di+3?R!SfcOH`{s%x>1jq;KV+a6ZWB_s>)Q!l(M6p9XI-h!U*8Vu| z`URxkqr3J8ko&@;x%LGEe@iY{$n^#PK91&}iTpis$owk)em)?-+x1KH0me?(FE90w zWgYo@Kxx6F8>%~szn>FDHIM_A^#JPj=yZMYvg7~%|3JfH4})Z202;p--UEdN2ryO! zF)&sLFbeRnb4&oL0)?Xt5NiMp0|BUh1_nnyfi@;*UN(>>C;%#F0~ySZYNRe PT6|7wNl9u^F-R!@L6mUR literal 0 HcmV?d00001 From 0dd9f3e66893517ec4c9521db523ea3a899a5148 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Sat, 21 Dec 2019 13:48:21 +0100 Subject: [PATCH 3/9] Fix for files without specified minimum version. test file is from delocate project --- tests/test_macosx_libfile.py | 9 ++++++--- .../macosx_minimal_system_version/libb.dylib | Bin 0 -> 9544 bytes wheel/pep425tags.py | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 tests/testdata/macosx_minimal_system_version/libb.dylib diff --git a/tests/test_macosx_libfile.py b/tests/test_macosx_libfile.py index 04674aa5..43e4fe15 100644 --- a/tests/test_macosx_libfile.py +++ b/tests/test_macosx_libfile.py @@ -31,9 +31,12 @@ def test_read_from_dylib(): extracted = extracted[:-1] str_ver = ".".join([str(x) for x in extracted]) assert str_ver == ver - assert extract_macosx_min_system_version( - os.path.join(dylib_dir, "test_lib.c") - ) is None + assert extract_macosx_min_system_version( + os.path.join(dylib_dir, "test_lib.c") + ) is None + assert extract_macosx_min_system_version( + os.path.join(dylib_dir, "libb.dylib") + ) is None def return_factory(return_val): diff --git a/tests/testdata/macosx_minimal_system_version/libb.dylib b/tests/testdata/macosx_minimal_system_version/libb.dylib new file mode 100644 index 0000000000000000000000000000000000000000..25c954656b07e8abb28f87fbc296f90214207dd2 GIT binary patch literal 9544 zcmeHNU2IfE6rOD>EVQsKKLJrm3q@-X+J#a|kfi)vyqi|6-4d(B47=Mcd&B;ey?1Nd zu%yyry4EI*(fB}Oh%u4yL=35Yf(Av3G0_+wc+jK|Xtn_Y8Xu}6>v!hPE!*9K)%bW% zdglDhnKNh3o!Q~UaK0b`uEDs8PoHM=OC zEix&?CxaW|lPowlg53sjCgl2?ppF5z9VR6i-9CUK*7rale|k^E9}9EcNci3P@r^Dq zt?OhXlBH{*aY}zQW&+Lwx)Il+M@%tqytkykB3W+Y-?YkoY0(mWx*R;-*yVl+t2;2nu*;GzDURu}M_ z9oHgDFDd6y%n@^{bQ$5r8QiK(@12&(7_7E$c}PEe#RiL1P!f6y~F%HYKBZeF%pt3J(CjP!@!C5tLCVrHrBYvj|CWz zFMC{MR}Z9^gxw;u_v(ZmuZA(9ZnOtBZroh=sCLB#NqBIu>~`KB-3UfD@5yclBOB}t z*cq@hU}wP2z`xGGK{fT0+JCDwmAscqO!p`6ITD-ROipJqj3p}7;a%_G1uOj{{-LVF zE1kb(G8d@_=s$o;=&yZFE-q4oOVF|OxlATwD!p*rrlyi(YASJFO&vU|4kgc~Pmr_B zgql(&)gk4)$$qO2CxFSxbdsuv7^<(MdJ=TvOXZG3y{e2;*Ect+Lx~CDXeTUPqouGK zR|}Of*C?yM?0Ro}P`RUKUYt-fP*c@T<+@(om%PIgS8hHt)A&AonT@Z{)wn-7!Hfl> z)z|Q1*$j-I*y0*}{SNgnGLasg%g=}7uF>&|>!-$D?^8IgQH0e0McW}WE$Z;Lb7-Xw z?Ye|Fg!H?_r>?3)+r~&d3NcMDU(z_0oJRWYA_yQ2cAB!Y(GrvdjhpQf5P!D7!`3E6U@dJR!}B$?i~NS08xTE2reKtcGs3k9G7Nbm9`_-d>aEg8diprafwW59y#OPIs_j&qbz z9|Vrx<`(AYE?sc?0JVM!qf&y$OB|#BYFD-qmpoqF!VtxOSJw2_` zzfAj8!V46+_C@r<++Rrc1Hi$1ru|;<0&?x8n(QwCPfL4x#})7h`x`L$Q^vDKn&-tM z_2hpAVm>16H~oXXRb5qv4p{1KIR;e zaxmH+_5{3!+Z_n`;@pV)G(-0U6r}~at$v@b1$Yc6=Rse@)5=?GxZbI2#`k!!Wzs8quPjh|<#7%Dr3Y51||u2FGg3 z$i(gILW5)VBHROwUcFY=dV`8kHq0osZY4rys;TkD!n)GDzr`E#a)tEGQg762F`Z)& z!CDVaocFp-M{RRg?~~ObQSCLtx@UfQ3A7?B+jw(hfI9D7PRR*$`?wERA~XX!0tZHi z)6D|6zl*K+8u^*1DrBFnVTDCE#8wdPr>(X2sKBoPE`@B}qfn%5?eDxIW!g(4=mC=b zX}Ldh67t$2#;kh?6x7nij9KT;XCS*^k3Bd6p9r~+S^GP*i|SyGnTW2KGKDGNdz7f3 zktcKHUvuPQc*?e~6!L>@#OfURXpa5Irc8T$0zS>LpD^W_dOAN)Zi{wyNmt znr^}@1JX8SDR4Ou&_Fn!c4S=6aI+!A#mPBth4^UZ4g-F zav$z`vU;f;qTC6;f>@_DvvD%2Az0QPYt`#;{ ig;-mtuzrC|_P_o3h_?S_an4?rbN_ 0: base_version = max(base_version, max(versions_dict.values())) From 25c8fb6b1f21a8d2ba22b7a69597ee98273580cc Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Sat, 28 Dec 2019 08:33:36 +0100 Subject: [PATCH 4/9] change test to use full version number --- tests/test_macosx_libfile.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tests/test_macosx_libfile.py b/tests/test_macosx_libfile.py index 43e4fe15..fd7ce8eb 100644 --- a/tests/test_macosx_libfile.py +++ b/tests/test_macosx_libfile.py @@ -11,24 +11,22 @@ def test_read_from_dylib(): dylib_dir = os.path.join(dirname, "testdata", "macosx_minimal_system_version") versions = [ - ("test_lib_10_6_fat.dylib", "10.6"), - ("test_lib_10_10_fat.dylib", "10.10"), - ("test_lib_10_14_fat.dylib", "10.14"), - ("test_lib_10_6.dylib", "10.6"), - ("test_lib_10_10.dylib", "10.10"), - ("test_lib_10_14.dylib", "10.14"), - ("test_lib_10_6_386.dylib", "10.6"), - ("test_lib_10_10_386.dylib", "10.10"), - ("test_lib_10_14_386.dylib", "10.14"), - ("test_lib_multiple_fat.dylib", "10.14"), + ("test_lib_10_6_fat.dylib", "10.6.0"), + ("test_lib_10_10_fat.dylib", "10.10.0"), + ("test_lib_10_14_fat.dylib", "10.14.0"), + ("test_lib_10_6.dylib", "10.6.0"), + ("test_lib_10_10.dylib", "10.10.0"), + ("test_lib_10_14.dylib", "10.14.0"), + ("test_lib_10_6_386.dylib", "10.6.0"), + ("test_lib_10_10_386.dylib", "10.10.0"), + ("test_lib_10_14_386.dylib", "10.14.0"), + ("test_lib_multiple_fat.dylib", "10.14.0"), ("test_lib_10_10_10.dylib", "10.10.10") ] for file_name, ver in versions: extracted = extract_macosx_min_system_version( os.path.join(dylib_dir, file_name) ) - if extracted[-1] == 0: - extracted = extracted[:-1] str_ver = ".".join([str(x) for x in extracted]) assert str_ver == ver assert extract_macosx_min_system_version( From 80eac7be336755ef086648ff88429b58532d0aa1 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Sat, 28 Dec 2019 08:37:32 +0100 Subject: [PATCH 5/9] change to use 2 version number all time --- wheel/pep425tags.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/wheel/pep425tags.py b/wheel/pep425tags.py index 90cdb180..2e898bb6 100644 --- a/wheel/pep425tags.py +++ b/wheel/pep425tags.py @@ -115,15 +115,15 @@ def calculate_macosx_platform_tag(archive_root, platform_tag): """ prefix, base_version, suffix = platform_tag.split('-') base_version = tuple([int(x) for x in base_version.split(".")]) - if len(base_version) == 2: - base_version = base_version + (0,) + if len(base_version) >= 2: + base_version = base_version[0:2] - assert len(base_version) == 3 + assert len(base_version) == 2 if "MACOSX_DEPLOYMENT_TARGET" in os.environ: deploy_target = tuple([int(x) for x in os.environ[ "MACOSX_DEPLOYMENT_TARGET"].split(".")]) - if len(deploy_target) == 2: - deploy_target = deploy_target + (0,) + if len(deploy_target) >= 2: + deploy_target = deploy_target[0:2] if deploy_target < base_version: sys.stderr.write( "[WARNING] MACOSX_DEPLOYMENT_TARGET is set " @@ -132,7 +132,7 @@ def calculate_macosx_platform_tag(archive_root, platform_tag): else: base_version = deploy_target - assert len(base_version) == 3 + assert len(base_version) == 2 start_version = base_version versions_dict = {} for (dirpath, dirnames, filenames) in os.walk(archive_root): @@ -141,13 +141,13 @@ def calculate_macosx_platform_tag(archive_root, platform_tag): lib_path = os.path.join(dirpath, filename) min_ver = extract_macosx_min_system_version(lib_path) if min_ver is not None: - versions_dict[lib_path] = min_ver + versions_dict[lib_path] = min_ver[0:2] if len(versions_dict) > 0: base_version = max(base_version, max(versions_dict.values())) # macosx platform tag do not support minor bugfix release - fin_base_version = "_".join([str(x) for x in base_version[:-1]]) + fin_base_version = "_".join([str(x) for x in base_version]) if start_version < base_version: problematic_files = [k for k, v in versions_dict.items() if v > start_version] problematic_files = "\n".join(problematic_files) From b1f399906dbd7fe1e326bc7e38825d9d87363d36 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Fri, 3 Jan 2020 16:16:38 +0100 Subject: [PATCH 6/9] fixed typos indicated by YannickJadoul --- tests/test_macosx_libfile.py | 12 ++++++------ wheel/pep425tags.py | 26 +++++++++++++++----------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/tests/test_macosx_libfile.py b/tests/test_macosx_libfile.py index fd7ce8eb..452bf794 100644 --- a/tests/test_macosx_libfile.py +++ b/tests/test_macosx_libfile.py @@ -57,7 +57,7 @@ def test_version_bump(self, monkeypatch, capsys): monkeypatch.setattr(distutils.util, "get_platform", return_factory("macosx-10.9-x86_64")) assert get_platform(dylib_dir) == "macosx_10_14_x86_64" captured = capsys.readouterr() - assert "[WARNING] This wheel needs higher macosx version than" in captured.err + assert "[WARNING] This wheel needs a higher macOS version than" in captured.err def test_information_about_problematic_files_python_version(self, monkeypatch, capsys): dirname = os.path.dirname(__file__) @@ -68,8 +68,8 @@ def test_information_about_problematic_files_python_version(self, monkeypatch, c )) assert get_platform(dylib_dir) == "macosx_10_10_x86_64" captured = capsys.readouterr() - assert "[WARNING] This wheel needs higher macosx version than" in captured.err - assert "your python is compiled against." in captured.err + assert "[WARNING] This wheel needs a higher macOS version than" in captured.err + assert "the version your Python interpreter is compiled against." in captured.err assert "test_lib_10_10_fat.dylib" in captured.err def test_information_about_problematic_files_env_variable(self, monkeypatch, capsys): @@ -82,7 +82,7 @@ def test_information_about_problematic_files_env_variable(self, monkeypatch, cap )) assert get_platform(dylib_dir) == "macosx_10_10_x86_64" captured = capsys.readouterr() - assert "[WARNING] This wheel needs higher macosx version than" in captured.err + assert "[WARNING] This wheel needs a higher macOS version than" in captured.err assert "is set in MACOSX_DEPLOYMENT_TARGET variable." in captured.err assert "test_lib_10_10_fat.dylib" in captured.err @@ -109,11 +109,11 @@ def test_bugfix_release_platform_tag(self, monkeypatch, capsys): )) assert get_platform(dylib_dir) == "macosx_10_10_x86_64" captured = capsys.readouterr() - assert "This wheel needs higher macosx version" in captured.err + assert "This wheel needs a higher macOS version than" in captured.err monkeypatch.setenv("MACOSX_DEPLOYMENT_TARGET", "10.9") assert get_platform(dylib_dir) == "macosx_10_10_x86_64" captured = capsys.readouterr() - assert "This wheel needs higher macosx version" in captured.err + assert "This wheel needs a higher macOS version than" in captured.err def test_warning_on_to_low_env_variable(self, monkeypatch, capsys): dirname = os.path.dirname(__file__) diff --git a/wheel/pep425tags.py b/wheel/pep425tags.py index 2e898bb6..d4b84a28 100644 --- a/wheel/pep425tags.py +++ b/wheel/pep425tags.py @@ -112,6 +112,8 @@ def get_abi_tag(): def calculate_macosx_platform_tag(archive_root, platform_tag): """ Calculate proper macosx platform tag basing on files which are included to wheel + + Example platform tag `macosx-10.14-x86_64` """ prefix, base_version, suffix = platform_tag.split('-') base_version = tuple([int(x) for x in base_version.split(".")]) @@ -151,21 +153,23 @@ def calculate_macosx_platform_tag(archive_root, platform_tag): if start_version < base_version: problematic_files = [k for k, v in versions_dict.items() if v > start_version] problematic_files = "\n".join(problematic_files) + if len(problematic_files) == 1: + files_form = "this file" + else: + files_form = "these files" error_message = \ - "[WARNING] This wheel needs higher macosx version than {} " \ - "is set in MACOSX_DEPLOYMENT_TARGET variable. " \ - "To silence this warning set MACOSX_DEPLOYMENT_TARGET to " +\ - fin_base_version + " or recreate this files with lower " \ - "MACOSX_DEPLOYMENT_TARGET \n" + problematic_files + "[WARNING] This wheel needs a higher macOS version than {} " \ + "To silence this warning, set MACOSX_DEPLOYMENT_TARGET to at least " +\ + fin_base_version + " or recreate " + files_form + " with lower " \ + "MACOSX_DEPLOYMENT_TARGET: \n" + problematic_files if "MACOSX_DEPLOYMENT_TARGET" in os.environ: - sys.stderr.write( - error_message.format("is set in MACOSX_DEPLOYMENT_TARGET variable.") - ) + error_message = error_message.format("is set in MACOSX_DEPLOYMENT_TARGET variable.") else: - sys.stderr.write( - error_message.format("your python is compiled against.") - ) + error_message = error_message.format( + "the version your Python interpreter is compiled against.") + + sys.stderr.write(error_message) platform_tag = prefix + "_" + fin_base_version + "_" + suffix return platform_tag From 496c5c617444b16ffa18bf2b669fc73b2a429a77 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Fri, 3 Jan 2020 16:32:59 +0100 Subject: [PATCH 7/9] remove unused assignment remove unused class --- wheel/macosx_libfile.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/wheel/macosx_libfile.py b/wheel/macosx_libfile.py index 5056f357..12856184 100644 --- a/wheel/macosx_libfile.py +++ b/wheel/macosx_libfile.py @@ -53,7 +53,7 @@ LC_BUILD_VERSION = 0x32 -mach_header_fields = _fields_ = [ +mach_header_fields = [ ("magic", ctypes.c_uint32), ("cputype", ctypes.c_int), ("cpusubtype", ctypes.c_int), ("filetype", ctypes.c_uint32), ("ncmds", ctypes.c_uint32), ("sizeofcmds", ctypes.c_uint32), @@ -265,9 +265,6 @@ class FatArch(BaseClass): fat_arch_list = [read_data(FatArch, lib_file) for _ in range(fat_header.nfat_arch)] - class SegmentBase(BaseClass): - _fields_ = segment_base_fields - versions_list = [] for el in fat_arch_list: try: @@ -304,22 +301,17 @@ def read_mach_header(lib_file, seek=None): class SegmentBase(base_class): _fields_ = segment_base_fields + if arch == "32": class MachHeader(base_class): _fields_ = mach_header_fields - class SegmentCommand(base_class): - _fields_ = segment_command_fields - else: class MachHeader(base_class): _fields_ = mach_header_fields_64 - class SegmentCommand(base_class): - _fields_ = segment_command_fields_64 - mach_header = read_data(MachHeader, lib_file) for _i in range(mach_header.ncmds): pos = lib_file.tell() From b66add519c1c43e969697df221dc50ff87c30a2f Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Fri, 3 Jan 2020 16:43:42 +0100 Subject: [PATCH 8/9] change message for to low MACOSX_DEPLOYMENT_TARGET to more verbose --- tests/test_macosx_libfile.py | 2 +- wheel/pep425tags.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_macosx_libfile.py b/tests/test_macosx_libfile.py index 452bf794..7bd696d8 100644 --- a/tests/test_macosx_libfile.py +++ b/tests/test_macosx_libfile.py @@ -125,7 +125,7 @@ def test_warning_on_to_low_env_variable(self, monkeypatch, capsys): )) assert get_platform(dylib_dir) == "macosx_10_9_x86_64" captured = capsys.readouterr() - assert "MACOSX_DEPLOYMENT_TARGET is set to lower value than your python" in captured.err + assert "MACOSX_DEPLOYMENT_TARGET is set to a lower value (10.8) than the" in captured.err def test_get_platform_linux(monkeypatch): diff --git a/wheel/pep425tags.py b/wheel/pep425tags.py index d4b84a28..c0a8c466 100644 --- a/wheel/pep425tags.py +++ b/wheel/pep425tags.py @@ -128,8 +128,10 @@ def calculate_macosx_platform_tag(archive_root, platform_tag): deploy_target = deploy_target[0:2] if deploy_target < base_version: sys.stderr.write( - "[WARNING] MACOSX_DEPLOYMENT_TARGET is set " - "to lower value than your python is compiled\n" + "[WARNING] MACOSX_DEPLOYMENT_TARGET is set to a lower value ({}) than the " + "version on which the Python interpreter was compiled ({}), and will be " + "ignored.\n".format('.'.join(str(x) for x in deploy_target), + '.'.join(str(x) for x in base_version)) ) else: base_version = deploy_target From 05700848e8cbc018095e3e7288662c5685ab9b67 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Fri, 3 Jan 2020 16:59:48 +0100 Subject: [PATCH 9/9] change parse_version to be more clear. --- wheel/macosx_libfile.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/wheel/macosx_libfile.py b/wheel/macosx_libfile.py index 12856184..a9036886 100644 --- a/wheel/macosx_libfile.py +++ b/wheel/macosx_libfile.py @@ -335,8 +335,7 @@ class VersionBuild(base_class): def parse_version(version): - zz = version & 2**9-1 - version >>= 8 - yy = version & 2**9-1 - version >>= 8 - return version, yy, zz + x = (version & 0xffff0000) >> 16 + y = (version & 0x0000ff00) >> 8 + z = (version & 0x000000ff) + return x, y, z