Skip to content

Commit 43aa73f

Browse files
Merge remote-tracking branch 'upstream/main'
2 parents ee328e7 + fe97778 commit 43aa73f

File tree

357 files changed

+27376
-25153
lines changed

Some content is hidden

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

357 files changed

+27376
-25153
lines changed

.clang-tidy

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
FormatStyle: file
22

33
Checks: |
4-
clang-diagnostic-*,
5-
clang-analyzer-*,
6-
-clang-analyzer-core.NullDereference,
7-
boost-*,
84
bugprone-*,
95
-bugprone-easily-swappable-parameters,
106
clang-analyzer-*,
7+
-clang-analyzer-core.NullDereference,
8+
clang-diagnostic-*,
119
cppcoreguidelines-*,
1210
-cppcoreguidelines-non-private-member-variables-in-classes,
1311
-cppcoreguidelines-special-member-functions,

.cmake-format.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ format:
22
line_width: 100
33
keyword_case: "upper"
44
autosort: true
5+
6+
markup:
7+
first_comment_is_literal: true

.editorconfig

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.{py,pyi}]
12+
indent_size = 4
13+
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
17+
[{*.{cmake,cmake.in},CMakeLists.txt}]
18+
max_line_length = 100

.git_archival.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
node: $Format:%H$
22
node-date: $Format:%cI$
33
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
4-
ref-names: $Format:%D$

.github/codecov.yml

-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ flag_management:
2525
paths:
2626
- "include"
2727
- "src"
28-
after_n_builds: 1
2928
- name: python
3029
paths:
3130
- "src/mqt/**/*.py"
32-
after_n_builds: 3
3331
statuses:
3432
- type: project
3533
threshold: 0.5%

.github/contributing.md

+24-18
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,34 @@ Nevertheless, please try to follow the guidelines below as well as you can to he
3939
## Core Guidelines
4040

4141
- ["Commit early and push often"](https://www.worklytics.co/blog/commit-early-push-often).
42-
- Write meaningful commit messages (preferably using [gitmoji](https://gitmoji.dev) to give additional context to your commits).
43-
- Focus on a single feature/bug at a time and only touch relevant files. Split multiple features into multiple contributions.
44-
- If you added a new feature, you should add tests that ensure it works as intended. Furthermore, the new feature should be documented appropriately.
45-
- If you fixed a bug, you should add tests that demonstrate that the bug has been fixed.
46-
- Document your code thoroughly and write readable code.
47-
- Keep your code clean. Remove any debug statements, left-over comments, or code unrelated to your contribution.
48-
- Run `pre-commit run -a` to check your code for style and linting errors before committing.
42+
- Write meaningful commit messages, preferably using [gitmoji](https://gitmoji.dev) for additional context.
43+
- Focus on a single feature or bug at a time and only touch relevant files. Split multiple features into separate contributions.
44+
- Add tests for new features to ensure they work as intended. Document new features appropriately.
45+
- Add tests for bug fixes to demonstrate that the bug has been resolved.
46+
- Document your code thoroughly and ensure it is readable.
47+
- Keep your code clean by removing debug statements, leftover comments, and unrelated code.
48+
- Check your code for style and linting errors before committing.
49+
- Follow the project's coding standards and conventions.
50+
- Be open to feedback and willing to make necessary changes based on code reviews.
4951

5052
## Pull Request Workflow
5153

5254
- Create PRs early. It is ok to create work-in-progress PRs. You may mark these as draft PRs on GitHub.
53-
- Describe your PR. Start with a descriptive title, reference any related issues by including the issue number in the PR description, and add a comprehensive description of the changes. We provide a PR template that you can (and should) follow to create a PR. Do not delete any sections from the template.
54-
- Whenever a PR is created or updated, several workflows on all supported platforms and versions of Python are executed. These workflows ensure that the project still builds, that all tests pass, and that the code is properly formatted and introduces no new linting errors. Your PR is expected to pass all these continuous integration (CI) checks before it can be merged. Here are some tips for finding the cause of certain failures:
55-
- If any of the `CI / 🇨‌ Test` checks fail, this most likely indicates build errors or test failures in the C++ part of the code base. Look through the respective logs on GitHub for any error or failure messages.
56-
- If any of the `CI / 🐍 Test` checks fail, this most likely indicates build errors or test failures in the Python part of the code base. Look through the respective logs on GitHub for any error or failure messages.
57-
- If any of the `codecov/\*` checks fail, this means that your changes are not appropriately covered by tests or that the overall project coverage decreased too much. Ensure that you include tests for all your changes in the PR.
58-
- If `cpp-linter` comments on your PR with a list of warnings, these have been raised by `clang-tidy` when checking the C++ part of your changes for warnings or style guideline violations. The individual messages frequently provide helpful suggestions on how to fix the warnings. If you don't see any messages, but the `🇨‌ Lint / 🚨 Lint` check is red, click on the `Details` link to see the full log of the check and a step summary.
59-
- If the `pre-commit.ci` check fails, some of the `pre-commit` checks failed and could not be fixed automatically by the _pre-commit.ci_ bot. Such failures are most likely related to the Python part of the code base. The individual log messages frequently provide helpful suggestions on how to fix the warnings.
60-
- If the `docs/readthedocs.org:mqt-core` check fails, the documentation could not be built properly. Inspect the corresponding log file for any errors.
61-
- Once your PR is ready, change it from a draft PR to a regular PR and request a review from one of the project maintainers. Please make sure to only request a review once you are done with your changes and the PR is ready to be merged. If you are unsure whether your PR is ready for review, please ask in the PR comments.
62-
- If your PR gets a "Changes requested" review, you will need to address the feedback and update your PR by pushing to the same branch. You don't need to close the PR and open a new one. Respond to review comments on the PR (e.g., with "done 👍" or "done in @\<commit\>") to let the reviewer know that you have addressed the feedback. Note that reviewers do not get a notification if you just react to the review comment with an emoji. You need to write a comment to notify the reviewer.
63-
- Be sure to re-request review once you have made changes after a code review so that maintainers know that the requests have been addressed.
55+
- Describe your PR with a descriptive title, reference any related issues by including the issue number in the PR description, and add a comprehensive description of the changes. Follow the provided PR template and do not delete any sections, except for the issue reference if your PR is not related to an issue.
56+
- Whenever a PR is created or updated, several workflows on all supported platforms and versions of Python are executed. These workflows ensure that the project still builds, all tests pass, the code is properly formatted, and no new linting errors are introduced. Your PR must pass all these continuous integration (CI) checks before it can be merged.
57+
- Once your PR is ready, change it from a draft PR to a regular PR and request a review from one of the project maintainers. Only request a review once you are done with your changes and the PR is ready to be reviewed. If you are unsure whether your PR is ready, ask in the PR comments. If you are a first-time contributor, request a review from one of the maintainers by mentioning them in a comment on the PR.
58+
- If your PR gets a "Changes requested" review, address the feedback and update your PR by pushing to the same branch. Do not close the PR and open a new one. Respond to review comments on the PR (e.g., with "done 👍" or "done in @<commit>") to let the reviewer know that you have addressed the feedback. Note that reviewers do not get a notification if you just react to the review comment with an emoji. Write a comment to notify the reviewer. Do not resolve the review comments yourself. The reviewer will mark the comments as resolved once they are satisfied with the changes.
59+
- Be sure to re-request a review once you have made changes after a code review so that maintainers know that the requests have been addressed.
60+
- No need to squash commits before merging; we usually squash them to keep the history clean. We only merge without squashing if the commit history is clean and meaningful. Avoid rebasing or force-pushing your PR branch before merging, as it complicates reviews. You can rebase or clean up commits after addressing all review comments if desired.
61+
62+
Here are some tips for finding the cause of certain failures:
63+
64+
- If any of the `CI / 🇨‌ Test` checks fail, this indicates build errors or test failures in the C++ part of the code base. Look through the respective logs on GitHub for any error or failure messages.
65+
- If any of the `CI / 🐍 Test` checks fail, this indicates build errors or test failures in the Python part of the code base. Look through the respective logs on GitHub for any error or failure messages.
66+
- If any of the `codecov/\*` checks fail, this means that your changes are not appropriately covered by tests or that the overall project coverage decreased too much. Ensure that you include tests for all your changes in the PR.
67+
- If `cpp-linter` comments on your PR with a list of warnings, these have been raised by `clang-tidy` when checking the C++ part of your changes for warnings or style guideline violations. The individual messages frequently provide helpful suggestions on how to fix the warnings. If you don't see any messages, but the `🇨‌ Lint / 🚨 Lint` check is red, click on the `Details` link to see the full log of the check and a step summary.
68+
- If the `pre-commit.ci` check fails, some of the `pre-commit` checks failed and could not be fixed automatically by the _pre-commit.ci_ bot. Such failures are most likely related to the Python part of the code base. The individual log messages frequently provide helpful suggestions on how to fix the warnings.
69+
- If the `docs/readthedocs.org:\*` check fails, the documentation could not be built properly. Inspect the corresponding log file for any errors.
6470

6571
---
6672

.github/dependabot.yml

-25
This file was deleted.

.github/release-drafter.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,30 @@ categories:
1515
- "feature"
1616
- "enhancement"
1717
- "usability"
18+
- "refactor"
1819
- title: "🐛 Bug Fixes"
1920
labels:
2021
- "bug"
2122
- "fix"
2223
- title: "📄 Documentation"
2324
labels:
2425
- "documentation"
25-
- title: "🤖 CI"
26-
labels:
27-
- "continuous integration"
2826
- title: "📦 Packaging"
2927
labels:
3028
- "packaging"
3129
- title: "🧹 Code Quality"
3230
labels:
3331
- "code quality"
32+
- title: "🤖 CI"
33+
labels:
34+
- "continuous integration"
3435
- title: "⬆️ Dependencies"
3536
collapse-after: 5
3637
labels:
3738
- "dependencies"
3839
- "submodules"
3940
- "github_actions"
41+
- "pre-commit"
4042
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
4143
change-title-escapes: '\<*_&'
4244
version-resolver:
@@ -50,10 +52,6 @@ version-resolver:
5052
labels:
5153
- "patch"
5254
default: patch
53-
autolabeler:
54-
- label: "dependencies"
55-
title:
56-
- "/update pre-commit hooks/i"
5755

5856
template: |
5957
## 👀 What Changed

.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"],
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"],
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-3
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,65 @@
11
name: CD
22
on:
3+
push:
4+
branches: [main]
35
release:
46
types: [published]
57
workflow_dispatch:
68

9+
permissions:
10+
attestations: write
11+
contents: read
12+
id-token: write
13+
714
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.
818
python-packaging:
919
name: 🐍 Packaging
10-
uses: ./.github/workflows/reusable-python-packaging.yml
20+
uses: cda-tum/mqt-workflows/.github/workflows/[email protected]
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' }}
1126

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.core
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+
46+
# Downloads the previously generated artifacts and deploys to PyPI on published releases.
1247
deploy:
1348
if: github.event_name == 'release' && github.event.action == 'published'
1449
name: 🚀 Deploy to PyPI
1550
runs-on: ubuntu-latest
1651
environment:
1752
name: pypi
1853
url: https://pypi.org/p/mqt.core
19-
permissions:
20-
id-token: write
2154
needs: [python-packaging]
2255
steps:
2356
- uses: actions/download-artifact@v4
2457
with:
2558
pattern: cibw-*
2659
path: dist
2760
merge-multiple: true
61+
- name: Generate artifact attestation for sdist and wheel(s)
62+
uses: actions/attest-build-provenance@v2
63+
with:
64+
subject-path: "dist/*"
2865
- uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/ci.yml

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

1919
cpp-tests:
2020
name: 🇨‌ Test
2121
needs: change-detection
2222
if: fromJSON(needs.change-detection.outputs.run-cpp-tests)
23-
uses: ./.github/workflows/reusable-cpp-ci.yml
24-
secrets:
25-
token: ${{ secrets.CODECOV_TOKEN }}
23+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-ci.yml@v1.5
24+
with:
25+
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: ./.github/workflows/reusable-cpp-linter.yml
31+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-linter.yml@v1.5
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: ./.github/workflows/reusable-python-ci.yml
40-
secrets:
41-
token: ${{ secrets.CODECOV_TOKEN }}
39+
uses: cda-tum/mqt-workflows/.github/workflows/[email protected]
4240

4341
code-ql:
4442
name: 📝 CodeQL
4543
needs: change-detection
4644
if: fromJSON(needs.change-detection.outputs.run-code-ql)
47-
uses: ./.github/workflows/reusable-code-ql.yml
45+
uses: cda-tum/mqt-workflows/.github/workflows/[email protected]
46+
47+
cd:
48+
name: 🚀 CD
49+
needs: change-detection
50+
if: fromJSON(needs.change-detection.outputs.run-cd)
51+
uses: cda-tum/mqt-workflows/.github/workflows/[email protected]
4852

4953
required-checks-pass: # This job does nothing and is only used for branch protection
5054
name: 🚦 Check
@@ -55,6 +59,7 @@ jobs:
5559
- cpp-linter
5660
- python-tests
5761
- code-ql
62+
- cd
5863
runs-on: ubuntu-latest
5964
steps:
6065
- name: Decide whether the needed jobs succeeded or failed
@@ -77,4 +82,8 @@ jobs:
7782
fromJSON(needs.change-detection.outputs.run-code-ql)
7883
&& '' || 'code-ql,'
7984
}}
85+
${{
86+
fromJSON(needs.change-detection.outputs.run-cd)
87+
&& '' || 'cd,'
88+
}}
8089
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:

0 commit comments

Comments
 (0)