Repository navigation
Document when to add, drop and change the default Python version - #7743
Merged
Merged
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
qgallouedec
reviewed
Oct 16, 2026
|
|
||
| * **Adding a new version**: once PyTorch and the core dependencies publish wheels for it and the test suite passes, add it to the classifiers in `pyproject.toml` and to the nightly matrix in `.github/workflows/tests_python_versions.yml`. | ||
| * **Dropping a version**: drop it once it reaches end of life. The schedule only gives the month, and the actual end of life is the date of the final release, which can fall anywhere in that month, so drop it after that release is out. A version that old is always past the 2-year mark of [Dependency version floors](#dependency-version-floors). | ||
| * **Default version**: PR CI, the documentation build, the release workflow and the Docker images run on a single Python version, and the nightly matrix covers the other supported ones. The default is the version most TRL users run, as shown by the download stats on [pypistats](https://pypistats.org/packages/trl). Review it every October, after the new CPython release, and switch when another version has overtaken it. A newer version that few users run would leave the version most of them use tested only nightly. |
Member
qgallouedec
approved these changes
Oct 16, 2026
qgallouedec
left a comment
Member
There was a problem hiding this comment.
Thanks! If the min-versions job moves to 3.11 (see #7744), the default-version bullet should say that job runs on the oldest supported Python.
Member
Author
|
Done: the default-version bullet now says the minimum-versions job runs on the oldest supported Python, and the dropping bullet says to move that job to the new oldest version when a version is dropped. |
# Conflicts: # CONTRIBUTING.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR documents in the contributing guide when TRL adds a Python version, when it drops one, and which version CI and the Docker images run by default.
Fix #7742.
Motivation
These decisions have been made case by case. The default Python for CI moved to 3.12 in #2298 and to 3.13 in #7648, each time on a different argument, and the timing of a drop depends on an end-of-life date that the CPython schedule only gives as a month. #7742 proposes the criteria; this PR writes them down so any maintainer can apply them the same way each October.
Solution
The criteria follow what TRL already does:
Changes
Note
Low Risk
Documentation-only change to CONTRIBUTING.md with no runtime or CI behavior changes.
Overview
Adds a Python versions subsection to
CONTRIBUTING.md, next to dependency version floors, so maintainers have written criteria instead of deciding ad hoc each October.The section ties TRL to the CPython 5-year support cycle and spells out when to add a version (wheels from PyTorch/core deps, tests green, update
pyproject.tomlclassifiers and the nightly matrix in.github/workflows/tests_python_versions.yml), when to drop one (after the final EOL release, bump the minimum-versions job to the new oldest), and how to pick the default for PR CI, docs, releases, and Docker (most-used version per pypistats, reviewed yearly; minimum-versions stays on oldest supported Python).Reviewed by Cursor Bugbot for commit 99b5fc7. Bugbot is set up for automated code reviews on this repo. Configure here.