-
-
Notifications
You must be signed in to change notification settings - Fork 640
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
Most built-in tool lockfiles do not work with Python 3.12 #20354
Comments
The lockfiles are mostly using 23.0.1, and that has a version range of >=3.7,<3.12: https://github.com/pantsbuild/pex/blob/4eb5c9aa25c6a695bf55263ab239189b720cebaf/pex/pip/version.py#L182-L187 Thus, I imagine it's not a problem to regenerate to a newer versions that just increase this range, while still supporting 3.7: https://github.com/pantsbuild/pex/blob/4eb5c9aa25c6a695bf55263ab239189b720cebaf/pex/pip/version.py#L210-L233 That said, pip suggests that pants' default pip version (23.1.2) doesn't work with python 3.12 (this seems potentially incorrect? pex-tool/pex#2314), so we might need to leap to an even newer pip and/or bump the default pip version too. |
…ip_version = 24.0, for Py 3.12 support (#20365) This does three things to fix #20354 and give Pants Python 3.12 support by default: - update the default `[python].pip_version` value to `24.0` (from `23.1.2`), which is the current latest and is after 23.2, which is the first that supports Python 3.12 - run `pants run build-support/bin/generate_builtin_lockfiles.py -- --all-python` to update all tool lockfiles... this involves updating many tools, as a Big Bang, which is potentially unhelpful. - to make this work, `docformatter` has to be restricted to the current version 1.4: 1.5.1 (the newest version that satisfies the old constraints) crashes on Pants itself (PyCQA/docformatter#151), while 1.7.5 (the newest version) also doesn't work on Pants (#20498) Here's a list of (as best I can tell), the changes in versions for the "main" requirement for each subsystem: | subsystem options scope | main requirement | old version | new version | |-------------------------|------------------|-------------|-------------| | `helm-k8s-parser` | `hikaru` | 0.11.0b0 | 0.16.0b0 | | `helm-post-renderer` | `yamlpath` | 3.7.0 | 3.8.1 | | `autoflake` | `autoflake` | 2.0.1 | 2.1.1 | | `bandit` | `bandit` | 1.7.4 | 1.7.5 | | `black` | `black` | 23.1.0 | 23.3.0 | | `pyupgrade` | `pyupgrade` | 3.3.1 | 3.3.2 | | `ruff` | `ruff` | 0.2.1 | 0.2.2 | | `yapf` | `yapf` | 0.32.0 | 0.40.2 | | `coverage-py` | `coverage` | 7.2.1 | 7.2.7 | | `debugpy` | `debugpy` | 1.6.6 | 1.6.7.post1 | | `mypy` | `mypy` | 1.1.1 | 1.4.1 | | `terraform-hcl2-parser` | `python-hcl2` | 4.3.0 | 4.3.2 | | `yamllint` | `yamllint` | 1.29.0 | 1.32.0 | There's numerous other transitive dependencies updated too, including in subsystems for which the main requirement hasn't changed and aren't listed above. I haven't checked changelogs for any of these. I've confirmed that running the reproducer from #20354 with this code now works. The commits are 'sensible'.
This adds Python 3.13 to the default interpreter universe, so that we're more ready to hit the ground running when it is eventually released. https://peps.python.org/pep-0719/ suggests the plan is 3.13.0 stable release on 2024-10-01. This PR will flow into Pants 2.22.0. We won't be releasing 2.22.0 before 2024-07-09 (12 weeks after 2.20.0, on 2024-04-16), so there's a bit of slack even if 2.21 and 2.22 take longer than 6 weeks to get out the door. It looks like we won't be perfectly ready, because there's a similar lockfile issue to #20354 for Python 3.12: our lockfiles use pip 24.0 which apparently doesn't support Python 3.13 (needs pypa/pip#12462). Thus, we'll need to regenerate our lockfiles once there's a pex release with a pip release with pypa/pip#12462. I've filed #20852 to track this.
Describe the bug
The built-in lockfiles for tools like: pytest, mypy, ..., use pip 23.0.1, which doesn't work with Python 3.12:
Reproducer:
Workaround: use custom lockfiles, with
python_requirement
s/install_from_resolve
.Pants version
2.19.0rc2
(NB. 2.18.1 uses a version of pex that doesn't support Python 3.12 by default, but would likely be still affected by this if one specifies a newer pex in
[pex-cli]
.)OS
macOS
Additional info
Discussed in #20310 (review)
Details of pip version support in https://github.com/pantsbuild/pex/blob/4eb5c9aa25c6a695bf55263ab239189b720cebaf/pex/pip/version.py#L128-L233
See https://github.com/search?q=repo%3Apantsbuild%2Fpants%20pip_version%2023.0.1&type=code for 27 current lock files using pip version 23.0.1.
The text was updated successfully, but these errors were encountered: