Skip to content

Remove Python 3.10 from the nightly binary build matrix - #198233

Closed
atalman wants to merge 1 commit into
pytorch:mainfrom
atalman:remove_py310_cd
Closed

atalman wants to merge 1 commit into
pytorch:mainfrom
atalman:remove_py310_cd

Conversation

@atalman

@atalman atalman commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

2.15 raises the minimum supported Python to 3.11, so stop building and uploading cp310 nightly wheels.

What changes

Drops "3.10" from FULL_PYTHON_VERSIONS and regenerates the binary workflows. Wheel configs per OS:

OS before after
linux 56 49
windows 40 35
windows-arm64 4 3
macos 4 3

The one non-obvious part

generate_libtorch_extraction_configs picked the py3.10 wheel as the source for libtorch extraction (py3.11 only for windows-arm64, which never built 3.10):

preferred_python = "3.11" if os == "windows-arm64" else "3.10"

Removing 3.10 without touching this would leave no wheel config matching preferred_python, so arch_to_config comes out empty and libtorch silently stops being produced for every arch — no error, no failed job, just no packages.

It now reads FULL_PYTHON_VERSIONS[0] so it can't drift out of the list again, with a comment saying why. The windows-arm64 special case becomes unnecessary once 3.10 is gone, since 3.11 is then the first entry for every OS.

I verified the libtorch extraction configs are byte-identical before and after — same build_name set for all four OSes — and that only the 3.10 wheel configs disappear.

Left alone deliberately

These are runner tooling or documented dummies, not shipped artifacts:

  • macos_binary_build_workflow.yml.j2 setup-python: "3.10.4" — runs the libtorch extraction script on the runner. This is the one remaining 3.10 string in the generated nightly workflows.
  • upload.yml.j2 DESIRED_PYTHON: "3.10" — commented in place as "a dummy value for libtorch to work correctly with our batch scripts".
  • windows_binary_build_workflow.yml.j2 default('3.10') — the same dummy, for configs that carry no python_version.

Happy to bump those in a follow-up if we'd rather not have a 3.10 reference anywhere, but they're independent of what we ship.

Side effect worth flagging

get_ci_variable.py --min-python-version returns FULL_PYTHON_VERSIONS[0], so lint's "Setup Min Python version" step moves from 3.10 to 3.11. That matches the 2.15 minimum, but it is a change outside the CD path.

Test plan

  • Regeneration is idempotent — a second .github/regenerate.sh produces no further diff, confirming no generated file was hand-edited.
  • All five regenerated workflows parse as YAML.
  • ruff check and ruff format --check clean on the changed script.
  • Libtorch extraction configs diffed before/after per OS: identical.

cc @malfet @seemethere @ZainRizvi


🤖 Generated with Claude Code

2.15 raises the minimum supported Python to 3.11, so stop building and
uploading cp310 nightly wheels.

Drops "3.10" from FULL_PYTHON_VERSIONS and regenerates the binary
workflows. Wheel configs per OS:

    linux          56 -> 49
    windows        40 -> 35
    windows-arm64   4 ->  3
    macos           4 ->  3

generate_libtorch_extraction_configs picked the py3.10 wheel as the
source for libtorch extraction (py3.11 only for windows-arm64, which
never built 3.10). Removing 3.10 without touching that would leave no
wheel config matching preferred_python, so arch_to_config would come out
empty and libtorch would silently stop being produced for every arch --
no error, just no packages. It now reads FULL_PYTHON_VERSIONS[0] so it
cannot drift out of the list again, with a note saying why.

Verified the libtorch extraction configs are byte-identical before and
after (same build_name set for all four OSes); only the 3.10 wheel
configs go away.

Left alone deliberately, all runner tooling or documented dummies rather
than shipped artifacts:

- macos_binary_build_workflow.yml.j2 setup-python "3.10.4", which runs
  the libtorch extraction script on the runner.
- upload.yml.j2 DESIRED_PYTHON "3.10", commented in place as "a dummy
  value for libtorch to work correctly with our batch scripts".
- windows_binary_build_workflow.yml.j2 default('3.10'), the same dummy
  for configs that carry no python_version.

Side effect worth noting: get_ci_variable.py --min-python-version returns
FULL_PYTHON_VERSIONS[0], so lint's "Setup Min Python version" step moves
from 3.10 to 3.11. That matches the 2.15 minimum.

Regeneration is idempotent (second run produces no further diff), all
five regenerated workflows parse as YAML, and ruff check/format are clean.
@pytorch-bot

pytorch-bot Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/198233

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

⏳ 60 Pending, 1 Unrelated Failure

As of commit eb8c9a4 with merge base 5d8cd49 (image):

🟡 GREEN LIGHT - PR requires human review:

  • Release plumbing
    • Drops "3.10" from FULL_PYTHON_VERSIONS in .github/scripts/generate_binary_build_matrix.py, so nightly stops publishing every cp310 wheel and upload job
    • Removing a published artifact is release/publish plumbing and never trivial, whatever the regeneration is mechanically correct
  • Unhandled user expectation
    • pytorch/pyproject.toml:351 still declares requires-python = ">=3.10", so the package keeps claiming 3.10 support while no 3.10 nightly is built
    • A 3.10 user installing from the nightly index is left wrong with no deprecation or migration path in the diff
  • Out-of-CD side effect
    • .github/scripts/get_ci_variable.py:26 returns FULL_PYTHON_VERSIONS[0], so lint's min-python step at .github/workflows/lint.yml:270 moves 3.10 to 3.11
  • Breadth
    • Five generated nightly workflows change across linux, aarch64, s390x, macos, and windows, plus six source_wheel_build_name repoints to manywheel-py3_11-*
    • generated-macos-arm64-binary-wheel-nightly.yml:236 still pins extraction python-version: "3.10.4" beside the now-3.11 artifact download

reason: breaking_change
Reviewed commit: eb8c9a4

Inference job

🐛 Report a wrong verdict

CRCR (non-blocking) - The following CRCR downstream CI job failed but is non-blocking:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@atalman
atalman requested a review from a team as a code owner September 22, 2026 16:46
@pytorch-bot pytorch-bot Bot added the topic: not user facing topic category label Sep 22, 2026
@atalman atalman added the ciflow/binaries Trigger all binary build and upload jobs on the PR label Sep 22, 2026
@atalman

atalman commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator Author

@pytorchmergebot merge -f "I believe we are ok on merging this"

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

pytorchmergebot pushed a commit that referenced this pull request Sep 24, 2026
2.15 raises the minimum supported Python to 3.11, so move the `pull` and `trunk` lanes off 3.10. Companion to #198233, which drops 3.10 from the nightly binary matrix.

Renames job ids, job names, `build-environment` labels and `python-version` inputs in `pull.yml` and `trunk.yml`, and provides the 3.11 docker images those jobs now reference.

## Images

Three explicitly versioned images are referenced by the renamed jobs:

| image | status |
|---|---|
| `pytorch-linux-jammy-py3.11-clang21` | already existed |
| `pytorch-linux-jammy-aarch64-py3.11-gcc13` | **added** |
| `pytorch-linux-jammy-cuda13.2-cudnn9-py3.11-clang20` | **added** |

The aarch64 one needs an explicit case in `build.sh` — the catch-all would not set `ACL`/`OPENBLAS`. The clang20 one is fine on the catch-all, which is how its 3.10 counterpart is already built. Both are added to `docker-builds.yml` so they're actually built and pushed.

## ⚠️ Not complete: six jobs still run 3.10 containers

Worth a close look before merging. These carry a `py3.11` label but point at **unversioned** `py3` images whose `ANACONDA_PYTHON_VERSION` is still 3.10:

| workflow | job | image |
|---|---|---|
| pull | `linux-jammy-rocm-py3.11` | `pytorch-linux-jammy-rocm-n-py3` |
| pull | `linux-noble-xpu-n-py3.11` | `pytorch-linux-noble-xpu-n-py3` |
| trunk | `libtorch-linux-jammy-cuda13.2-py3.11-gcc11` | `...cuda13.2-cudnn9-py3-gcc11` |
| trunk | `linux-jammy-cuda13.2-py3.11-gcc11` | `...cuda13.2-cudnn9-py3-gcc11` |
| trunk | `linux-jammy-cuda13.2-py3.11-gcc11-no-ops` | `...cuda13.2-cudnn9-py3-gcc11` |
| trunk | `linux-jammy-py3.11-gcc11` (verify-cachebench) | `...py3-gcc11-inductor-benchmarks` |

Completing these means bumping `ANACONDA_PYTHON_VERSION` on the shared images, which moves **inductor, periodic, nightly, docs-build and operator_benchmark** at the same time. That's a decision for the owners of those lanes rather than something to slip into a pull/trunk change, so I left it as follow-up. Happy to do it here instead if you'd rather.

## Test plan

- All **13** `pytorch-linux-*` images referenced by `pull.yml`/`trunk.yml` after the rename resolve to something `build.sh` can build **and** `docker-builds.yml` builds. Verified programmatically, not by eye.
- `pull.yml`, `trunk.yml`, `docker-builds.yml` all parse as YAML.
- `build.sh` passes `bash -n`.
- Zero `py3.10` / `py3_10` references remain in either workflow.

## Note on `viable_strict.md`

Updated the `pull` required-check name to match. The `trunk` line there already referenced `linux-jammy-cuda13.0-py3.10-gcc11`, which doesn't exist in `trunk.yml` (it's cuda13.2 now) — that staleness predates this change, so I left it rather than guessing at the intended job.

**Heads-up for reviewers:** this renames required check names (`pull / linux-jammy-py3.10-gcc11 / test` → `.../py3.11-gcc11 / test`), so branch-protection or merge-rule config referencing the old names may need updating in step.

---

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Pull Request resolved: #198271
Approved by: https://github.com/huydhn
pytorchmergebot pushed a commit that referenced this pull request Oct 2, 2026
Python 3.10 reaches EOL this month and was dropped from the nightly binary build matrix in #198233, but 13 of the 31 images in .ci/docker/build.sh were still pinned to it. Most did not say so: only two carry the version in their tag, so images like pytorch-linux-jammy-cuda13.2-cudnn9-py3-gcc11 -- 28 workflow references -- were quietly 3.10.

Bumps the eleven whose tags do not encode a version, so no image is renamed and no consumer has to change:

  cuda12.8-cudnn9-py3-gcc11
  cuda13.2-cudnn9-py3-gcc11
  cuda13.2-cudnn9-py3-gcc11-inductor-benchmarks
  cuda13.4-cudnn9-py3-gcc11
  cuda13.4-cudnn9-py3-gcc11-inductor-benchmarks
  jammy-rocm-n-py3 (and -benchmarks)
  jammy-xpu-n-1-py3
  noble-xpu-n-py3 (and -client, -inductor-benchmarks)
  py3-gcc11-inductor-benchmarks
  py3-clang21-executorch
  jammy-linter

The jammy/noble ROCm conditional collapses: it picked 3.10 for jammy and 3.11 for noble, and both are now 3.11.

Two are deliberately left alone because they need more than a version bump:

  pytorch-linux-jammy-py3.10-clang21 is a duplicate -- py3.11-clang21 already
  exists, and the 3.10 image is only built by docker-builds.yml, never used by
  a test job. It should be deleted, not renamed.

  pytorch-linux-jammy-cuda13.2-cudnn9-py3.10-linter needs a tag rename plus
  updates in docker-builds.yml and lint.yml.

Not touched: .ci/docker/common/install_cpython.sh and manywheel/Dockerfile_s390x still build CPython 3.10.1. Those feed release wheels, and test-infra still lists 3.10 in PYTHON_ARCHES_DICT for the test and release channels, so removing it there would break 2.14/2.15 release builds.

Made with AI, Claude
Pull Request resolved: #199535
Approved by: https://github.com/huydhn, https://github.com/Skylion007
pytorchmergebot pushed a commit that referenced this pull request Oct 4, 2026
Python 3.10 reaches EOL this month and was dropped from the nightly binary build matrix in #198233, but 13 of the 31 images in .ci/docker/build.sh were still pinned to it. Most did not say so: only two carry the version in their tag, so images like pytorch-linux-jammy-cuda13.2-cudnn9-py3-gcc11 -- 28 workflow references -- were quietly 3.10.

Bumps the eleven whose tags do not encode a version, so no image is renamed and no consumer has to change:

  cuda12.8-cudnn9-py3-gcc11
  cuda13.2-cudnn9-py3-gcc11
  cuda13.2-cudnn9-py3-gcc11-inductor-benchmarks
  cuda13.4-cudnn9-py3-gcc11
  cuda13.4-cudnn9-py3-gcc11-inductor-benchmarks
  jammy-rocm-n-py3 (and -benchmarks)
  jammy-xpu-n-1-py3
  noble-xpu-n-py3 (and -client, -inductor-benchmarks)
  py3-gcc11-inductor-benchmarks
  py3-clang21-executorch
  jammy-linter

The jammy/noble ROCm conditional collapses: it picked 3.10 for jammy and 3.11 for noble, and both are now 3.11.

Two are deliberately left alone because they need more than a version bump:

  pytorch-linux-jammy-py3.10-clang21 is a duplicate -- py3.11-clang21 already
  exists, and the 3.10 image is only built by docker-builds.yml, never used by
  a test job. It should be deleted, not renamed.

  pytorch-linux-jammy-cuda13.2-cudnn9-py3.10-linter needs a tag rename plus
  updates in docker-builds.yml and lint.yml.

Not touched: .ci/docker/common/install_cpython.sh and manywheel/Dockerfile_s390x still build CPython 3.10.1. Those feed release wheels, and test-infra still lists 3.10 in PYTHON_ARCHES_DICT for the test and release channels, so removing it there would break 2.14/2.15 release builds.

Made with AI, Claude

Pull Request resolved: #199535
Approved by: https://github.com/huydhn, https://github.com/Skylion007
cyyever pushed a commit to BakeLab/pytorch that referenced this pull request Oct 11, 2026
Python 3.10 reaches EOL this month and was dropped from the nightly binary build matrix in pytorch#198233, but 13 of the 31 images in .ci/docker/build.sh were still pinned to it. Most did not say so: only two carry the version in their tag, so images like pytorch-linux-jammy-cuda13.2-cudnn9-py3-gcc11 -- 28 workflow references -- were quietly 3.10.

Bumps the eleven whose tags do not encode a version, so no image is renamed and no consumer has to change:

  cuda12.8-cudnn9-py3-gcc11
  cuda13.2-cudnn9-py3-gcc11
  cuda13.2-cudnn9-py3-gcc11-inductor-benchmarks
  cuda13.4-cudnn9-py3-gcc11
  cuda13.4-cudnn9-py3-gcc11-inductor-benchmarks
  jammy-rocm-n-py3 (and -benchmarks)
  jammy-xpu-n-1-py3
  noble-xpu-n-py3 (and -client, -inductor-benchmarks)
  py3-gcc11-inductor-benchmarks
  py3-clang21-executorch
  jammy-linter

The jammy/noble ROCm conditional collapses: it picked 3.10 for jammy and 3.11 for noble, and both are now 3.11.

Two are deliberately left alone because they need more than a version bump:

  pytorch-linux-jammy-py3.10-clang21 is a duplicate -- py3.11-clang21 already
  exists, and the 3.10 image is only built by docker-builds.yml, never used by
  a test job. It should be deleted, not renamed.

  pytorch-linux-jammy-cuda13.2-cudnn9-py3.10-linter needs a tag rename plus
  updates in docker-builds.yml and lint.yml.

Not touched: .ci/docker/common/install_cpython.sh and manywheel/Dockerfile_s390x still build CPython 3.10.1. Those feed release wheels, and test-infra still lists 3.10 in PYTHON_ARCHES_DICT for the test and release channels, so removing it there would break 2.14/2.15 release builds.

Made with AI, Claude
Pull Request resolved: pytorch#199535
Approved by: https://github.com/huydhn, https://github.com/Skylion007
cyyever pushed a commit to BakeLab/pytorch that referenced this pull request Oct 11, 2026
Python 3.10 reaches EOL this month and was dropped from the nightly binary build matrix in pytorch#198233, but 13 of the 31 images in .ci/docker/build.sh were still pinned to it. Most did not say so: only two carry the version in their tag, so images like pytorch-linux-jammy-cuda13.2-cudnn9-py3-gcc11 -- 28 workflow references -- were quietly 3.10.

Bumps the eleven whose tags do not encode a version, so no image is renamed and no consumer has to change:

  cuda12.8-cudnn9-py3-gcc11
  cuda13.2-cudnn9-py3-gcc11
  cuda13.2-cudnn9-py3-gcc11-inductor-benchmarks
  cuda13.4-cudnn9-py3-gcc11
  cuda13.4-cudnn9-py3-gcc11-inductor-benchmarks
  jammy-rocm-n-py3 (and -benchmarks)
  jammy-xpu-n-1-py3
  noble-xpu-n-py3 (and -client, -inductor-benchmarks)
  py3-gcc11-inductor-benchmarks
  py3-clang21-executorch
  jammy-linter

The jammy/noble ROCm conditional collapses: it picked 3.10 for jammy and 3.11 for noble, and both are now 3.11.

Two are deliberately left alone because they need more than a version bump:

  pytorch-linux-jammy-py3.10-clang21 is a duplicate -- py3.11-clang21 already
  exists, and the 3.10 image is only built by docker-builds.yml, never used by
  a test job. It should be deleted, not renamed.

  pytorch-linux-jammy-cuda13.2-cudnn9-py3.10-linter needs a tag rename plus
  updates in docker-builds.yml and lint.yml.

Not touched: .ci/docker/common/install_cpython.sh and manywheel/Dockerfile_s390x still build CPython 3.10.1. Those feed release wheels, and test-infra still lists 3.10 in PYTHON_ARCHES_DICT for the test and release channels, so removing it there would break 2.14/2.15 release builds.

Made with AI, Claude

Pull Request resolved: pytorch#199535
Approved by: https://github.com/huydhn, https://github.com/Skylion007
@guilhermeleobas

Copy link
Copy Markdown
Collaborator

@atalman I tried to remove the Python 3.10 code from Dynamo in #199417 but I realized there are a windows job who still rely on 3.10. Are there any plans to migrate them as well? Happy to help if needed.

@huydhn

huydhn commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

@atalman I tried to remove the Python 3.10 code from Dynamo in #199417 but I realized there are a windows job who still rely on 3.10. Are there any plans to migrate them as well? Happy to help if needed.

I'm working on getting rid of 3.10 on Windows pytorch/test-infra#9178 and will try to roll out this new AMI today.

pytorchmergebot pushed a commit that referenced this pull request Oct 27, 2026
## Summary

Raise the minimum Python in the package metadata from 3.10 to 3.11, to match what 2.15 builds.

- `pyproject.toml`: `requires-python = ">=3.11"`, and remove the `Programming Language :: Python :: 3.10` classifier.
- `README.md`: the source-build prerequisite says "Python 3.11 or later".

## Why

The binary build matrix no longer includes Python 3.10: `FULL_PYTHON_VERSIONS` in `.github/scripts/generate_binary_build_matrix.py` starts at `3.11`, and the 2.15.0 wheels on the test channel are `cp311` to `cp315` (plus `cp314t` and `cp315t`), with no `cp310`. `pyproject.toml` was not updated, so the 2.15.0 wheels carry:

```
Requires-Python: >=3.10
Classifier: Programming Language :: Python :: 3.10
```

That tells PyPI and `pip show` that 3.10 is supported, and makes `uv` and Poetry try to resolve 2.15 for Python 3.10 and fail on a missing wheel instead of reporting that 3.11 is required. The PRs that dropped 3.10 from the builds (#198233, #199398) only changed build and CI config and did not touch `pyproject.toml`.

## Not changed

- `[tool.ruff]` settings and the `# TODO: Remove Python-3.10 specific suppressions` comment.
- The Python 3.10 code paths in dynamo; #199417 handles those.

## Testing

`pyproject.toml` parses (`tomllib`), and `project.requires-python` is `>=3.11` with the classifiers `3 :: Only`, `3.11` to `3.15`. I did not build a wheel or an sdist from this change. Cherry-pick to `release/2.15` is a separate PR.

Pull Request resolved: #202271
Approved by: https://github.com/huydhn, https://github.com/albanD
sub4biz pushed a commit to sub4biz/pytorch that referenced this pull request Oct 27, 2026
)

## Summary

Raise the minimum Python in the package metadata from 3.10 to 3.11, to match what 2.15 builds.

- `pyproject.toml`: `requires-python = ">=3.11"`, and remove the `Programming Language :: Python :: 3.10` classifier.
- `README.md`: the source-build prerequisite says "Python 3.11 or later".
- `[tool.ruff] target-version = "py310"`: pinned so lint does not change (see below).

## Why

The binary build matrix no longer includes Python 3.10: `FULL_PYTHON_VERSIONS` in `.github/scripts/generate_binary_build_matrix.py` starts at `3.11`, and the 2.15.0 wheels on the test channel are `cp311` to `cp315` (plus `cp314t` and `cp315t`), with no `cp310`. `pyproject.toml` was not updated, so the 2.15.0 wheels carry:

```
Requires-Python: >=3.10
Classifier: Programming Language :: Python :: 3.10
```

That tells PyPI and `pip show` that 3.10 is supported, and makes `uv` and Poetry try to resolve 2.15 for Python 3.10 and fail on a missing wheel instead of reporting that 3.11 is required. The PRs that dropped 3.10 from the builds (pytorch#198233, pytorch#199398) only changed build and CI config and did not touch `pyproject.toml`.

## Lint

Ruff derives its target version from `requires-python`, so raising it to 3.11 enabled the pyupgrade rules for 3.11 and failed the Lint job: 257 findings in 162 files (UP036 obsolete `sys.version_info` checks 104, UP035 `typing_extensions` imports 101, UP044 `Unpack` 30, UP017 `datetime.UTC` 20, UP041 2). I reproduced the same counts locally with `ruff==0.14.4` and the repo config. 134 of the fixes need `--unsafe-fixes`, and they touch `torch/_dynamo` files that the Python 3.10 cleanup PRs (pytorch#199417) are editing, so they do not belong in a metadata change. This PR pins `target-version = "py310"` in `[tool.ruff]`, which restores the previous lint behavior: on the 162 files `ruff check` passes, and `ruff format --check` reports the same single file (`torch/utils/checkpoint.py`) as on the base commit. The pin should be removed together with the Python 3.10 code cleanup.

## Not changed

- `[tool.ruff]` settings and the `# TODO: Remove Python-3.10 specific suppressions` comment.
- The Python 3.10 code paths in dynamo; pytorch#199417 handles those.

## Testing

`pyproject.toml` parses (`tomllib`), and `project.requires-python` is `>=3.11` with the classifiers `3 :: Only`, `3.11` to `3.15`. With the pin, `ruff check` (ruff 0.14.4, repo config) passes on all 162 files the Lint job had flagged. I did not build a wheel or an sdist from this change. Cherry-pick to `release/2.15` is a separate PR.

Pull Request resolved: pytorch#202271
Approved by: https://github.com/huydhn, https://github.com/albanD
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 5, 2026
)

## Summary

Raise the minimum Python in the package metadata from 3.10 to 3.11, to match what 2.15 builds.

- `pyproject.toml`: `requires-python = ">=3.11"`, and remove the `Programming Language :: Python :: 3.10` classifier.
- `README.md`: the source-build prerequisite says "Python 3.11 or later".

## Why

The binary build matrix no longer includes Python 3.10: `FULL_PYTHON_VERSIONS` in `.github/scripts/generate_binary_build_matrix.py` starts at `3.11`, and the 2.15.0 wheels on the test channel are `cp311` to `cp315` (plus `cp314t` and `cp315t`), with no `cp310`. `pyproject.toml` was not updated, so the 2.15.0 wheels carry:

```
Requires-Python: >=3.10
Classifier: Programming Language :: Python :: 3.10
```

That tells PyPI and `pip show` that 3.10 is supported, and makes `uv` and Poetry try to resolve 2.15 for Python 3.10 and fail on a missing wheel instead of reporting that 3.11 is required. The PRs that dropped 3.10 from the builds (pytorch#198233, pytorch#199398) only changed build and CI config and did not touch `pyproject.toml`.

## Not changed

- `[tool.ruff]` settings and the `# TODO: Remove Python-3.10 specific suppressions` comment.
- The Python 3.10 code paths in dynamo; pytorch#199417 handles those.

## Testing

`pyproject.toml` parses (`tomllib`), and `project.requires-python` is `>=3.11` with the classifiers `3 :: Only`, `3.11` to `3.15`. I did not build a wheel or an sdist from this change. Cherry-pick to `release/2.15` is a separate PR.

Pull Request resolved: pytorch#202271
Approved by: https://github.com/huydhn, https://github.com/albanD
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 5, 2026
)

## Summary

Raise the minimum Python in the package metadata from 3.10 to 3.11, to match what 2.15 builds.

- `pyproject.toml`: `requires-python = ">=3.11"`, and remove the `Programming Language :: Python :: 3.10` classifier.
- `README.md`: the source-build prerequisite says "Python 3.11 or later".
- `[tool.ruff] target-version = "py310"`: pinned so lint does not change (see below).

## Why

The binary build matrix no longer includes Python 3.10: `FULL_PYTHON_VERSIONS` in `.github/scripts/generate_binary_build_matrix.py` starts at `3.11`, and the 2.15.0 wheels on the test channel are `cp311` to `cp315` (plus `cp314t` and `cp315t`), with no `cp310`. `pyproject.toml` was not updated, so the 2.15.0 wheels carry:

```
Requires-Python: >=3.10
Classifier: Programming Language :: Python :: 3.10
```

That tells PyPI and `pip show` that 3.10 is supported, and makes `uv` and Poetry try to resolve 2.15 for Python 3.10 and fail on a missing wheel instead of reporting that 3.11 is required. The PRs that dropped 3.10 from the builds (pytorch#198233, pytorch#199398) only changed build and CI config and did not touch `pyproject.toml`.

## Lint

Ruff derives its target version from `requires-python`, so raising it to 3.11 enabled the pyupgrade rules for 3.11 and failed the Lint job: 257 findings in 162 files (UP036 obsolete `sys.version_info` checks 104, UP035 `typing_extensions` imports 101, UP044 `Unpack` 30, UP017 `datetime.UTC` 20, UP041 2). I reproduced the same counts locally with `ruff==0.14.4` and the repo config. 134 of the fixes need `--unsafe-fixes`, and they touch `torch/_dynamo` files that the Python 3.10 cleanup PRs (pytorch#199417) are editing, so they do not belong in a metadata change. This PR pins `target-version = "py310"` in `[tool.ruff]`, which restores the previous lint behavior: on the 162 files `ruff check` passes, and `ruff format --check` reports the same single file (`torch/utils/checkpoint.py`) as on the base commit. The pin should be removed together with the Python 3.10 code cleanup.

## Not changed

- `[tool.ruff]` settings and the `# TODO: Remove Python-3.10 specific suppressions` comment.
- The Python 3.10 code paths in dynamo; pytorch#199417 handles those.

## Testing

`pyproject.toml` parses (`tomllib`), and `project.requires-python` is `>=3.11` with the classifiers `3 :: Only`, `3.11` to `3.15`. With the pin, `ruff check` (ruff 0.14.4, repo config) passes on all 162 files the Lint job had flagged. I did not build a wheel or an sdist from this change. Cherry-pick to `release/2.15` is a separate PR.

Pull Request resolved: pytorch#202271
Approved by: https://github.com/huydhn, https://github.com/albanD
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 9, 2026
)

## Summary

Raise the minimum Python in the package metadata from 3.10 to 3.11, to match what 2.15 builds.

- `pyproject.toml`: `requires-python = ">=3.11"`, and remove the `Programming Language :: Python :: 3.10` classifier.
- `README.md`: the source-build prerequisite says "Python 3.11 or later".
- `[tool.ruff] target-version = "py310"`: pinned so lint does not change (see below).

## Why

The binary build matrix no longer includes Python 3.10: `FULL_PYTHON_VERSIONS` in `.github/scripts/generate_binary_build_matrix.py` starts at `3.11`, and the 2.15.0 wheels on the test channel are `cp311` to `cp315` (plus `cp314t` and `cp315t`), with no `cp310`. `pyproject.toml` was not updated, so the 2.15.0 wheels carry:

```
Requires-Python: >=3.10
Classifier: Programming Language :: Python :: 3.10
```

That tells PyPI and `pip show` that 3.10 is supported, and makes `uv` and Poetry try to resolve 2.15 for Python 3.10 and fail on a missing wheel instead of reporting that 3.11 is required. The PRs that dropped 3.10 from the builds (pytorch#198233, pytorch#199398) only changed build and CI config and did not touch `pyproject.toml`.

## Lint

Ruff derives its target version from `requires-python`, so raising it to 3.11 enabled the pyupgrade rules for 3.11 and failed the Lint job: 257 findings in 162 files (UP036 obsolete `sys.version_info` checks 104, UP035 `typing_extensions` imports 101, UP044 `Unpack` 30, UP017 `datetime.UTC` 20, UP041 2). I reproduced the same counts locally with `ruff==0.14.4` and the repo config. 134 of the fixes need `--unsafe-fixes`, and they touch `torch/_dynamo` files that the Python 3.10 cleanup PRs (pytorch#199417) are editing, so they do not belong in a metadata change. This PR pins `target-version = "py310"` in `[tool.ruff]`, which restores the previous lint behavior: on the 162 files `ruff check` passes, and `ruff format --check` reports the same single file (`torch/utils/checkpoint.py`) as on the base commit. The pin should be removed together with the Python 3.10 code cleanup.

## Not changed

- `[tool.ruff]` settings and the `# TODO: Remove Python-3.10 specific suppressions` comment.
- The Python 3.10 code paths in dynamo; pytorch#199417 handles those.

## Testing

`pyproject.toml` parses (`tomllib`), and `project.requires-python` is `>=3.11` with the classifiers `3 :: Only`, `3.11` to `3.15`. With the pin, `ruff check` (ruff 0.14.4, repo config) passes on all 162 files the Lint job had flagged. I did not build a wheel or an sdist from this change. Cherry-pick to `release/2.15` is a separate PR.

Pull Request resolved: pytorch#202271
Approved by: https://github.com/huydhn, https://github.com/albanD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/binaries Trigger all binary build and upload jobs on the PR Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants