Skip to content

Commit 1aa78e5

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 ec76470 commit 1aa78e5

10 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
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
33+
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
3434
with:
3535
runner: linux.2xlarge
3636
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
@@ -156,6 +156,13 @@ if(NOT PYTHON_EXECUTABLE)
156156
endif()
157157
announce_configured_options(PYTHON_EXECUTABLE)
158158

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

pyproject.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ classifiers = [
4848
"Programming Language :: Python :: 3.11",
4949
"Programming Language :: Python :: 3.12",
5050
"Programming Language :: Python :: 3.13",
51+
"Programming Language :: Python :: 3.14",
5152
]
5253

53-
requires-python = ">=3.10,<3.14"
54+
requires-python = ">=3.10,<3.15"
5455
dependencies=[
5556
"expecttest",
5657
"flatbuffers",
@@ -69,9 +70,9 @@ dependencies=[
6970
# See also third-party/TARGETS for buck's typing-extensions version.
7071
"typing-extensions>=4.10.0",
7172
# Keep this version in sync with: ./backends/apple/coreml/scripts/install_requirements.sh
72-
"coremltools==9.0; platform_system == 'Darwin' or platform_system == 'Linux'",
73+
"coremltools==9.0; (platform_system == 'Darwin' or platform_system == 'Linux') and python_version < '3.14'",
7374
# scikit-learn is used to support palettization in the coreml backend
74-
"scikit-learn==1.7.1",
75+
"scikit-learn>=1.7.1",
7576
"hydra-core>=1.3.0",
7677
"omegaconf>=2.3.0",
7778
]
@@ -155,7 +156,7 @@ first_party_detection = false
155156
# Emit syntax compatible with older versions of python instead of only the range
156157
# specified by `requires-python`. TODO: Remove this once we support these older
157158
# versions of python and can expand the `requires-python` range.
158-
target-version = ["py38", "py39", "py310", "py311", "py312", "py313"]
159+
target-version = ["py38", "py39", "py310", "py311", "py312", "py313", "py314"]
159160

160161
[tool.docformatter]
161162
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

third-party/pybind11

Submodule pybind11 updated 290 files

0 commit comments

Comments
 (0)