-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add support for Python 3.13 #1661
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
Conversation
|
The binary builds of Python 3.13.0 succeeded on Heroku-20 and Heroku-24, however, failed on Heroku-22 (Ubuntu 22.04) due to failures during the Python tests that are run as part of generating the PGO profile: Sadly that is all the output shown. (Build logs at: https://github.com/heroku/heroku-buildpack-python/actions/runs/11259777638/job/31310276989#step:4:1374) A retrigger of the build didn't resolve the issue. The offending tests are these: |
Add support for Python 3.13, and release 3.13.0. The default Python version remains unchanged (at 3.12.x) for now. Notably for Python 3.13 we now: - No longer install setuptools and wheel - matching what the wider ecosystem has already done for Python 3.12+. (See the Python CNB's removal PR for more details: heroku/buildpacks-python#243) - No longer install the SQLite headers and CLI, as the first step towards dropping that rarely used feature. In addition, for all Python versions we now also remove the `idle3` and `pydoc3` scripts, since they do not work with relocated Python and so have been broken for some time. Their functionality continues to be available by invoking them via their modules instead (e.g. `python -m pydoc`). Release announcement: https://blog.python.org/2024/10/python-3130-final-released.html https://www.python.org/downloads/release/python-3130/ Details on what's new in Python 3.13: https://docs.python.org/3.13/whatsnew/3.13.html Binary builds: https://github.com/heroku/heroku-buildpack-python/actions/runs/11259777638 Python 3.13 readiness status of the top 360 packages on PyPI: https://pyreadiness.org/3.13/ GUS-W-14846826. GUS-W-14846839. GUS-W-16944574.
|
This might be related to: |
|
Looking back at the builds for older Python versions (eg those for 3.12) shows that the PGO profile test suite reports failures on Heroku-22 there too. The difference is that for Python 3.13 any failures in the tests during the PGO profile generation step are now no longer ignored after: To see the full test failure output, I modified our build script to pass This resulted in these logs: (And similar for |
|
I've added a patch that disables the affected tests for now, since:
|
|
Updated: Posted: Closed out the roadmap item: |
The upstream Python test suite (which gets run when compiling with PGO enabled) fails with the `libexpat` in Ubuntu 22.04. In #1661 previously added what I hoped would be a temporarily workaround until the failures were fixed upstream, however, the Python maintainers say they don't guarantee compatibility with distro `expat`, and that it's up to us to test for compatibility and patch if we want to use the distro version. However, this isn't viable given that we're neither a Linux distro maintainer, a CPython maintainer or an expat maintainer. Instead, like the upstream Docker Hub Python images, we will switch the `expat` bundled within the CPython sources, which is actually what the upstream CPython project tests in its CI. This means users won't get security updates for free via the base image, and will instead need to update their Python patch versions instead as newer versions are vendored in CPython. However, this is the least worst alternative for now. I'm doing this now, since otherwise I'll need to generate another patch series for the soon to be released Python 3.14. For more details, see: python/cpython#125067 (comment) GUS-W-17414073.
The upstream Python test suite (which gets run when compiling with PGO enabled) fails with the `libexpat` in Ubuntu 22.04. In #1661 previously added what I hoped would be a temporarily workaround until the failures were fixed upstream, however, the Python maintainers say they don't guarantee compatibility with distro `expat`, and that it's up to us to test for compatibility and patch if we want to use the distro version. However, this isn't viable given that we're neither a Linux distro maintainer, a CPython maintainer or an expat maintainer. Instead, like the upstream Docker Hub Python images, we will switch the `expat` bundled within the CPython sources, which is actually what the upstream CPython project tests in its CI. This means users won't get security updates for free via the base image, and will instead need to update their Python patch versions instead as newer versions are vendored in CPython. However, this is the least worst alternative for now. I'm doing this now, since otherwise I'll need to generate another patch series for the soon to be released Python 3.14. For more details, see: python/cpython#125067 (comment) GUS-W-17414073.
The upstream Python test suite (which gets run when compiling with PGO enabled) fails with the `libexpat` in Ubuntu 22.04. In #1661 previously added what I hoped would be a temporarily workaround until the failures were fixed upstream, however, the Python maintainers say they don't guarantee compatibility with distro `expat`, and that it's up to us to test for compatibility and patch if we want to use the distro version. However, this isn't viable given that we're neither a Linux distro maintainer, a CPython maintainer or an expat maintainer. Instead, like the upstream Docker Hub Python images, we will switch the `expat` bundled within the CPython sources, which is actually what the upstream CPython project tests in its CI. This means users won't get security updates for free via the base image, and will instead need to update their Python patch versions instead as newer versions are vendored in CPython. However, this is the least worst alternative for now. I'm doing this now, since otherwise I'll need to generate another patch series for the soon to be released Python 3.14. Note: This change only affects Python versions compiled/released after this merges. Existing Python versions on S3 are unaffected for now (unless they ever get recompiled in the future). For more details, see: python/cpython#125067 (comment) GUS-W-17414073.
The upstream Python test suite (which gets run when compiling with PGO enabled) fails with the `libexpat` in Ubuntu 22.04. In #1661, I previously added what I hoped would be a temporarily workaround until the failures were fixed upstream, however, the Python maintainers say they don't guarantee compatibility with distro `expat`, and that it's up to us to test for compatibility and patch if we want to use the distro version. However, this isn't viable given that we're neither a Linux distro maintainer, a CPython maintainer or an expat maintainer. Instead, like the upstream Docker Hub Python images (who were also affected by this issue), we will switch the `expat` bundled within the CPython sources, which is actually what the upstream CPython project tests in its CI. This means users won't get security updates for free via the base image, and will instead need to update their Python patch versions instead as newer versions are vendored in CPython. However, this is the least worst alternative for now. I'm doing this now, since otherwise I'll need to generate another patch series for the soon to be released Python 3.14. Note: This change only affects Python versions compiled/released after this merges. Existing Python versions on S3 are unaffected for now (unless they ever get recompiled in the future). For more details, see: python/cpython#125067 (comment) GUS-W-17414073.
Add support for Python 3.13, and release 3.13.0.
The default Python version remains unchanged (at 3.12.x) for now.
Notably for Python 3.13 we now:
In addition, for all Python versions we now also remove the
idle3andpydoc3scripts, since they do not work with relocated Python and so have been broken for some time. Their functionality continues to be available by invoking them via their modules instead (e.g.python -m pydoc).Release announcement:
https://blog.python.org/2024/10/python-3130-final-released.html
https://www.python.org/downloads/release/python-3130/
Details on what's new in Python 3.13:
https://docs.python.org/3.13/whatsnew/3.13.html
Binary builds:
https://github.com/heroku/heroku-buildpack-python/actions/runs/11280580537
Python 3.13 readiness status of the top 360 packages on PyPI: https://pyreadiness.org/3.13/
GUS-W-14846826.
GUS-W-14846839.
GUS-W-16944574.