Skip to content

Commit c6f4bf3

Browse files
committed
Add Python 3.14 support
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
1 parent 1b726b2 commit c6f4bf3

11 files changed

Lines changed: 22 additions & 15 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

.github/workflows/pull.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
strategy:
4444
fail-fast: false
4545
matrix:
46-
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
46+
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
4747
with:
4848
runner: linux.2xlarge
4949
docker-image: ci-image:executorch-ubuntu-22.04-qnn-sdk

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)