Skip to content

Add Python 3.15 to Python packaging - #33359

Open
Danny On The Air (dannyota) wants to merge 5 commits into
microsoft:mainfrom
dannyota:python/315
Open

Danny On The Air (dannyota) wants to merge 5 commits into
microsoft:mainfrom
dannyota:python/315

Conversation

@dannyota

@dannyota Danny On The Air (dannyota) commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

Add CPython 3.15 to the Python packaging pipelines, following #26397 for 3.14.

  • CPU: Windows x64 and arm64, macOS arm64, and cp315 in the Linux packaging interpreter list.
  • CUDA 12 and 13: Windows x64 and Linux x86_64, plus Linux aarch64 for CUDA 13. Windows GPU tests run on 3.15.
  • setup.py classifier and the package smoke test.
  • NumPy 2.5.4 on 3.15, since 2.4.2 has no cp315 wheel.
  • torch, torchvision, triton, sentencepiece and h5py have no cp315 wheels. They, and neural-compressor (its tests need torch), are limited to Python < 3.15, and build.py skips torch-dependent tests on 3.15.

Not included: cp315t and a GitHub Actions CI job.

Testing

  • Fork workflow: CPU wheel built and tested for 3.14 and 3.15 on Linux x64, Windows x64 and macOS arm64. 128 passed, 4 WebGPU skips per job. https://github.com/dannyota/onnxruntime/actions/runs/38506082187
  • The Linux cp315 wheel ran on an Intel Arc GPU through the WebGPU plugin EP.
  • After rebasing on main, the tools/ci_build packaging tests (test_build_linux_python_package, test_build_python_tests, test_python_packaging) pass on Linux x64 and Linux arm64.
  • Changed requirements files resolve on Python 3.11, 3.14 and 3.15. PyYAML has no cp315 wheel yet and builds from sdist.
  • CUDA on 3.15 is not tested here (no NVIDIA hardware); it relies on the packaging pipeline.

Maintainer action

Packaging images need CPython 3.15 at /opt/python/cp315-cp315. Without it, Linux CPU packaging skips 3.15 and the 3.15 Linux GPU jobs fail.

Motivation and Context

Python 3.15.0 is released, and #33271 requests cp315 wheels.

Copilot AI balanced review requested due to automatic review settings October 14, 2026 05:47
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The three new CI-build test modules are not registered with any automated test target.

3 open findings
What changed in this PR

Adds CPython 3.15 wheel packaging across supported CPU and CUDA platforms, with compatible dependency pins and test gating.

Changes:

  • Extends packaging matrices, classifiers, and smoke tests for Python 3.15.
  • Uses NumPy 2.5.4 and excludes dependencies lacking cp315 wheels.
  • Skips PyTorch-dependent tests and improves packaging-script validation.
File Description
tools/​ci_build/​test_python_packaging.py Tests packaging configuration.
tools/​ci_build/​test_build_python_tests.py Tests Python test dispatch.
tools/​ci_build/​test_build_linux_python_package.py Tests Linux packaging scripts.
tools/​ci_build/​requirements/​transformers-test/​requirements.txt Adds cp315 dependency markers.
tools/​ci_build/​github/​windows/​python/​requirements.txt Pins cp315-compatible NumPy.
tools/​ci_build/​github/​linux/​python/​requirements.txt Pins cp315-compatible NumPy.
tools/​ci_build/​github/​linux/​docker/​scripts/​requirements.txt Updates NumPy selection.
tools/​ci_build/​github/​linux/​docker/​scripts/​manylinux/​requirements.txt Gates unsupported cp315 packages.
tools/​ci_build/​github/​linux/​docker/​scripts/​lort/​requirements.txt Gates h5py and updates NumPy.
tools/​ci_build/​github/​linux/​docker/​inference/​aarch64/​python/​cpu/​scripts/​requirements.txt Updates aarch64 NumPy pin.
tools/​ci_build/​github/​linux/​build_linux_python_package.sh Adds cp315 and selector validation.
tools/​ci_build/​github/​azure-pipelines/​templates/​set-python-manylinux-variables-step.yml Maps Python 3.15 manylinux path.
tools/​ci_build/​github/​azure-pipelines/​templates/​py-win-cpu.yml Adds Windows CPU cp315 jobs.
tools/​ci_build/​github/​azure-pipelines/​templates/​py-package-smoking-test.yml Adds cp315 smoke testing.
tools/​ci_build/​github/​azure-pipelines/​stages/​py-gpu-packaging-stage.yml Adds Windows/Linux GPU cp315 builds.
tools/​ci_build/​github/​azure-pipelines/​stages/​py-cpu-packaging-stage.yml Adds macOS cp315 build.
tools/​ci_build/​github/​azure-pipelines/​py-cuda13-packaging-pipeline.yml Adds CUDA 13 aarch64 cp315.
tools/​ci_build/​github/​azure-pipelines/​py-cuda-package-test-pipeline.yml Downloads Windows cp315 GPU wheel.
tools/​ci_build/​build.py Gates PyTorch-dependent tests.
setup.py Adds Python 3.15 classifier.
requirements-materialize-onnx-node-tests.txt Aligns NumPy pins.
onnxruntime/​test/​python/​quantization/​test_op_matmulnbits_prepacked_cuda.py Skips PyTorch parity on cp315.
onnxruntime/​test/​python/​onnxruntime_test_python_symlink_data.py Releases sessions before cleanup.
cmake/​onnxruntime_unittests.cmake Selects expected cp315 NumPy version.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/ci_build/test_python_packaging.py Resolved
@tianleiwu

Copy link
Copy Markdown
Contributor

Thank Danny On The Air (@dannyota), we will add /opt/python/cp315-cp315 to manylinux docker images.
Please be patient.

Signed-off-by: Danny <dannyontheair@outlook.com>
Signed-off-by: Danny <dannyontheair@outlook.com>
…ests

Select NumPy 2.5.4 on Python 3.15 in the remaining CI requirement
files. Limit triton, torch, torchvision, sentencepiece and h5py to
Python < 3.15, because they publish no cp315 wheels. Limit
neural-compressor the same way, because the optional tests that use it
also need torch. Skip both PyTorch installs in build.py and the PyTorch
packer parity test on Python 3.15, and keep the other Python tests
running.

Signed-off-by: Danny <dannyontheair@outlook.com>
Build Python 3.15 wheels in the Windows x64, Windows arm64 and macOS
arm64 CPU packaging jobs, replacing the opt-in parameter. Add cp315 to
the default Linux packaging interpreters before cp312, which stays last.
A default build skips a missing interpreter with a warning, as it does
for the other versions; an explicit -p selection still fails.

Signed-off-by: Danny <dannyontheair@outlook.com>
Build Python 3.15 CUDA 12 and CUDA 13 wheels for Windows x64 and Linux
x86_64, and Linux aarch64 for CUDA 13. Run the Windows GPU test stage on
3.15 like the other versions, and add the 3.15 wheel to the CUDA package
test pipeline. Add Python 3.15 to the package classifiers and to the
package smoke-test matrix.

Signed-off-by: Danny <dannyontheair@outlook.com>
@dannyota

Copy link
Copy Markdown
Contributor Author

Hi Tianlei Wu (@tianleiwu) eserscor, rebased on main. Did the Nov 5 image refresh (#33777) add /opt/python/cp315-cp315? If so, could you approve the workflows and queue the packaging pipelines? Lots of folks in #33271 are waiting on cp315 wheels. Thanks!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants