Skip to content

Commit 0a8fd54

Browse files
committed
Add Python 3.14 support
Raise requires-python upper bound from <3.14 to <3.15 and add 3.14 to wheel build matrices. 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. Bridge PYTHON_EXECUTABLE to Python_EXECUTABLE in CMakeLists.txt in preparation for a future pybind11 3.0 upgrade. pybind11 is kept at v2.13.6 for now — v3.0.x causes runtime segfaults in the pybindings. Python 3.14 is not added to the QNN wheel test matrix because PyTorch's torch.export has a typing introspection bug on 3.14 (typing.Union.__module__). Both are tracked for follow-up. This PR was authored with Claude. Test Plan: - cmake configure and pybinding build succeed (--preset pybind) - lintrunner passes with updated black 26.3.0 - Full CI validation on Python 3.14 will run via the updated wheel build workflows
1 parent 1b726b2 commit 0a8fd54

9 files changed

Lines changed: 20 additions & 13 deletions

File tree

.claude/skills/building/SKILL.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,16 @@ conda activate executorch
2323

2424
**Path B — no conda (fall back to venv):**
2525
```bash
26-
# Find a compatible Python (3.10–3.13). On macOS with only Homebrew Python 3.14+,
27-
# install a compatible version first: brew install python@3.12
28-
python3.12 -m venv .executorch-venv # or python3.11, python3.10, python3.13
26+
# Find a compatible Python (3.10–3.14).
27+
python3.12 -m venv .executorch-venv # or python3.11, python3.10, python3.13, python3.14
2928
source .executorch-venv/bin/activate
3029
pip install --upgrade pip
3130
```
3231

3332
**Then verify (either path):**
3433

3534
Run `python --version` and `cmake --version`. Fix automatically:
36-
- **Python not 3.10–3.13**: recreate the env with a correct Python version.
35+
- **Python not 3.10–3.14**: recreate the env with a correct Python version.
3736
- **cmake missing or < 3.24**: run `pip install 'cmake>=3.24'` inside the env.
3837
- **cmake >= 4.0**: works in practice, no action needed.
3938

.github/workflows/build-wheels-aarch64-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
test-infra-ref: main
3131
with-cuda: disabled
3232
with-rocm: disabled
33-
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
33+
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
3434

3535
build:
3636
needs: generate-matrix

.github/workflows/build-wheels-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
test-infra-ref: main
3131
with-cuda: disabled
3232
with-rocm: disabled
33-
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
33+
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
3434

3535
build:
3636
needs: generate-matrix

.github/workflows/build-wheels-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
test-infra-ref: main
3131
with-cuda: disabled
3232
with-rocm: disabled
33-
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
33+
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
3434

3535
build:
3636
needs: generate-matrix

.github/workflows/build-wheels-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
test-infra-ref: main
3434
with-cuda: disabled
3535
with-rocm: disabled
36-
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
36+
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
3737

3838
build:
3939
needs: generate-matrix

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ if(NOT PYTHON_EXECUTABLE)
157157
endif()
158158
announce_configured_options(PYTHON_EXECUTABLE)
159159

160+
# pybind11 >=3.0 uses find_package(Python) which looks for Python_EXECUTABLE,
161+
# not the legacy PYTHON_EXECUTABLE variable. Bridge the two so pybind11 picks up
162+
# the interpreter that setup.py (or the user) specified.
163+
if(PYTHON_EXECUTABLE AND NOT Python_EXECUTABLE)
164+
set(Python_EXECUTABLE "${PYTHON_EXECUTABLE}")
165+
endif()
166+
160167
announce_configured_options(CMAKE_CXX_COMPILER_ID)
161168
announce_configured_options(CMAKE_TOOLCHAIN_FILE)
162169
announce_configured_options(BUILD_TESTING)

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ classifiers = [
5151
"Programming Language :: Python :: 3.11",
5252
"Programming Language :: Python :: 3.12",
5353
"Programming Language :: Python :: 3.13",
54+
"Programming Language :: Python :: 3.14",
5455
]
5556

56-
requires-python = ">=3.10,<3.14"
57+
requires-python = ">=3.10,<3.15"
5758

5859
# Runtime dependencies are declared dynamically (see `dynamic` above) and
5960
# computed in setup.py, so the EXECUTORCH_BUILD_MINIMAL wheel can ship a slimmer
@@ -143,7 +144,7 @@ first_party_detection = false
143144
# Emit syntax compatible with older versions of python instead of only the range
144145
# specified by `requires-python`. TODO: Remove this once we support these older
145146
# versions of python and can expand the `requires-python` range.
146-
target-version = ["py38", "py39", "py310", "py311", "py312", "py313"]
147+
target-version = ["py38", "py39", "py310", "py311", "py312", "py313", "py314"]
147148

148149
[tool.docformatter]
149150
black = true

requirements-lintrunner.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pycodestyle==2.11.1
99
torchfix==0.6.0
1010

1111
# UFMT
12-
black==24.4.2
12+
black==26.3.0
1313
ufmt==2.8.0
1414
usort==1.0.8.post1
1515

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ def _base_dependencies() -> List[str]:
190190
# See also third-party/TARGETS for buck's typing-extensions version.
191191
"typing-extensions>=4.10.0",
192192
# Keep this version in sync with: ./backends/apple/coreml/scripts/install_requirements.sh
193-
"coremltools==9.0; platform_system == 'Darwin' or platform_system == 'Linux'",
193+
"coremltools==9.0; (platform_system == 'Darwin' or platform_system == 'Linux') and python_version < '3.14'",
194194
# scikit-learn is used to support palettization in the coreml backend.
195-
"scikit-learn==1.7.1",
195+
"scikit-learn>=1.7.1",
196196
"hydra-core>=1.3.0",
197197
"omegaconf>=2.3.0",
198198
]

0 commit comments

Comments
 (0)