|
1 | 1 | --- |
2 | 2 | name: dropping-and-adding-support-for-python-versions |
3 | | -description: "Use when adding or dropping Python version support by updating the supported Python versions across CI, configs, and docs in line with the official Python support policy." |
| 3 | +description: "Keeps supported Python versions aligned across CI, configs, and docs. Use when adding a new Python version or dropping an end-of-life version per the official Python support policy." |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | # Dropping and adding support for Python versions |
7 | 7 |
|
8 | | -## Overview |
| 8 | +## When to use |
9 | 9 |
|
10 | | -This project adheres to the official Python support policy: https://devguide.python.org/versions/ |
| 10 | +- The user asks to add support for a specific Python version. |
| 11 | +- The user asks to drop or deprecate an end-of-life Python version. |
| 12 | +- The user asks to sync supported versions with the official [Python support policy](https://devguide.python.org/versions/). |
11 | 13 |
|
12 | | -Use this skill to keep Python version support in sync with the official Python support policy by updating the project files consistently. |
| 14 | +## Required inputs |
| 15 | + |
| 16 | +- Change type: add or drop a specific version, or asked to sync with the official support policy. |
| 17 | +- Exact Python version string (e.g., 3.13), if applicable. |
| 18 | + |
| 19 | +If any input is missing, ask before editing. |
13 | 20 |
|
14 | 21 | ## Workflow |
15 | 22 |
|
16 | | -1. Identify the change type: add support for a new Python version or drop support for an end-of-life Python version. |
17 | | -2. Confirm the exact Python version string (e.g., add support for 3.45) and the PR number to insert in the changelog entry (e.g., PR #1234) |
18 | | -3. Apply the relevant changelog entry and file updates listed below. |
| 23 | +1. Confirm that you have the required inputs. |
| 24 | +2. Apply the file updates for the change type. |
| 25 | +3. Add an entry to the [changelog](docs/reference/changelog.md) as specified below. |
| 26 | +4. Search for other mentions of the target version and update only those that describe supported versions. |
| 27 | +5. Run the entire test suite to ensure no regressions. |
| 28 | +6. Run all linters and type checks to ensure consistency. |
| 29 | +7. Report the changes made, tests run, and any follow-ups needed. |
19 | 30 |
|
20 | 31 | ## Adding support for a new Python version |
21 | 32 |
|
22 | | -1. Update `docs/reference/changelog.md` at the top of "Unreleased changes" with: |
23 | | - > Add support for Python 3.XX, in accordance with the official Python support policy[^1] ({gh-pr}`XXX`)". |
24 | | -2. Update the following locations: |
25 | | - - .github/workflows/ci.yml: `jobs.software-tests.strategy.matrix.python-version` |
26 | | - - pyproject.toml: `project.classifiers` |
| 33 | +- .github/workflows/ci.yml: `jobs.software-tests.strategy.matrix.python-version` |
| 34 | +- pyproject.toml: `project.classifiers` |
| 35 | + |
| 36 | +Finally, update the changelog at the top of "Unreleased changes" using the following template: |
| 37 | + |
| 38 | +> Add support for Python 3.XX, in accordance with the official Python support policy[^1] ({gh-pr}`XXX`). |
27 | 39 |
|
28 | 40 | ## Dropping support for an end-of-life Python version |
29 | 41 |
|
30 | | -1. Update `docs/reference/changelog.md` under "Unreleased changes" -> "Breaking changes" with: |
31 | | - > Dropped support for Python 3.XX, in accordance with the official Python support policy[^1] ({gh-pr}`XXX`). |
32 | | -2. Update the following locations: |
33 | | - - .github/workflows/ci.yml: `jobs.software-tests.strategy.matrix.python-version` and `jobs.static-checks.steps.with.python-version` |
34 | | - - .github/workflows/release.yml: `jobs.build.steps.with.python-version` and `jobs.github-release.steps.with.python-version` |
35 | | - - .pre-commit-config.yaml: `default_language_version.python` |
36 | | - - .readthedocs.yml: `build.tools.python` |
37 | | - - AGENTS.md: wherever relevant |
38 | | - - docs/development/contributing.md: wherever relevant |
39 | | - - Makefile: `BASE_PYTHON` |
40 | | - - mypy.ini: `python_version` |
41 | | - - pyproject.toml: `project.classifiers`, `project.requires-python` |
42 | | - - pyrightconfig.json: `pythonVersion` |
43 | | - - ruff.toml: `target-version` |
| 42 | +- .github/workflows/ci.yml: `jobs.software-tests.strategy.matrix.python-version` and `jobs.static-checks.steps.with.python-version` |
| 43 | +- .github/workflows/release.yml: `jobs.build.steps.with.python-version` and `jobs.github-release.steps.with.python-version` |
| 44 | +- .pre-commit-config.yaml: `default_language_version.python` |
| 45 | +- .readthedocs.yml: `build.tools.python` |
| 46 | +- AGENTS.md: wherever relevant |
| 47 | +- docs/development/contributing.md: wherever relevant |
| 48 | +- Makefile: `BASE_PYTHON` |
| 49 | +- mypy.ini: `python_version` |
| 50 | +- pyproject.toml: `project.classifiers`, `project.requires-python` |
| 51 | +- pyrightconfig.json: `pythonVersion` |
| 52 | +- ruff.toml: `target-version` |
| 53 | + |
| 54 | +Finally, update the changelog under "Unreleased changes" -> "Breaking changes" using the following template: |
| 55 | + |
| 56 | +> Dropped support for Python 3.XX, in accordance with the official Python support policy[^1] ({gh-pr}`XXX`). |
| 57 | +
|
| 58 | +## Validation checks |
| 59 | + |
| 60 | +- CI matrix, classifiers, and `requires-python` are consistent. |
| 61 | +- Tooling configs reflect the new minimum version when dropping support. |
| 62 | +- Docs mention the updated supported versions where appropriate. |
| 63 | + |
| 64 | +## Out of scope |
| 65 | + |
| 66 | +- Do not change dependency versions or code behavior unless the user asks. |
| 67 | +- Do not update unrelated CI jobs or tooling settings. |
| 68 | + |
| 69 | +## Output |
| 70 | + |
| 71 | +- Summarize changes and list updated files. |
| 72 | +- Note any tests run and follow-ups needed. |
| 73 | +- If you encountered any discrepancies between these instructions and the locations in the codebase where supported Python versions are mentioned and need to be updated, please document them here for future reference. |
0 commit comments