Skip to content

Commit 2a7a929

Browse files
authored
✨ Python 3.13 Support (cda-tum#656)
## 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.
2 parents 768154b + f86089f commit 2a7a929

File tree

6 files changed

+16
-12
lines changed

6 files changed

+16
-12
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,35 +14,37 @@ 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-macos: -DMQT_CORE_WITH_GMP=ON
2626

2727
cpp-linter:
2828
name: 🇨‌ Lint
2929
needs: change-detection
3030
if: fromJSON(needs.change-detection.outputs.run-cpp-linter)
31-
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-linter.yml@v1.1.5
31+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-linter.yml@v1.2.1
3232
with:
3333
cmake-args: -DBUILD_MQT_CORE_BENCHMARKS=ON
3434

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

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

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

cmake/ExternalDependencies.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if(BUILD_MQT_CORE_BINDINGS)
1717
message(STATUS "Python executable: ${Python_EXECUTABLE}")
1818

1919
# add pybind11 library
20-
find_package(pybind11 CONFIG REQUIRED)
20+
find_package(pybind11 2.13 CONFIG REQUIRED)
2121
endif()
2222

2323
set(JSON_VERSION

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

+4-2
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]
@@ -28,6 +28,7 @@ classifiers = [
2828
"Programming Language :: Python :: 3.10",
2929
"Programming Language :: Python :: 3.11",
3030
"Programming Language :: Python :: 3.12",
31+
"Programming Language :: Python :: 3.13",
3132
"Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)",
3233
"Typing :: Typed",
3334
]
@@ -278,6 +279,7 @@ archs = "auto64"
278279
test-command = "python -c \"from mqt import core\""
279280
test-skip = "cp38-macosx_arm64"
280281
build-frontend = "build[uv]"
282+
free-threaded-support = true
281283

282284
[tool.cibuildwheel.linux]
283285
environment = { DEPLOY = "ON" }
@@ -286,6 +288,6 @@ environment = { DEPLOY = "ON" }
286288
environment = { MACOSX_DEPLOYMENT_TARGET = "10.15" }
287289

288290
[tool.cibuildwheel.windows]
289-
before-build = "uv pip install delvewheel>=1.4.0"
291+
before-build = "uv pip install delvewheel>=1.7.3"
290292
repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel} --namespace-pkg mqt"
291293
environment = { CMAKE_GENERATOR = "Ninja" }

src/python/module.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void registerOperations(py::module& m);
1111
void registerSymbolic(py::module& m);
1212
void registerQuantumComputation(py::module& m);
1313

14-
PYBIND11_MODULE(_core, m) {
14+
PYBIND11_MODULE(_core, m, py::mod_gil_not_used()) {
1515
registerPermutation(m);
1616

1717
py::module symbolic = m.def_submodule("symbolic");

0 commit comments

Comments
 (0)