Skip to content

Commit 847559f

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 3179789 + 5ba703b commit 847559f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+12857
-9892
lines changed

.github/dependabot.yml

-36
This file was deleted.

.github/renovate.json5

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
$schema: "https://docs.renovatebot.com/renovate-schema.json",
3+
extends: ["config:recommended", ":gitSignOff"],
4+
prHourlyLimit: 10,
5+
enabledManagers: ["github-actions", "pre-commit", "pep621"],
6+
"pre-commit": {
7+
enabled: true
8+
},
9+
lockFileMaintenance: {
10+
"enabled": true,
11+
// "automerge": true, disabled due to endless update loops caused by setuptools_scm
12+
},
13+
configMigration: true,
14+
labels: ["dependencies"],
15+
schedule: ["every weekend"],
16+
packageRules: [
17+
{
18+
matchManagers: ["github-actions"],
19+
addLabels: ["github-actions", "continuous integration"],
20+
commitMessagePrefix: "⬆\uFE0F\uD83D\uDC68\u200D\uD83D\uDCBB"
21+
},
22+
{
23+
matchManagers: ["pep621"],
24+
addLabels: ["python"],
25+
commitMessagePrefix: "⬆\uFE0F\uD83D\uDC0D"
26+
},
27+
{
28+
matchManagers: ["pre-commit"],
29+
addLabels: ["pre-commit", "continuous integration"],
30+
commitMessagePrefix: "⬆\uFE0F\uD83E\uDE9D",
31+
},
32+
{
33+
"description": "Automerge patch updates",
34+
"matchUpdateTypes": ["patch"],
35+
"automerge": true
36+
}
37+
]
38+
}

.github/workflows/cd.yml

+40-9
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,57 @@
11
name: CD
22
on:
3+
push:
4+
branches: [main]
35
release:
46
types: [published]
57
workflow_dispatch:
6-
pull_request:
7-
paths:
8-
- .github/workflows/cd.yml
8+
9+
permissions:
10+
attestations: write
11+
contents: read
12+
id-token: write
913

1014
jobs:
15+
# Builds the sdist and wheels on all supported platforms and uploads the resulting
16+
# wheels as GitHub artifacts `dev-cibw-*`, `test-cibw-*`, or `cibw-*`, depending on
17+
# whether the workflow is triggered from a PR, a push to main, or a release, respectively.
1118
python-packaging:
1219
name: 🐍 Packaging
13-
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.3
20+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.4
21+
with:
22+
# Do not include local version information on pushes to main to facilitate TestPyPI uploads.
23+
no-local-version: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
24+
# Do not build emulated wheels on pushes to main to reduce runner load for CD.
25+
build-emulated-wheels: ${{ github.ref != 'refs/heads/main' || github.event_name != 'push' }}
1426

27+
# Downloads the previously generated artifacts and deploys to TestPyPI on pushes to main
28+
deploy-test-pypi:
29+
name: 🚀 Deploy to Test PyPI
30+
runs-on: ubuntu-latest
31+
environment:
32+
name: test-pypi
33+
url: https://test.pypi.org/p/mqt.qcec
34+
needs: [python-packaging]
35+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
36+
steps:
37+
- uses: actions/download-artifact@v4
38+
with:
39+
pattern: test-cibw-*
40+
path: dist
41+
merge-multiple: true
42+
- uses: pypa/gh-action-pypi-publish@release/v1
43+
with:
44+
repository-url: https://test.pypi.org/legacy/
45+
attestations: true
46+
47+
# Downloads the previously generated artifacts and deploys to PyPI on published releases.
1548
deploy:
1649
if: github.event_name == 'release' && github.event.action == 'published'
1750
name: 🚀 Deploy to PyPI
1851
runs-on: ubuntu-latest
1952
environment:
2053
name: pypi
2154
url: https://pypi.org/p/mqt.qcec
22-
permissions:
23-
id-token: write
24-
attestations: write
25-
contents: read
2655
needs: [python-packaging]
2756
steps:
2857
- uses: actions/download-artifact@v4
@@ -31,7 +60,9 @@ jobs:
3160
path: dist
3261
merge-multiple: true
3362
- name: Generate artifact attestation for sdist and wheel(s)
34-
uses: actions/attest-build-provenance@v1.4.0
63+
uses: actions/attest-build-provenance@v1.4.3
3564
with:
3665
subject-path: "dist/*"
3766
- uses: pypa/gh-action-pypi-publish@release/v1
67+
with:
68+
attestations: true

.github/workflows/ci.yml

+16-7
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.3
17+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-change-detection.yml@v1.4
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.3
23+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-ci.yml@v1.4
2424
with:
2525
cmake-args: ""
2626
cmake-args-ubuntu: -G Ninja
@@ -31,21 +31,25 @@ 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.3
34+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-linter.yml@v1.4
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.3
41-
with:
42-
skip-testing-latest-python: true
40+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-ci.yml@v1.4
4341

4442
code-ql:
4543
name: 📝 CodeQL
4644
needs: change-detection
4745
if: fromJSON(needs.change-detection.outputs.run-code-ql)
48-
uses: cda-tum/mqt-workflows/.github/workflows/reusable-code-ql.yml@v1.3
46+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-code-ql.yml@v1.4
47+
48+
cd:
49+
name: 🚀 CD
50+
needs: change-detection
51+
if: fromJSON(needs.change-detection.outputs.run-cd)
52+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.4
4953

5054
required-checks-pass: # This job does nothing and is only used for branch protection
5155
name: 🚦 Check
@@ -56,6 +60,7 @@ jobs:
5660
- cpp-linter
5761
- python-tests
5862
- code-ql
63+
- cd
5964
runs-on: ubuntu-latest
6065
steps:
6166
- name: Decide whether the needed jobs succeeded or failed
@@ -78,4 +83,8 @@ jobs:
7883
fromJSON(needs.change-detection.outputs.run-code-ql)
7984
&& '' || 'code-ql,'
8085
}}
86+
${{
87+
fromJSON(needs.change-detection.outputs.run-cd)
88+
&& '' || 'cd,'
89+
}}
8190
jobs: ${{ toJSON(needs) }}

.github/workflows/release-drafter.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ on:
66
- main
77
pull_request_target:
88
types: [opened, reopened, synchronize]
9-
10-
permissions:
11-
contents: read
9+
merge_group:
1210

1311
jobs:
1412
update_release_draft:

.github/workflows/update-mqt-core.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ concurrency:
2121
jobs:
2222
update-mqt-core:
2323
name: ⬆️ Update MQT Core
24-
uses: cda-tum/mqt-workflows/.github/workflows/reusable-mqt-core-update.yml@v1.3
24+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-mqt-core-update.yml@v1.4
2525
with:
2626
update-to-head: ${{ github.event.inputs.update-to-head || false }}

.pre-commit-config.yaml

+11-9
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
ci:
1111
autoupdate_commit_msg: "⬆️🪝 update pre-commit hooks"
12+
autoupdate_schedule: quarterly
1213
autofix_commit_msg: "🎨 pre-commit fixes"
1314
skip: [mypy]
1415

@@ -41,7 +42,7 @@ repos:
4142

4243
# Handling unwanted unicode characters
4344
- repo: https://github.com/sirosen/texthooks
44-
rev: 0.6.6
45+
rev: 0.6.7
4546
hooks:
4647
- id: fix-ligatures
4748
- id: fix-smartquotes
@@ -56,7 +57,7 @@ repos:
5657

5758
# Python linting and formatting using ruff
5859
- repo: https://github.com/astral-sh/ruff-pre-commit
59-
rev: v0.5.7
60+
rev: v0.6.8
6061
hooks:
6162
- id: ruff
6263
args: ["--fix", "--show-fixes"]
@@ -82,7 +83,7 @@ repos:
8283

8384
# Clang-format the C++ part of the code base automatically
8485
- repo: https://github.com/pre-commit/mirrors-clang-format
85-
rev: v18.1.8
86+
rev: v19.1.0
8687
hooks:
8788
- id: clang-format
8889
types_or: [c++, c, cuda]
@@ -96,19 +97,20 @@ repos:
9697

9798
# Check static types with mypy
9899
- repo: https://github.com/pre-commit/mirrors-mypy
99-
rev: v1.11.1
100+
rev: v1.11.2
100101
hooks:
101102
- id: mypy
102-
files: ^(src/mqt|test/python)
103+
files: ^(src/mqt|test/python|noxfile.py)
103104
args: []
104105
additional_dependencies:
105106
- importlib_resources
107+
- nox
106108
- numpy
107109
- pytest
108110

109111
# Check for spelling
110112
- repo: https://github.com/crate-ci/typos
111-
rev: v1.23.6
113+
rev: v1.24.6
112114
hooks:
113115
- id: typos
114116

@@ -123,21 +125,21 @@ repos:
123125

124126
# Check best practices for scientific Python code
125127
- repo: https://github.com/scientific-python/cookie
126-
rev: 2024.04.23
128+
rev: 2024.08.19
127129
hooks:
128130
- id: sp-repo-review
129131
additional_dependencies: ["repo-review[cli]"]
130132

131133
# Check JSON schemata
132134
- repo: https://github.com/python-jsonschema/check-jsonschema
133-
rev: 0.29.1
135+
rev: 0.29.2
134136
hooks:
135137
- id: check-dependabot
136138
- id: check-github-workflows
137139
- id: check-readthedocs
138140

139141
# Check the pyproject.toml file
140142
- repo: https://github.com/henryiii/validate-pyproject-schema-store
141-
rev: 2024.08.08
143+
rev: 2024.09.20
142144
hooks:
143145
- id: validate-pyproject

.python_version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

CMakeLists.txt

+31-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# set required cmake version
2-
cmake_minimum_required(VERSION 3.19...3.28)
2+
cmake_minimum_required(VERSION 3.19...3.30)
33

44
project(
55
mqt-qcec
66
LANGUAGES CXX
77
DESCRIPTION "MQT QCEC - A tool for Quantum Circuit Equivalence Checking")
88

9-
option(BUILD_MQT_QCEC_TESTS "Also build tests for the MQT QCEC project" ON)
109
option(BUILD_MQT_QCEC_BINDINGS "Build the MQT QCEC Python bindings" OFF)
11-
1210
if(BUILD_MQT_QCEC_BINDINGS)
1311
# ensure that the BINDINGS option is set
1412
set(BINDINGS
@@ -25,15 +23,32 @@ if(BUILD_MQT_QCEC_BINDINGS)
2523
ON
2624
CACHE BOOL "Prevent multiple searches for Python and instead cache the results.")
2725

26+
if(DISABLE_GIL)
27+
message(STATUS "Disabling Python GIL")
28+
add_compile_definitions(Py_GIL_DISABLED)
29+
endif()
30+
2831
# top-level call to find Python
2932
find_package(
30-
Python 3.8 REQUIRED
33+
Python 3.9 REQUIRED
3134
COMPONENTS Interpreter Development.Module
3235
OPTIONAL_COMPONENTS Development.SABIModule)
3336
endif()
3437

38+
# check if this is the master project or used via add_subdirectory
39+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
40+
set(MQT_QCEC_MASTER_PROJECT ON)
41+
else()
42+
set(MQT_QCEC_MASTER_PROJECT OFF)
43+
endif()
44+
45+
option(BUILD_MQT_QCEC_TESTS "Also build tests for the MQT QCEC project" ${MQT_QCEC_MASTER_PROJECT})
46+
3547
include(cmake/ExternalDependencies.cmake)
3648

49+
# set the include directory for the build tree
50+
set(MQT_QCEC_INCLUDE_BUILD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
51+
3752
# add main library code
3853
add_subdirectory(src)
3954

@@ -44,7 +59,15 @@ if(BUILD_MQT_QCEC_TESTS)
4459
add_subdirectory(test)
4560
endif()
4661

47-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
48-
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY)
49-
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P
50-
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
62+
if(MQT_QCEC_MASTER_PROJECT)
63+
if(NOT TARGET mqt-qcec-uninstall)
64+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
65+
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY)
66+
add_custom_target(mqt-qcec-uninstall COMMAND ${CMAKE_COMMAND} -P
67+
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
68+
endif()
69+
else()
70+
set(mqt-qcec_FOUND
71+
TRUE
72+
CACHE INTERNAL "True if mqt-qcec is found on the system")
73+
endif()

0 commit comments

Comments
 (0)