From 55c9c464665945fc1b031efaa0150db7fca029c9 Mon Sep 17 00:00:00 2001 From: John Sirois Date: Mon, 21 Feb 2022 09:53:17 -0800 Subject: [PATCH] Upgrade Pex to 2.1.67. (Cherry-pick of #14544) (#14546) See the changelog here: https://github.com/pantsbuild/pex/releases/tag/v2.1.67 This pulls in support for `--platform` values with 3-component dotted PYVER allowing an easier workaround than resorting to complete platforms for evaluating `python_full_version` environment markers in platform resolves. (cherry picked from commit b2f4b01b5c0a94cb212635f0c4e27550da28689d) --- 3rdparty/python/lockfiles/user_reqs.txt | 8 +++---- 3rdparty/python/requirements.txt | 4 ++-- .../python/subsystems/lambdex_lockfile.txt | 6 ++--- .../pants/backend/python/target_types.py | 24 ++++++++++--------- .../backend/python/util_rules/pex_cli.py | 8 +++---- 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/3rdparty/python/lockfiles/user_reqs.txt b/3rdparty/python/lockfiles/user_reqs.txt index cd9759d2df3..59ff9248f43 100644 --- a/3rdparty/python/lockfiles/user_reqs.txt +++ b/3rdparty/python/lockfiles/user_reqs.txt @@ -17,7 +17,7 @@ # "humbug==0.2.7", # "ijson==3.1.4", # "packaging==21.3", -# "pex==2.1.66", +# "pex==2.1.67", # "psutil==5.9.0", # "pydevd-pycharm==203.5419.8", # "pytest<8,>=6.2.4", @@ -141,9 +141,9 @@ iniconfig==1.1.1; python_version >= "3.6" \ packaging==21.3; python_version >= "3.6" \ --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 \ --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb -pex==2.1.66; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0" and python_version < "3.11") \ - --hash=sha256:a6543af27bdfef2b8c88a92765f25bb30178a91d1fcda5963475d1719bd65dae \ - --hash=sha256:1580ee7680a0c64db09233d55d39f31f3090470b479a0252fb69b0a0a6e3dccb +pex==2.1.67; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0" and python_version < "3.11") \ + --hash=sha256:9ebd76d04f1b9f576c38639197b0c93d41d7b1359f2917663951f8fda89d9436 \ + --hash=sha256:aedc4746e677d12f35a5d594bd09d22267045fafef098fe9bca14d63bb09681c pluggy==1.0.0; python_version >= "3.6" \ --hash=sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3 \ --hash=sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159 diff --git a/3rdparty/python/requirements.txt b/3rdparty/python/requirements.txt index d8a814f9e85..626c0f8eb3b 100644 --- a/3rdparty/python/requirements.txt +++ b/3rdparty/python/requirements.txt @@ -14,9 +14,9 @@ humbug==0.2.7 ijson==3.1.4 packaging==21.3 -pex==2.1.66 +pex==2.1.67 psutil==5.9.0 -pytest>=6.2.4,<8 # This should be compatible with pytest.py, although it can be looser so that we don't over-constrain pantsbuild.pants.testutil +pytest>=6.2.4,<8 # This should be compatible with pytest.py, although it can be looser so that we don't over-constrain pantsbuild.pants.testutil python-lsp-jsonrpc==1.0.0 PyYAML>=6.0,<7.0 requests[security]>=2.25.1 diff --git a/src/python/pants/backend/python/subsystems/lambdex_lockfile.txt b/src/python/pants/backend/python/subsystems/lambdex_lockfile.txt index cbd141bc20f..4a1e56d47d9 100644 --- a/src/python/pants/backend/python/subsystems/lambdex_lockfile.txt +++ b/src/python/pants/backend/python/subsystems/lambdex_lockfile.txt @@ -17,6 +17,6 @@ lambdex==0.1.6; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.6.0" and python_version < "3.10") \ --hash=sha256:cb685b106617fbd1afd26d6e9472b2e0c99df8574c6d358aee4e6c13aeef8eb1 \ --hash=sha256:6d1a95c8a31baa703edece8e36a705045b0203c7e886812c27a4dd945aa694e0 -pex==2.1.66; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version < "3.10" \ - --hash=sha256:a6543af27bdfef2b8c88a92765f25bb30178a91d1fcda5963475d1719bd65dae \ - --hash=sha256:1580ee7680a0c64db09233d55d39f31f3090470b479a0252fb69b0a0a6e3dccb +pex==2.1.67; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version < "3.10" \ + --hash=sha256:9ebd76d04f1b9f576c38639197b0c93d41d7b1359f2917663951f8fda89d9436 \ + --hash=sha256:aedc4746e677d12f35a5d594bd09d22267045fafef098fe9bca14d63bb09681c diff --git a/src/python/pants/backend/python/target_types.py b/src/python/pants/backend/python/target_types.py index acc2aae4a4f..1787f047f50 100644 --- a/src/python/pants/backend/python/target_types.py +++ b/src/python/pants/backend/python/target_types.py @@ -292,18 +292,20 @@ class PexPlatformsField(StringSequenceField): "meaning that the PEX will be executable in all of the supported environments.\n\n" "Platforms should be in the format defined by Pex " "(https://pex.readthedocs.io/en/latest/buildingpex.html#platform), i.e. " - 'PLATFORM-IMPL-PYVER-ABI (e.g. "linux_x86_64-cp-27-cp27mu", ' - '"macosx_10.12_x86_64-cp-36-cp36m"):\n\n' + 'PLATFORM-IMPL-PYVER-ABI (e.g. "linux_x86_64-cp-37-cp37m", ' + '"macosx_10.12_x86_64-cp-310-cp310"):\n\n' " - PLATFORM: the host platform, e.g. " - '"linux-x86_64", "macosx-10.12-x86_64".\n - IMPL: the Python implementation ' - 'abbreviation, e.g. "cp", "pp", "jp".\n - PYVER: a two-digit string representing ' - 'the Python version, e.g. "27", "36".\n - ABI: the ABI tag, e.g. "cp36m", ' - '"cp27mu", "abi3", "none".\n\nNote that using an abbreviated platform means that certain ' - "resolves will fail when they contain environment markers that cannot be deduced from the " - "abbreviated platform string. A common example of this is 'python_full_version' which " - "requires knowing the patch level version of the foreign platform. If your resolves fail " - "due to undefined environment markers like this, you should switch to specifying " - "`complete_platforms` instead." + '"linux-x86_64", "macosx-10.12-x86_64".\n - IMPL: the Python implementation abbreviation, ' + 'e.g. "cp" or "pp".\n - PYVER: a two or more digit string representing the python ' + 'major/minor version (e.g., "37" or "310") or else a component dotted version string (e.g.,' + '"3.7" or "3.10.1").\n - ABI: the ABI tag, e.g. "cp37m", "cp310", "abi3", "none".\n\nNote ' + "that using an abbreviated platform means that certain resolves will fail when they " + "encounter environment markers that cannot be deduced from the abbreviated platform " + "string. A common example of this is 'python_full_version' which requires knowing the " + "patch level version of the foreign Python interpreter. To remedy this you should use a " + "3-component dotted version for PYVER. If your resolves fail due to more esoteric " + "undefined environment markers, you should switch to specifying `complete_platforms` " + "instead." ) diff --git a/src/python/pants/backend/python/util_rules/pex_cli.py b/src/python/pants/backend/python/util_rules/pex_cli.py index 58642d96f8a..a108ab1a583 100644 --- a/src/python/pants/backend/python/util_rules/pex_cli.py +++ b/src/python/pants/backend/python/util_rules/pex_cli.py @@ -42,9 +42,9 @@ class PexCli(TemplatedExternalTool): deprecated_options_scope = "download-pex-bin" deprecated_options_scope_removal_version = "2.11.0.dev0" - default_version = "v2.1.66" + default_version = "v2.1.67" default_url_template = "https://github.com/pantsbuild/pex/releases/download/{version}/pex" - version_constraints = ">=2.1.66,<3.0" + version_constraints = ">=2.1.67,<3.0" @classproperty def default_known_versions(cls): @@ -53,8 +53,8 @@ def default_known_versions(cls): ( cls.default_version, plat, - "d3f985ab510a3a9442ae33d1e13277e29ab4d32c948800edf546f4f8bd7ca470", - "3722278", + "3f376dba013a6f1a810bfb59fd56a7d95a5ad297f04f57011d0b96cb1624676f", + "3726119", ) ) for plat in ["macos_arm64", "macos_x86_64", "linux_x86_64"]