Skip to content

Commit

Permalink
Upgrade Pex to 2.1.67. (Cherry-pick of #14544) (#14546)
Browse files Browse the repository at this point in the history
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 b2f4b01)
  • Loading branch information
jsirois committed Feb 21, 2022
1 parent 5a833d0 commit 55c9c46
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 24 deletions.
8 changes: 4 additions & 4 deletions 3rdparty/python/lockfiles/user_reqs.txt
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions 3rdparty/python/requirements.txt
Expand Up @@ -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
Expand Down
Expand Up @@ -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
24 changes: 13 additions & 11 deletions src/python/pants/backend/python/target_types.py
Expand Up @@ -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."
)


Expand Down
8 changes: 4 additions & 4 deletions src/python/pants/backend/python/util_rules/pex_cli.py
Expand Up @@ -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):
Expand All @@ -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"]
Expand Down

0 comments on commit 55c9c46

Please sign in to comment.