-
-
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
Deprecate using Python 3.7 with default tool lockfiles, preparing for pip 24.1 / Python 3.13 support #21103
Comments
If we provide two lockfiles per tool, switching between them would be easier, and we could issue warnings when using the old one, which could be the default initially. |
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
Providing the path forward for: pantsbuild/pants#21184 pantsbuild/pants#21103
Providing the path forward for: pantsbuild/pants#21184 pantsbuild/pants#21103
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
@huonw should we call this complete, or are their more outstanding strands here? |
I don't know of any more strands here (other than #21389), so let's call this done! Thanks @cburroughs (and @krishnan-chandra for highlighting that this is closable) |
Is your feature request related to a problem? Please describe.
Pip 24.1 is the first version of pip that supports Python 3.13. It also drops support for Python 3.7.
This puts us in an awkward position with built-in tools:
pants/src/python/pants/backend/python/subsystems/python_tool_base.py
Line 65 in cfb3caf
The first point means that supporting Python 3.7 and Python 3.13 is potentially impossible, with a single lockfile (i.e. they're mutually exclusive). The second point means that bumping our built-in tools may break any users happily using 3.7.
Python 3.7 is end-of-life now. Python 3.8 is almost end-of-life. See: https://devguide.python.org/versions/.
Describe the solution you'd like
Add deprecation warnings for what will fail in future, for at least one release: using a built-in tool with Python 3.7, and Python 3.8 or newer isn't available.
These warnings should tell the user they'll need to either generate their own lockfiles with their own resolve, or provide Python 3.8 or newer.
Once that deprecation has existed for at least one release, bump the default minimum interpreter constraints and regenerate lockfiles, a way that is compatible for Python 3.13.
Describe alternatives you've considered
Python 3.7 has been end-of-life for almost a year now, so we could potentially just publish new lockfiles directly, and emphasise the breakage and fix in release notes, rather than trying to ease do it in a less-breaking way.
Additional context
Related issues:
Reproducer of the issue that might surface
In https://gist.github.com/huonw/5e98b79ba03bcd7a019ad0a743fe2ccb, I set up an example of what might happen if we upgrade the default lockfiles. It sets up the black subsystem with a lockfile generated with
pex3 lock create --pip-version=24.1 black==23.3.0 ...
, similar to what the default lockfile could be when we upgrade.Running it like this:
Fails on my machine, which has a Python 3.13 interpreter installed:
To simulate only having Python 3.7 installed: uncommenting the
python-bootstrap
lines, fill in a path and rerunpants fmt ::
. This gives a different error, e.g. on my machine:The text was updated successfully, but these errors were encountered: