Skip to content

Commit f044b00

Browse files
authored
✨ Python 3.13 Support (cda-tum#430)
## Description The (ABI-stable) release candidate for Python 3.13 just released and the newest MQT Workflows include an updated version of cibuildwheel that supports building wheels for it. This PR enables regular Python 3.13 builds and also enables builds for the new free-threaded variant. ## Checklist: <!--- This checklist serves as a reminder of a couple of things that ensure your pull request will be merged swiftly. --> - [x] The pull request only contains commits that are related to it. - [x] I have added appropriate tests and documentation. - [x] I have made sure that all CI jobs on GitHub pass. - [x] The pull request introduces no new warnings and follows the project's style guidelines. Signed-off-by: burgholzer <burgholzer@me.com>
1 parent 7179ffa commit f044b00

File tree

6 files changed

+17
-13
lines changed

6 files changed

+17
-13
lines changed

.github/workflows/cd.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
python-packaging:
1212
name: 🐍 Packaging
13-
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.1.5
13+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.2.1
1414

1515
deploy:
1616
if: github.event_name == 'release' && github.event.action == 'published'

.github/workflows/ci.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ concurrency:
1414
jobs:
1515
change-detection:
1616
name: 🔍 Change
17-
uses: cda-tum/mqt-workflows/.github/workflows/reusable-change-detection.yml@v1.1.5
17+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-change-detection.yml@v1.2.1
1818

1919
cpp-tests:
2020
name: 🇨‌ Test
2121
needs: change-detection
2222
if: fromJSON(needs.change-detection.outputs.run-cpp-tests)
23-
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-ci.yml@v1.1.5
23+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-ci.yml@v1.2.1
2424
with:
2525
cmake-args: ""
2626
cmake-args-ubuntu: -G Ninja
@@ -31,19 +31,21 @@ jobs:
3131
name: 🇨‌ Lint
3232
needs: change-detection
3333
if: fromJSON(needs.change-detection.outputs.run-cpp-linter)
34-
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-linter.yml@v1.1.5
34+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-linter.yml@v1.2.1
3535

3636
python-tests:
3737
name: 🐍 Test
3838
needs: change-detection
3939
if: fromJSON(needs.change-detection.outputs.run-python-tests)
40-
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-ci.yml@v1.1.5
40+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-ci.yml@v1.2.1
41+
with:
42+
skip-testing-latest-python: true
4143

4244
code-ql:
4345
name: 📝 CodeQL
4446
needs: change-detection
4547
if: fromJSON(needs.change-detection.outputs.run-code-ql)
46-
uses: cda-tum/mqt-workflows/.github/workflows/reusable-code-ql.yml@v1.1.5
48+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-code-ql.yml@v1.2.1
4749

4850
required-checks-pass: # This job does nothing and is only used for branch protection
4951
name: 🚦 Check

cmake/ExternalDependencies.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if(BUILD_MQT_QCEC_BINDINGS)
1616
endif()
1717

1818
# add pybind11 library
19-
find_package(pybind11 CONFIG REQUIRED)
19+
find_package(pybind11 2.13 CONFIG REQUIRED)
2020
endif()
2121

2222
# cmake-format: off

noxfile.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
nox.options.sessions = ["lint", "tests"]
2020

21-
PYTHON_ALL_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"]
21+
PYTHON_ALL_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
2222

2323
# The following lists all the build requirements for building the package.
2424
# Note that this includes transitive build dependencies of package dependencies,
@@ -28,7 +28,7 @@
2828
BUILD_REQUIREMENTS = [
2929
"scikit-build-core[pyproject]>=0.8.1",
3030
"setuptools_scm>=7",
31-
"pybind11>=2.12",
31+
"pybind11>=2.13",
3232
"wheel>=0.40", # transitive dependency of pytest on Windows
3333
]
3434

pyproject.toml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["scikit-build-core>=0.8.1", "setuptools-scm>=7", "pybind11>=2.12"]
2+
requires = ["scikit-build-core>=0.8.1", "setuptools-scm>=7", "pybind11>=2.13"]
33
build-backend = "scikit_build_core.build"
44

55
[project]
@@ -30,6 +30,7 @@ classifiers = [
3030
"Programming Language :: Python :: 3.10",
3131
"Programming Language :: Python :: 3.11",
3232
"Programming Language :: Python :: 3.12",
33+
"Programming Language :: Python :: 3.13",
3334
"Development Status :: 5 - Production/Stable",
3435
"Typing :: Typed",
3536
]
@@ -267,8 +268,9 @@ build = "cp3*"
267268
skip = "*-musllinux_*"
268269
archs = "auto64"
269270
test-command = "python -c \"from mqt import qcec\""
270-
test-skip = "cp38-macosx_arm64"
271+
test-skip = ["cp38-macosx_arm64", "cp313*"] # skip testing on Python 3.13 until our dependencies are ready
271272
build-frontend = "build[uv]"
273+
free-threaded-support = true
272274

273275
[tool.cibuildwheel.linux]
274276
environment = { DEPLOY="ON" }
@@ -277,6 +279,6 @@ environment = { DEPLOY="ON" }
277279
environment = { MACOSX_DEPLOYMENT_TARGET = "10.15" }
278280

279281
[tool.cibuildwheel.windows]
280-
before-build = "pip install delvewheel>=1.4.0"
282+
before-build = "pip install delvewheel>=1.7.3"
281283
repair-wheel-command = "delvewheel repair -v -w {dest_dir} {wheel} --namespace-pkg mqt"
282284
environment = { CMAKE_ARGS = "-T ClangCL" }

src/python/bindings.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ createManagerFromConfiguration(const py::object& circ1, const py::object& circ2,
6161
}
6262
} // namespace
6363

64-
PYBIND11_MODULE(pyqcec, m) {
64+
PYBIND11_MODULE(pyqcec, m, py::mod_gil_not_used()) {
6565
m.doc() = "Python interface for the MQT QCEC quantum circuit equivalence "
6666
"checking tool";
6767

0 commit comments

Comments
 (0)