Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ Refactor Packaging and CI #301

Merged
merged 79 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
4901a2e
🔧 update jetbrains configuration
burgholzer Aug 20, 2023
6828381
⬆️ update mqt-core
burgholzer Aug 20, 2023
a91da73
♻️ move to scikit-build-core and src-layout
burgholzer Aug 20, 2023
6a9960e
🙈 update gitignore
burgholzer Aug 20, 2023
7c7e09a
🔧 update noxfile
burgholzer Aug 20, 2023
8bc504c
🩹🚨 iron out some details
burgholzer Aug 20, 2023
c0bfeed
🩹 fix docs build
burgholzer Aug 20, 2023
e78d209
🔧 use relative imports within Python module
burgholzer Aug 20, 2023
358340c
⬆️ update mqt-core
burgholzer Aug 20, 2023
324857d
🔥 remove unnecessary code
burgholzer Aug 20, 2023
c6b1e7f
🔧 adjust docs configuration
burgholzer Aug 20, 2023
4167870
🔧 update pre-commit config
burgholzer Aug 20, 2023
0015ce5
🔥 remove unnecessary `MANIFEST.in` file
burgholzer Aug 20, 2023
11a8e0c
✏️ fix typo
burgholzer Aug 20, 2023
3dc819f
🩹 fix finding Python
burgholzer Aug 20, 2023
01ecf5c
⚗️ try with lower CMake max policy
burgholzer Aug 20, 2023
5b13ea9
✏️ remove `nanobind reference`
burgholzer Aug 20, 2023
3b35a50
⚗️ try to get windows to use clang
burgholzer Aug 20, 2023
a9d25de
🏁 fix Windows env setting
burgholzer Aug 21, 2023
632bde6
⬆️ update mqt-core
burgholzer Aug 21, 2023
01ea386
⚗️ try `find_package(Python3 ...)`
burgholzer Aug 21, 2023
473404f
⬆️ update mqt-core
burgholzer Aug 21, 2023
b74789d
🔧 allow CMake 3.27 policies
burgholzer Aug 21, 2023
1d04571
⬆️ update mqt-core
burgholzer Aug 21, 2023
b1ed24a
♻️ adapt to `pybind11` no longer being a submodule
burgholzer Aug 21, 2023
2ecb603
⚗️ try reusable cpp-linter workflow
burgholzer Aug 23, 2023
d356ff0
🔧 adjust .idea configuration
burgholzer Aug 23, 2023
2ecf998
⚗️ try reusable CodeQL workflow
burgholzer Aug 23, 2023
4d7f672
⬆️ update to scikit-build-core 0.5
burgholzer Aug 23, 2023
dd7f45a
🔥 remove importlib_metadata dependency
burgholzer Aug 23, 2023
9066543
⬆️ stable docs dependencies
burgholzer Aug 23, 2023
7d28645
🚸 improved docs job
burgholzer Aug 23, 2023
02fbbf6
🔥 remove unnecessary no cover directives
burgholzer Aug 23, 2023
c16d3ab
🩹 fix intersphinx linking
burgholzer Aug 23, 2023
7561d52
🔧 small docs config update
burgholzer Aug 23, 2023
da45e35
🩹 add missing Literal type aliases
burgholzer Aug 23, 2023
fc9f0d8
🩹 fix two class links
burgholzer Aug 23, 2023
dbdb379
🩹 intersphinx link
burgholzer Aug 23, 2023
fa57e4e
🔧 adjust pre-commit structure
burgholzer Aug 23, 2023
6a5684b
🔥 cmake no longer required in docs build
burgholzer Aug 23, 2023
467d71f
🔧 use CMake caching for FindPython
burgholzer Aug 23, 2023
5e62592
📝 update docs urls
burgholzer Aug 23, 2023
5fe3b37
⚗️ try unified CI workflow
burgholzer Aug 23, 2023
2bde50c
Merge branch 'main' into scikit-build-core
burgholzer Aug 23, 2023
2a2ee5b
🔧 add pylint matcher
burgholzer Aug 23, 2023
de271ee
♻️ switch to new `minimals` workflow
burgholzer Aug 23, 2023
b7b0ba2
✏️ fix constraints.txt
burgholzer Aug 23, 2023
9f28853
⚗️ try new cirrus CI config
burgholzer Aug 24, 2023
38dff1f
🔧 set CI settings for Python tests in noxfile
burgholzer Aug 24, 2023
7c3f434
⚗️ try reusable wheels workflow (incl. emulation)
burgholzer Aug 24, 2023
b6f7e83
🔧 pylint does not need the dev extra
burgholzer Aug 24, 2023
399a3ad
🚨 silence `numpy.linalg` warnings
burgholzer Aug 24, 2023
ef2b057
♻️ simplified handling of the `DEPLOY` flag
burgholzer Aug 24, 2023
4c4d925
🩹 fix googletest path
burgholzer Aug 24, 2023
311b7f6
🔧 disable MQT Core tests by default
burgholzer Aug 24, 2023
e6dc0d8
🔧 only trigger CD on releases
burgholzer Aug 24, 2023
1484e21
🔧 only build wheels on releases
burgholzer Aug 24, 2023
ce65d87
🩹 fix coverage configuration
burgholzer Aug 24, 2023
45f5638
♻️ build c++ tests by default
burgholzer Aug 24, 2023
9836467
🔧 change detection for docs build
burgholzer Aug 24, 2023
fc4a026
✏️ fix keywords
burgholzer Aug 24, 2023
f29709a
🔧 small adjustment to coverage config
burgholzer Aug 24, 2023
4ddced4
⬆️ update mqt-core
burgholzer Aug 25, 2023
143a07f
Replaced vector with unordered_map
pehamTom Aug 25, 2023
e5ba0c2
🚨 fix clang-tidy warnings
burgholzer Aug 26, 2023
0e7d36b
🚨 try to please coverage and linter at the same time
burgholzer Aug 26, 2023
368d0a3
🔥 remove unnecessary environment variable in Cirrus job
burgholzer Aug 26, 2023
9f4110f
🎨 cleanup pre-commit config
burgholzer Aug 26, 2023
bcaace2
✏️ fix leftover qfr typo
burgholzer Aug 26, 2023
1b0b9c5
🔧 use dependabot groups
burgholzer Aug 27, 2023
ec32496
🔧 update release drafter workflow
burgholzer Aug 27, 2023
80d04d1
🔥 remove superfluous CodeQL config
burgholzer Aug 27, 2023
d15274c
♻️ update issue templates
burgholzer Aug 27, 2023
c399cdb
🔥 remove superfluous docs make files
burgholzer Aug 27, 2023
b86c2ff
🔧 simplify coverage configuration
burgholzer Aug 27, 2023
824ccac
📝 Update readme badges
burgholzer Aug 28, 2023
e7b6b9d
🔧 switch actions to `main` branch of mqt-core
burgholzer Aug 28, 2023
8a2ac4d
⬆️ update mqt-core
burgholzer Aug 28, 2023
67c7576
♻️ move publishing out of reusable workflow
burgholzer Aug 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 79 additions & 30 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
.clone_script: &clone |
if [ -z "$CIRRUS_PR" ]; then
git clone --recursive --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR
git reset --hard $CIRRUS_CHANGE_IN_REPO
else
git clone https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR
git fetch origin pull/$CIRRUS_PR/head:pull/$CIRRUS_PR
git checkout $CIRRUS_BASE_BRANCH
git -c user.email="you@example.com" merge --no-commit pull/$CIRRUS_PR
git submodule update --init --recursive
fi

.statistics_script: &statistics |
ccache -s -v
echo $(python -m pip cache dir)
echo $(python -m pip cache list)

macos_arm64_test_task:
name: 🐍 Test / 🍎 arm64
alias: macos_arm64_test
clone_script: *clone
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode:latest
ccache_cache:
folder: .ccache
populate_script:
- mkdir -p .ccache
fingerprint_key: ccache-macosx_arm64
pip_cache:
folder: /Users/admin/Library/Caches/pip
prepare_env_script: |
brew install python@3.10 ccache pipx ninja nox
ln -s $(which python3.10) python
export PATH=/opt/homebrew/opt/python@3.10/libexec/bin:$PATH
export PATH=/opt/homebrew/opt/ccache/libexec:$PATH
export PATH=/opt/homebrew/opt/pipx/libexec:$PATH
export PATH=/opt/homebrew/opt/ninja/libexec:$PATH
export PATH=/opt/homebrew/opt/nox/libexec:$PATH
echo "PATH=$PATH" >> $CIRRUS_ENV
echo "CCACHE_DIR=$PWD/.ccache" >> $CIRRUS_ENV
run_nox_script:
- nox -s tests-3.10 --verbose
statistics_script: *statistics

build_and_store_wheels: &BUILD_AND_STORE_WHEELS
install_cibuildwheel_script:
- python -m pip install cibuildwheel~=2.15.0
Expand All @@ -6,56 +50,61 @@ build_and_store_wheels: &BUILD_AND_STORE_WHEELS
wheels_artifacts:
path: "wheelhouse/*"

.clone_script: &clone |
if [ -z "$CIRRUS_PR" ]; then
git clone --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR
else
git clone https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR
git fetch origin pull/$CIRRUS_PR/head:pull/$CIRRUS_PR
fi
git reset --hard $CIRRUS_CHANGE_IN_REPO
git submodule update --init --recursive

linux_aarch64_task:
name: Build Linux aarch64 wheels.
linux_aarch64_wheels_task:
only_if: "$CIRRUS_RELEASE != ''"
name: 🐍 Packaging / 🎡 🐧 arm64
alias: linux_aarch64_wheels
clone_script: *clone
compute_engine_instance:
image_project: cirrus-images
image: family/docker-builder-arm64
architecture: arm64
platform: linux
cpu: 4
env:
CIBW_SKIP: "*-musllinux_*"

install_pre_requirements_script:
- apt install -y python3-venv python-is-python3
cpu: 8
setup_pyhton_script:
- apt-get install -y python3-venv python-is-python3
<<: *BUILD_AND_STORE_WHEELS

macos_arm64_task:
name: Build macOS arm64 wheels.
macos_arm64_wheels_task:
only_if: "$CIRRUS_RELEASE != ''"
name: 🐍 Packaging / 🎡 🍎 arm64
alias: macos_arm64_wheels
clone_script: *clone
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode:latest

env:
PATH: /opt/homebrew/opt/python@3.10/bin:$PATH
install_pre_requirements_script:
- brew install python@3.10
- ln -s python3 /opt/homebrew/opt/python@3.10/bin/python
ccache_cache:
folder: .ccache
populate_script:
- mkdir -p .ccache
fingerprint_key: ccache-macosx_arm64-wheels
pip_cache:
folder: /Users/admin/Library/Caches/pip
prepare_env_script: |
brew install python@3.10 ccache pipx ninja nox
ln -s $(which python3.10) python
export PATH=/opt/homebrew/opt/python@3.10/libexec/bin:$PATH
export PATH=/opt/homebrew/opt/ccache/libexec:$PATH
export PATH=/opt/homebrew/opt/pipx/libexec:$PATH
export PATH=/opt/homebrew/opt/ninja/libexec:$PATH
export PATH=/opt/homebrew/opt/nox/libexec:$PATH
echo "PATH=$PATH" >> $CIRRUS_ENV
echo "CCACHE_DIR=$PWD/.ccache" >> $CIRRUS_ENV
<<: *BUILD_AND_STORE_WHEELS
statistics_script: *statistics

publish_task:
name: Upload to PyPI
name: 🚀 Deploy to PyPI
container: { image: "python:3.10-bullseye" }
depends_on:
- Build Linux aarch64 wheels.
- Build macOS arm64 wheels.
- linux_aarch64_wheels
- macos_arm64_wheels
only_if: "$CIRRUS_RELEASE != ''"
env:
TWINE_REPOSITORY: pypi
TWINE_USERNAME: __token__
TWINE_PASSWORD: ENCRYPTED[853587a6e1033bef6a80fbf7cf11762676107052030566cf1eca86bfaae3452433a1f05c7e6f7690d027b52d22a217c2]
TWINE_PASSWORD: "ENCRYPTED\
[853587a6e1033bef6a80fbf7cf11762676107052030566cf\
1eca86bfaae3452433a1f05c7e6f7690d027b52d22a217c2]"
install_script: pip install twine
publish_script:
- curl -L https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/wheels.zip -o wheels.zip
Expand Down
39 changes: 10 additions & 29 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: 🐛 Bug report
description: Something is not working correctly.
title: "🐛 <title>"
labels: ["bug"]
assignees:
- burgholzer
body:
- type: markdown
attributes:
Expand All @@ -13,35 +10,19 @@ body:
Verify first that your issue is not [already reported on GitHub](https://github.com/cda-tum/qcec/search?q=is%3Aissue&type=issues).

If you are having general questions, please consider [starting a discussion](https://github.com/cda-tum/qcec/discussions).
- type: markdown
attributes:
value: >-
**Environment**
- type: input
attributes:
label: mqt.qcec version
placeholder: For example, mqt.qcec===2.0.0
validations:
required: true
- type: input
If you have general questions, please consider [starting a discussion](https://github.com/cda-tum/qcec/discussions).
- type: textarea
attributes:
label: OS
placeholder: For example, Ubuntu 22.04, macOS Big Sur, Windows etc.
label: Environment information
description: >-
Please provide information about your environment. For example, OS, C++ compiler, mqt.core version etc.
placeholder: |
- OS:
- C++ compiler:
- mqt.core version:
- Additional environment information:
validations:
required: true
- type: input
attributes:
label: Python version
placeholder: For example, Python 3.10
- type: input
attributes:
label: C++ compiler
placeholder: For example, gcc-10
- type: textarea
attributes:
label: Additional environment information
description: Feel free to add more information about your environment here.
- type: textarea
attributes:
label: Description
Expand Down
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: ✨ Feature request
description: Suggest an idea
title: "✨ <title>"
labels: ["enhancement"]
assignees:
- burgholzer
body:
- type: markdown
attributes:
Expand Down
16 changes: 11 additions & 5 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ignore:
- "extern/**/*"
- "mqt/**/*.cpp"
- "**/python"
- "test/**/*"

coverage:
Expand All @@ -12,10 +12,12 @@ coverage:

flag_management:
default_rules:
carryforward: true
statuses:
- type: project
target: auto
threshold: 0.5%
removed_code_behavior: adjust_base
- type: patch
target: 90%
threshold: 1%
Expand All @@ -24,12 +26,15 @@ flag_management:
paths:
- "include"
- "src"
after_n_builds: 1
- name: python
paths:
- "mqt/**/*.py"
- "src/mqt/**/*.py"
after_n_builds: 3
statuses:
- type: project
threshold: 0.5%
removed_code_behavior: adjust_base
- type: patch
target: 95%
threshold: 1%
Expand All @@ -40,6 +45,7 @@ parsers:
conditional: no
loop: no

codecov:
notify:
after_n_builds: 4
comment:
layout: "reach, diff, flags, files"
require_changes: true
show_carryforward_flags: true
4 changes: 0 additions & 4 deletions .github/codeql-config.yml

This file was deleted.

13 changes: 12 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@ version: 2
updates:
- package-ecosystem: "gitsubmodule"
directory: "/"
groups:
submodules:
patterns:
- "*"
schedule:
interval: "monthly"
day: "friday"
time: "06:00"
timezone: "Europe/Vienna"

- package-ecosystem: "github-actions"
directory: "/"
groups:
github-actions:
patterns:
- "*"
schedule:
interval: "weekly"
day: "friday"
Expand All @@ -18,6 +25,10 @@ updates:

- package-ecosystem: "pip"
directory: "/"
groups:
python-dependencies:
patterns:
- "*"
schedule:
interval: "weekly"
day: "friday"
Expand Down
32 changes: 32 additions & 0 deletions .github/matchers/pylint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"problemMatcher": [
{
"severity": "warning",
"pattern": [
{
"regexp": "^([^:]+):(\\d+):(\\d+): ([A-DF-Z]\\d+): \\033\\[[\\d;]+m([^\\033]+).*$",
"file": 1,
"line": 2,
"column": 3,
"code": 4,
"message": 5
}
],
"owner": "pylint-warning"
},
{
"severity": "error",
"pattern": [
{
"regexp": "^([^:]+):(\\d+):(\\d+): (E\\d+): \\033\\[[\\d;]+m([^\\033]+).*$",
"file": 1,
"line": 2,
"column": 3,
"code": 4,
"message": 5
}
],
"owner": "pylint-error"
}
]
}
27 changes: 27 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CD
on:
release:
types: [published]
workflow_dispatch:

jobs:
python-packaging:
name: 🐍 Packaging
uses: cda-tum/mqt-core/.github/workflows/reusable-python-packaging.yml@main

deploy:
if: github.event_name == 'release' && github.event.action == 'published'
name: 🚀 Deploy to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/mqt.qcec
permissions:
id-token: write
needs: [python-packaging]
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
Loading