-
-
Notifications
You must be signed in to change notification settings - Fork 638
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
Built-in lockfiles won't work with Python 3.13, due to pip version #20852
Comments
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.
Potentially need to do #21103 first, to smoothly drop support for 3.7. |
Highlighted changelogs: * https://github.com/pex-tool/pex/releases/tag/v2.4.0 * https://github.com/pex-tool/pex/releases/tag/v2.4.1 * https://github.com/pex-tool/pex/releases/tag/v2.5.0 * https://github.com/pex-tool/pex/releases/tag/v2.6.0 * https://github.com/pex-tool/pex/releases/tag/v2.7.0 * https://github.com/pex-tool/pex/releases/tag/v2.8.0 * https://github.com/pex-tool/pex/releases/tag/v2.8.1 * https://github.com/pex-tool/pex/releases/tag/v2.9.0 * https://github.com/pex-tool/pex/releases/tag/v2.10.0 * https://github.com/pex-tool/pex/releases/tag/v2.10.1 * https://github.com/pex-tool/pex/releases/tag/v2.11.0 (!) ``` Lockfile diff: 3rdparty/python/user_reqs.lock [python-default] == Upgraded dependencies == certifi 2024.6.2 --> 2024.7.4 exceptiongroup 1.2.1 --> 1.2.2 pex 2.3.3 --> 2.11.0 pydantic 1.10.16 --> 1.10.17 ``` NOTE: This updates the scrupulously backwards compatible Pex, but does not use any new features yet. The minimum version is unchanged. Possibly relevant for: #15704 #21103 #20852 #15454 #21100 #11324 #19256 #19552 #19681
As a consequence, most tests no longer work with 3.7 since -- for example -- the lockfile with pytest does not support 3.7. This downgrades 3.7 to "probably works but not well tested", which is the same state as 3.6. Since 3.7 has been EoL for over a year I think this is reasonable. This opens up the way for Python 3.13 support in lockfiles among other benefits. As another consequence, lockfiles are regenerated which means we have some new versions coming along for the ride. The pretty lockfile diff does not seem to work with the generation script though --> pantsbuild#21388 Uses of Pants can still use 3.7 by generating their own lockfiles. Deprecation plan annouced at https://www.pantsbuild.org/blog/2024/08/24/venerable-pythons Based off work started in pantsbuild#21314 ref pantsbuild#21184, pantsbuild#21103, pantsbuild#20852
As a consequence, most tests no longer work with 3.7 since -- for example -- the lockfile with pytest does not support 3.7. This downgrades 3.7 to "probably works but not well tested", which is the same state as 3.6. Since 3.7 has been EoL for over a year I think this is reasonable. This opens up the way for Python 3.13 support in lockfiles among other benefits. As another consequence, lockfiles are regenerated which means we have some new versions coming along for the ride. The pretty lockfile diff does not seem to work with the generation script though --> #21388 Uses of Pants can still use 3.7 by generating their own lockfiles. Deprecation plan announced at https://www.pantsbuild.org/blog/2024/08/24/venerable-pythons Based off work started in #21314 ref #21184, #21103, #20852
So I think the version of pip needed is 24.1? All the lockfiles are now generated with 24.2 now so I think this is mostly set. For python 3.13 out of the box completeness I suppose we should bump the default |
The first version of pip to support Python 3.13 was 24.1, but I don't think there is any merit to holding back when 24.2 is already out. (Pants itself uses `latest`.) The first version of Pex to support 24.2 is v2.13.0. (Pip 24.1 and 24.2 also both contain meaningful performance improvements to dependency resolution --> pantsbuild#21223) Release notes for where pex added support: https://github.com/pex-tool/pex/releases/tag/v2.13.0 ref pantsbuild#20852
The first version of pip to support Python 3.13 was 24.1, but I don't think there is any merit to holding back when 24.2 is already out. (Pants itself uses `latest`.) The first version of Pex to support 24.2 is v2.13.0. (Pip 24.1 and 24.2 also both contain meaningful performance improvements to dependency resolution --> #21223) Release notes for where pex added support: https://github.com/pex-tool/pex/releases/tag/v2.13.0 ref #20852
This runs `pants run src/python/pants/backend/python/providers/python_build_standalone/scripts/generate_urls.py` to change the Python versions provided by `pants.backend.python.providers.experimental.python_build_standalone`. Added: - 3.12.7 - 3.13.0 - 3.13.0rc3 Changed (to a newer build): - 3.8.20 - 3.9.20 - 3.10.15 - 3.11.10 Note that #20852 may mean 3.13.0 may not work smoothly yet.
@krishnan-chandra pointed out to me that #21389 / #21400 may've fixed this for the 2.24.x release series. Indeed, this test-case (adapted from #20354) fails as written with 2.23.0a0, but works with 2.24.0.dev0: # cd $(mktemp -d)
cat > pants.toml <<EOF
[GLOBAL]
pants_version = "2.23.0a0"
backend_packages = [
"pants.backend.python",
]
[python]
interpreter_constraints = ["==3.13.*"]
EOF
echo 'python_tests(name="t")' > BUILD
echo 'def test_foo(): pass' > test_example.py
# BUG: fails by default with Python 3.13
pants test ::
# OKAY: works fine
pants test --python-interpreter-constraints='["==3.12.*"]' :: Thanks @cburroughs ! |
Describe the bug
Similar to #20354, our builtin lockfiles at the time of writing may not work with Python 3.13. They use
pip_version: "24.0"
, which doesn't work with python 3.13 due to pypa/pip#12462. Once there's a pip version with that fix, and a PEX version with that pip version, we should upgrade and regenerate the lockfiles to be ready for Python 3.13 promptly.Pants version
#20851
OS
N/A
Additional info
#20851
The text was updated successfully, but these errors were encountered: