Skip to content

Add Python 3.14 support#20452

Draft
rascani wants to merge 1 commit into
pytorch:mainfrom
rascani:python-3.14-support
Draft

Add Python 3.14 support#20452
rascani wants to merge 1 commit into
pytorch:mainfrom
rascani:python-3.14-support

Conversation

@rascani

@rascani rascani commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Bump pybind11 from v2.13.6 to v3.0.4, which adds Python 3.14 compatibility. Bridge the legacy PYTHON_EXECUTABLE cmake variable to Python_EXECUTABLE so pybind11 3.0's FindPython module picks up the correct interpreter.

Raise requires-python upper bound from <3.14 to <3.15 and add 3.14 to wheel build matrices and the pull request test matrix.

coremltools has no cp314 wheels yet, so its dependency gets a python_version < '3.14' marker — the CoreML backend is unavailable on 3.14 until Apple ships compatible wheels. scikit-learn is loosened from ==1.7.1 to >=1.7.1 since 1.7.2+ has cp314 wheels.

Bump black from 24.4.2 to 26.3.0 so the linter recognizes py314 as a valid target-version in pyproject.toml.

py::enum_ usage in two pybinding files is deprecated in pybind11 3.0 but still functional; migration to py::native_enum can follow separately.

Fixes #16750

This PR was authored with Claude.

Test Plan

  • cmake configure succeeded with pybind11 3.0.4 (--preset pybind)
  • Built portable_lib, data_loader, selective_build, _llm_runner pybinding targets — all compiled clean on Python 3.13/macOS
  • Verified black 26.3.0 recognizes py314 target-version
  • lintrunner passes with updated black
  • Full CI validation on Python 3.14 will run via the updated wheel build and pull.yml workflows

@pytorch-bot

pytorch-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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:

❌ 6 New Failures, 2 Unrelated Failures, 4 Unclassified Failures

As of commit c6f4bf3 with merge base 1b726b2 (image):

NEW FAILURES - The following jobs have failed:

UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following job failed but was present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 23, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Bump pybind11 from v2.13.6 to v3.0.4, which adds Python 3.14
compatibility. Bridge the legacy PYTHON_EXECUTABLE cmake variable
to Python_EXECUTABLE so pybind11 3.0's FindPython module picks up
the correct interpreter.

Raise requires-python upper bound from <3.14 to <3.15 and add 3.14
to wheel build matrices and the pull request test matrix.

coremltools has no cp314 wheels yet, so its dependency gets a
python_version < '3.14' marker — the CoreML backend is unavailable
on 3.14 until Apple ships compatible wheels. scikit-learn is
loosened from ==1.7.1 to >=1.7.1 since 1.7.2+ has cp314 wheels.

Bump black from 24.4.2 to 26.3.0 so the linter recognizes py314
as a valid target-version in pyproject.toml.

py::enum_ usage in two pybinding files is deprecated in pybind11
3.0 but still functional; migration to py::native_enum can follow
separately.

This PR was authored with Claude.

Test Plan:
- cmake configure succeeded with pybind11 3.0.4 (--preset pybind)
- Built portable_lib, data_loader, selective_build, _llm_runner
  pybinding targets — all compiled clean on Python 3.13/macOS
- Verified black 26.3.0 recognizes py314 target-version
- lintrunner passes with updated black
- Full CI validation on Python 3.14 will run via the updated
  wheel build and pull.yml workflows
@rascani rascani force-pushed the python-3.14-support branch from 1aa78e5 to c6f4bf3 Compare June 23, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Python 3.14

1 participant