Skip to content

Commit

Permalink
✨ Python 3.13 Support (#430)
Browse files Browse the repository at this point in the history
## 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>
  • Loading branch information
burgholzer authored Aug 7, 2024
1 parent 7179ffa commit f044b00
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
python-packaging:
name: 🐍 Packaging
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.1.5
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.2.1

deploy:
if: github.event_name == 'release' && github.event.action == 'published'
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ concurrency:
jobs:
change-detection:
name: 🔍 Change
uses: cda-tum/mqt-workflows/.github/workflows/reusable-change-detection.yml@v1.1.5
uses: cda-tum/mqt-workflows/.github/workflows/reusable-change-detection.yml@v1.2.1

cpp-tests:
name: 🇨‌ Test
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cpp-tests)
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-ci.yml@v1.1.5
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-ci.yml@v1.2.1
with:
cmake-args: ""
cmake-args-ubuntu: -G Ninja
Expand All @@ -31,19 +31,21 @@ jobs:
name: 🇨‌ Lint
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cpp-linter)
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-linter.yml@v1.1.5
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-linter.yml@v1.2.1

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

code-ql:
name: 📝 CodeQL
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-code-ql)
uses: cda-tum/mqt-workflows/.github/workflows/reusable-code-ql.yml@v1.1.5
uses: cda-tum/mqt-workflows/.github/workflows/reusable-code-ql.yml@v1.2.1

required-checks-pass: # This job does nothing and is only used for branch protection
name: 🚦 Check
Expand Down
2 changes: 1 addition & 1 deletion cmake/ExternalDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if(BUILD_MQT_QCEC_BINDINGS)
endif()

# add pybind11 library
find_package(pybind11 CONFIG REQUIRED)
find_package(pybind11 2.13 CONFIG REQUIRED)
endif()

# cmake-format: off
Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

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

PYTHON_ALL_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"]
PYTHON_ALL_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

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

Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["scikit-build-core>=0.8.1", "setuptools-scm>=7", "pybind11>=2.12"]
requires = ["scikit-build-core>=0.8.1", "setuptools-scm>=7", "pybind11>=2.13"]
build-backend = "scikit_build_core.build"

[project]
Expand Down Expand Up @@ -30,6 +30,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Development Status :: 5 - Production/Stable",
"Typing :: Typed",
]
Expand Down Expand Up @@ -267,8 +268,9 @@ build = "cp3*"
skip = "*-musllinux_*"
archs = "auto64"
test-command = "python -c \"from mqt import qcec\""
test-skip = "cp38-macosx_arm64"
test-skip = ["cp38-macosx_arm64", "cp313*"] # skip testing on Python 3.13 until our dependencies are ready
build-frontend = "build[uv]"
free-threaded-support = true

[tool.cibuildwheel.linux]
environment = { DEPLOY="ON" }
Expand All @@ -277,6 +279,6 @@ environment = { DEPLOY="ON" }
environment = { MACOSX_DEPLOYMENT_TARGET = "10.15" }

[tool.cibuildwheel.windows]
before-build = "pip install delvewheel>=1.4.0"
before-build = "pip install delvewheel>=1.7.3"
repair-wheel-command = "delvewheel repair -v -w {dest_dir} {wheel} --namespace-pkg mqt"
environment = { CMAKE_ARGS = "-T ClangCL" }
2 changes: 1 addition & 1 deletion src/python/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ createManagerFromConfiguration(const py::object& circ1, const py::object& circ2,
}
} // namespace

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

Expand Down

0 comments on commit f044b00

Please sign in to comment.