Skip to content

Commit

Permalink
Add official support for Python 3.13 (#13309)
Browse files Browse the repository at this point in the history
* Add official support for Python 3.13

This commit adds "official" support for Python 3.13 to Qiskit. We
implicitly supported it previously because nothing in Qiskit itself was
incompatible with 3.13 and we use the stable ABI from rust which is
compatible with new releases. But to mark 3.13 as "official" we just
need to add it to CI, including the cibuildwheel test phase, and add the
trove classifier to the package metadata indicating 3.13 is supported.

* Remove scipy pin on 3.13

* Fix docstring tests with 3.13 indent rules

* Add 3.13 to asv config too
  • Loading branch information
mtreinish authored Oct 25, 2024
1 parent 2327fde commit f10da22
Show file tree
Hide file tree
Showing 7 changed files with 163 additions and 68 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
matrix:
# Normally we test min and max version but we can't run python
# 3.9 on arm64 until actions/setup-python#808 is resolved
python-version: ["3.10", "3.12"]
python-version: ["3.10", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
Expand All @@ -44,7 +44,7 @@ jobs:
python -m pip install -U -r requirements.txt -c constraints.txt
python -m pip install -U -r requirements-dev.txt -c constraints.txt
python -m pip install -c constraints.txt -e .
if: matrix.python-version == '3.12'
if: matrix.python-version == '3.13'
- name: 'Install optionals'
run: |
python -m pip install -r requirements-optional.txt -c constraints.txt
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/wheels-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
default: "default"
required: false

wheels-32bit:
wheels-32bit:
description: >-
The action to take for Tier 1 wheels.
Choose from 'default', 'build' or 'skip'.
Expand All @@ -36,23 +36,23 @@ on:
default: "default"
required: false

wheels-linux-s390x:
wheels-linux-s390x:
description: >-
The action to take for Linux s390x wheels.
Choose from 'default', 'build' or 'skip'.
type: string
default: "default"
required: false

wheels-linux-ppc64le:
wheels-linux-ppc64le:
description: >-
The action to take for Linux ppc64le wheels.
Choose from 'default', 'build' or 'skip'.
type: string
default: "default"
required: false

wheels-linux-aarch64:
wheels-linux-aarch64:
description: >-
The action to take for Linux AArch64 wheels.
Choose from 'default', 'build' or 'skip'.
Expand All @@ -77,7 +77,7 @@ on:
type: boolean
default: true
required: false


jobs:
wheels-tier-1:
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
env:
PGO_WORK_DIR: ${{ github.workspace }}/pgo-data
PGO_OUT_PATH: ${{ github.workspace }}/merged.profdata
- uses: pypa/cibuildwheel@v2.19.2
- uses: pypa/cibuildwheel@v2.21.3
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
Expand All @@ -151,7 +151,7 @@ jobs:
with:
components: llvm-tools-preview
- name: Build wheels
uses: pypa/cibuildwheel@v2.19.2
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_SKIP: 'pp* cp36-* cp37-* cp38-* *musllinux* *amd64 *x86_64'
- uses: actions/upload-artifact@v4
Expand All @@ -173,7 +173,7 @@ jobs:
- uses: docker/setup-qemu-action@v3
with:
platforms: all
- uses: pypa/cibuildwheel@v2.19.2
- uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_ARCHS_LINUX: s390x
CIBW_TEST_SKIP: "cp*"
Expand All @@ -196,7 +196,7 @@ jobs:
- uses: docker/setup-qemu-action@v3
with:
platforms: all
- uses: pypa/cibuildwheel@v2.19.2
- uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_ARCHS_LINUX: ppc64le
CIBW_TEST_SKIP: "cp*"
Expand All @@ -218,7 +218,7 @@ jobs:
- uses: docker/setup-qemu-action@v3
with:
platforms: all
- uses: pypa/cibuildwheel@v2.19.2
- uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_ARCHS_LINUX: aarch64
CIBW_TEST_COMMAND: cp -r {project}/test . && QISKIT_PARALLEL=FALSE stestr --test-path test/python run --abbreviate -n test.python.compiler.test_transpiler
Expand Down
2 changes: 1 addition & 1 deletion asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dvcs": "git",
"environment_type": "virtualenv",
"show_commit_url": "http://github.com/Qiskit/qiskit/commit/",
"pythons": ["3.9", "3.10", "3.11", "3.12"],
"pythons": ["3.9", "3.10", "3.11", "3.12", "3.13"],
"benchmark_dir": "test/benchmarks",
"env_dir": ".asv/env",
"results_dir": ".asv/results"
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ parameters:
- name: "supportedPythonVersions"
displayName: "All supported versions of Python"
type: object
default: ["3.9", "3.10", "3.11", "3.12"]
default: ["3.9", "3.10", "3.11", "3.12", "3.13"]

- name: "minimumPythonVersion"
displayName: "Minimum supported version of Python"
Expand All @@ -47,7 +47,7 @@ parameters:
- name: "maximumPythonVersion"
displayName: "Maximum supported version of Python"
type: string
default: "3.12"
default: "3.13"

# These two versions of Python can be chosen somewhat arbitrarily, but we get
# slightly better coverage per PR if they're neither the maximum nor minimum
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
]
# These are configured in the `tool.setuptools.dynamic` table.
Expand Down
Loading

0 comments on commit f10da22

Please sign in to comment.