diff --git a/CHANGES.md b/CHANGES.md index d5066a0e7..67c5fe69d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,12 @@ # Release Notes +## 2.28.0 + +This release adds Pex `--scie {eager,lazy}` support for Linux ppc64le +and s390x. + +* Add `--scie` support for Linux ppc64le and s390x. (#2635) + ## 2.27.1 This release fixes a bug in `PEX_ROOT` handling that could manifest diff --git a/pex/scie/model.py b/pex/scie/model.py index 98f4a5b9c..505dc0056 100644 --- a/pex/scie/model.py +++ b/pex/scie/model.py @@ -241,6 +241,10 @@ def __get__(self, obj, objtype=None): self._current = SciePlatform.LINUX_AARCH64 elif machine in ("armv7l", "armv8l"): self._current = SciePlatform.LINUX_ARMV7L + elif machine == "ppc64le": + self._current = SciePlatform.LINUX_PPC64LE + elif machine == "s390x": + self._current = SciePlatform.LINUX_S390X elif machine in ("amd64", "x86_64"): self._current = SciePlatform.LINUX_X86_64 elif "darwin" == system: @@ -291,6 +295,8 @@ def qualified_file_name(self, file_name): LINUX_AARCH64 = Value("linux-aarch64") LINUX_ARMV7L = Value("linux-armv7l") + LINUX_PPC64LE = Value("linux-powerpc64") + LINUX_S390X = Value("linux-s390x") LINUX_X86_64 = Value("linux-x86_64") MACOS_AARCH64 = Value("macos-aarch64") MACOS_X86_64 = Value("macos-x86_64") @@ -445,8 +451,10 @@ def _from_platform_specs( platform_str = platform_spec.platform is_aarch64 = "arm64" in platform_str or "aarch64" in platform_str is_armv7l = "armv7l" in platform_str or "armv8l" in platform_str + is_ppc64le = "ppc64le" in platform_str + is_s390x = "s390x" in platform_str is_x86_64 = "amd64" in platform_str or "x86_64" in platform_str - if not is_aarch64 ^ is_armv7l ^ is_x86_64: + if not is_aarch64 ^ is_armv7l ^ is_ppc64le ^ is_s390x ^ is_x86_64: continue if "linux" in platform_str: @@ -454,6 +462,10 @@ def _from_platform_specs( scie_platform = SciePlatform.LINUX_AARCH64 elif is_armv7l: scie_platform = SciePlatform.LINUX_ARMV7L + elif is_ppc64le: + scie_platform = SciePlatform.LINUX_PPC64LE + elif is_s390x: + scie_platform = SciePlatform.LINUX_S390X else: scie_platform = SciePlatform.LINUX_X86_64 elif "mac" in platform_str: @@ -484,6 +496,13 @@ def _from_platform_specs( # PyPy distributions are not available for Linux armv7l if SciePlatform.LINUX_ARMV7L is scie_platform: continue + # PyPy distributions for Linux ppc64le are only available for 2.7 and 3.{5,6}. + if ( + SciePlatform.LINUX_PPC64LE is scie_platform + and plat_python_version[0] == 3 + and plat_python_version >= (3, 7) + ): + continue # PyPy distributions for Mac arm64 start with 3.8 (and PyPy always releases for # 2.7). if ( diff --git a/pex/scie/science.py b/pex/scie/science.py index d42dd2cbc..a1e8f8c3d 100644 --- a/pex/scie/science.py +++ b/pex/scie/science.py @@ -64,7 +64,7 @@ def qualified_binary_name(self, binary_name): SCIENCE_RELEASES_URL = "https://github.com/a-scie/lift/releases" -MIN_SCIENCE_VERSION = Version("0.9.0") +MIN_SCIENCE_VERSION = Version("0.10.0") SCIENCE_REQUIREMENT = SpecifierSet("~={min_version}".format(min_version=MIN_SCIENCE_VERSION)) @@ -78,8 +78,8 @@ def _science_binary_url(suffix=""): ) -PTEX_VERSION = "1.4.0" -SCIE_JUMP_VERSION = "1.4.1" +PTEX_VERSION = "1.5.0" +SCIE_JUMP_VERSION = "1.5.0" @attr.s(frozen=True) diff --git a/pex/version.py b/pex/version.py index 61e5d7dfd..9e1517308 100644 --- a/pex/version.py +++ b/pex/version.py @@ -1,4 +1,4 @@ # Copyright 2015 Pex project contributors. # Licensed under the Apache License, Version 2.0 (see LICENSE). -__version__ = "2.27.1" +__version__ = "2.28.0" diff --git a/testing/__init__.py b/testing/__init__.py index 172a8dad9..b9be3f12a 100644 --- a/testing/__init__.py +++ b/testing/__init__.py @@ -67,10 +67,8 @@ IS_MAC = platform.system() == "Darwin" IS_X86_64 = platform.machine().lower() in ("amd64", "x86_64") IS_ARM_64 = platform.machine().lower() in ("arm64", "aarch64") -IS_ARMV7L = platform.machine().lower() in ("armv7l", "armv8l") IS_LINUX_X86_64 = IS_LINUX and IS_X86_64 IS_LINUX_ARM64 = IS_LINUX and IS_ARM_64 -IS_LINUX_ARMV7L = IS_LINUX and IS_ARMV7L IS_MAC_X86_64 = IS_MAC and IS_X86_64 IS_MAC_ARM64 = IS_MAC and IS_ARM_64 NOT_CPYTHON27_OR_OSX = NOT_CPYTHON27 or not IS_LINUX diff --git a/tests/integration/scie/test_pex_scie.py b/tests/integration/scie/test_pex_scie.py index ae54bd9f2..a96bd2af5 100644 --- a/tests/integration/scie/test_pex_scie.py +++ b/tests/integration/scie/test_pex_scie.py @@ -163,6 +163,10 @@ def create_scies( "--platform", "linux-armv7l-cp-311-cp311", "--platform", + "linux-ppc64le-cp-312-cp312", + "--platform", + "linux-s390x-cp-313-cp313", + "--platform", "linux-x86_64-cp-310-cp310", "--platform", "macosx-10.9-arm64-cp-311-cp311", @@ -175,6 +179,8 @@ def create_scies( python_version_by_platform = { SciePlatform.LINUX_AARCH64: "3.9", SciePlatform.LINUX_ARMV7L: "3.11", + SciePlatform.LINUX_PPC64LE: "3.12", + SciePlatform.LINUX_S390X: "3.13", SciePlatform.LINUX_X86_64: "3.10", SciePlatform.MACOS_AARCH64: "3.11", SciePlatform.MACOS_X86_64: "3.12", @@ -232,13 +238,15 @@ def assert_platforms( expected_platforms=( SciePlatform.LINUX_AARCH64, SciePlatform.LINUX_ARMV7L, + SciePlatform.LINUX_PPC64LE, + SciePlatform.LINUX_S390X, SciePlatform.LINUX_X86_64, SciePlatform.MACOS_AARCH64, SciePlatform.MACOS_X86_64, ), ) - # Now restrict the PEX's implied natural platform set of 5 down to 2 or 3 using + # Now restrict the PEX's implied natural platform set of 7 down to 2 or 3 using # `--scie-platform`. restricted_platforms_output_dir = os.path.join(str(tmpdir), "restricted-platforms") create_scies( @@ -302,7 +310,7 @@ def test_specified_science_binary(tmpdir): local_science_binary = os.path.join(str(tmpdir), "science") with open(local_science_binary, "wb") as write_fp, URLFetcher().get_body_stream( - "https://github.com/a-scie/lift/releases/download/v0.9.0/{binary}".format( + "https://github.com/a-scie/lift/releases/download/v0.10.0/{binary}".format( binary=SciePlatform.CURRENT.qualified_binary_name("science") ) ) as read_fp: @@ -346,7 +354,7 @@ def test_specified_science_binary(tmpdir): cached_science_binaries ), "Expected the local science binary to be used but not cached." assert ( - "0.9.0" + "0.10.0" == subprocess.check_output(args=[local_science_binary, "--version"]).decode("utf-8").strip() ) @@ -394,6 +402,8 @@ def make_20240415_3_10_14_url(platform): "x86_64-apple-darwin", "aarch64-unknown-linux-gnu", "armv7-unknown-linux-gnueabihf", + "ppc64le-unknown-linux-gnu", + "s390x-unknown-linux-gnu", "x86_64-unknown-linux-gnu", ) } @@ -419,6 +429,10 @@ def make_20240415_3_10_14_url(platform): expected_platform = "aarch64-unknown-linux-gnu" elif SciePlatform.CURRENT is SciePlatform.LINUX_ARMV7L: expected_platform = "armv7-unknown-linux-gnueabihf" + elif SciePlatform.CURRENT is SciePlatform.LINUX_PPC64LE: + expected_platform = "ppc64le-unknown-linux-gnu" + elif SciePlatform.CURRENT is SciePlatform.LINUX_S390X: + expected_platform = "s390x-unknown-linux-gnu" elif SciePlatform.CURRENT is SciePlatform.LINUX_X86_64: expected_platform = "x86_64-unknown-linux-gnu" elif SciePlatform.CURRENT is SciePlatform.MACOS_AARCH64: diff --git a/tests/test_pep_508.py b/tests/test_pep_508.py index afb0b5da5..de9f285bf 100644 --- a/tests/test_pep_508.py +++ b/tests/test_pep_508.py @@ -94,6 +94,8 @@ def assert_platform_machine( assert_platform_machine("x86_64", "manylinux_2_5-x86_64-cp-37-cp37m") assert_platform_machine("aarch64", "manylinux_2_77-aarch64-cp-37-cp37m") assert_platform_machine("armv7l", "linux-armv7l-cp-311-cp311") + assert_platform_machine("ppc64le", "linux-ppc64le-cp-312-cp312") + assert_platform_machine("s390x", "linux-s390x-cp-313-cp313") assert_platform_machine("x86_64", "macosx-10.15-x86_64-cp-38-m") assert_platform_machine("arm64", "macosx-11.0-arm64-cp-39-cp39")