Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix universal lock handling of the none ABI. #2270

Merged
merged 2 commits into from
Nov 3, 2023

Conversation

jsirois
Copy link
Member

@jsirois jsirois commented Nov 2, 2023

The none ABI indicates no native ABI attachment; and so just the
standard guarantees of pure Python. In general this means no breaks
within a major version (just fixes and additions). Although it's known
CPython does deal breaks within a major version span (some deprecated
items are removed), the de-facto standard presented by PyPA's packaging
library indicate the none ABI is compatible for all minor versions in
the major version range (much like the abi3 ABI for Python 3). As
such, fix universal lock handling to accept a *<major>*-none-*.whl for
all minor versions of Python <major>.

Fixes #2268

The `none` ABI indicates no native ABI attachment; and so just the
standard guarantees of pure Python. In general this means no breaks
within a major version (just fixes and additions). Although it's known
CPython does deal breaks within a major version span (some deprecated
items are removed), the de-facto standard presented by PyPA's packaging
library indicate the `none` ABI is backwards compatible for all minor
versions in the major version range (much like the `abi3` ABI for
Python 3). As such, fix universal lock handling to accept a
`*<major>*-none-*.whl` for all minor versions of Python `<major>`.

Fixes pex-tool#2268
@jsirois jsirois requested review from kaos and benjyw November 2, 2023 21:46
"2",
"--pex-root",
pex_root,
).assert_success()
Copy link
Member Author

@jsirois jsirois Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prior to the fix above, this test fails as expected (in the same way the real case failed for @eginez, the issue reporter:

$ ./dtox.sh -epy311-integration -- --devpi -vvsk test_issue_2268 -n2
...
=================================== FAILURES ===================================
__________________ test_abi_none_locking[pip-legacy-resolver] __________________
[gw0] linux -- Python 3.11.6 /development/pex/.tox/py311-integration/bin/python
...
E       AssertionError: integration test failed: return_code=1, output=, error=pid 877 -> /tmp/pytest-of-jsirois/pytest-13/popen-gw0/test_abi_none_locking_pip_lega0/pex_root/venvs/f646e8ec93937037a1a0dd448a5db57db632bd73/a21ef60f2b1adcb6fb7c6a50aa0e7e07a678e7bc/bin/python -sE /tmp/pytest-of-jsirois/pytest-13/popen-gw0/test_abi_none_locking_pip_lega0/pex_root/venvs/f646e8ec93937037a1a0dd448a5db57db632bd73/a21ef60f2b1adcb6fb7c6a50aa0e7e07a678e7bc/pex --disable-pip-version-check --no-python-version-warning --exists-action a --no-input --use-deprecated legacy-resolver -q --cache-dir /tmp/pytest-of-jsirois/pytest-13/popen-gw0/test_abi_none_locking_pip_lega0/pex_root/pip/20.3.4-patched/pip_cache --log /tmp/pex-pip-log.cc9l_rd5/pip.log download --dest /tmp/tmpn098tmyx/development.pex..tox.py311-integration.bin.python python-forge==18.6.0 --retries 5 --timeout 15 exited with 1 and STDERR:
E       ERROR: Could not find a version that satisfies the requirement python-forge==18.6.0 (from versions: none)
E       ERROR: No matching distribution found for python-forge==18.6.0

testing/__init__.py:374: AssertionError
___________________ test_abi_none_locking[pip-2020-resolver] ___________________
[gw1] linux -- Python 3.11.6 /development/pex/.tox/py311-integration/bin/python
...
E       AssertionError: integration test failed: return_code=1, output=, error=pid 878 -> /tmp/pytest-of-jsirois/pytest-13/popen-gw1/test_abi_none_locking_pip_20200/pex_root/venvs/f646e8ec93937037a1a0dd448a5db57db632bd73/a21ef60f2b1adcb6fb7c6a50aa0e7e07a678e7bc/bin/python -sE /tmp/pytest-of-jsirois/pytest-13/popen-gw1/test_abi_none_locking_pip_20200/pex_root/venvs/f646e8ec93937037a1a0dd448a5db57db632bd73/a21ef60f2b1adcb6fb7c6a50aa0e7e07a678e7bc/pex --disable-pip-version-check --no-python-version-warning --exists-action a --no-input -q --cache-dir /tmp/pytest-of-jsirois/pytest-13/popen-gw1/test_abi_none_locking_pip_20200/pex_root/pip/20.3.4-patched/pip_cache --log /tmp/pex-pip-log.xdty2u9h/pip.log download --dest /tmp/tmpaoej4mji/development.pex..tox.py311-integration.bin.python python-forge==18.6.0 --retries 5 --timeout 15 exited with 1 and STDERR:
E       ERROR: Could not find a version that satisfies the requirement python-forge==18.6.0
E       ERROR: No matching distribution found for python-forge==18.6.0

testing/__init__.py:374: AssertionError
=========================== short test summary info ============================
FAILED tests/integration/cli/commands/test_issue_2268.py::test_abi_none_locking[pip-legacy-resolver] - AssertionError: integration test failed: return_code=1, output=, error=pid ...
FAILED tests/integration/cli/commands/test_issue_2268.py::test_abi_none_locking[pip-2020-resolver] - AssertionError: integration test failed: return_code=1, output=, error=pid ...
============================== 2 failed in 4.64s ===============================

@jsirois jsirois mentioned this pull request Nov 2, 2023
1 task
Eensure it can retrieve the ambient Pip version if needed on its own.
@jsirois jsirois merged commit baef9ea into pex-tool:main Nov 3, 2023
24 checks passed
@jsirois jsirois deleted the issues/2268 branch November 3, 2023 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can not create lock file when handling none ABI
2 participants