cda-tum / mqt-qecc

MQT QECC - Tools for Quantum Error Correcting Codes
MIT License
102 stars 14 forks source link

♻️ Refactor Packaging and part of CI #171

Closed burgholzer closed 1 year ago

burgholzer commented 1 year ago

Description

This PR brings a major refactoring for the overall Python packaging as well as parts of the CI employed in the project.

Packaging

We are (finally) moving away from setuptools and towards modern scikit-build-core (https://scikit-build-core.readthedocs.io/) This brings many advantages such as

As part of this change, we adopt the established best practice of a src-layout for the Python package. This implies that the Python package no longer lives in the main package directory, but is moved to src/mqt/.... This avoids several pitfalls when working with Python packages and makes the overall handling way easier.

This also means there is no direct build-time dependency on cmake and ninja anymore as this is automatically handled by scikit-build-core on demand.

As part of this rewrite, several nox sessions are also updated.

CI

Parts of the CI have been modernized with the latest best practises. Unfortunately, we cannot yet adopt the reusable workflows from mqt-core due to the flint dependency in this project. This will come as a follow-up

Checklist:

codecov[bot] commented 1 year ago

Codecov Report

Merging #171 (b410a9c) into main (4ddca85) will increase coverage by 0.0%. The diff coverage is 100.0%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/cda-tum/mqt-qecc/pull/171/graphs/tree.svg?width=650&height=150&src=pr&token=OAw9kgumkt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum)](https://app.codecov.io/gh/cda-tum/mqt-qecc/pull/171?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) ```diff @@ Coverage Diff @@ ## main #171 +/- ## ===================================== Coverage 85.6% 85.6% ===================================== Files 20 20 Lines 1362 1367 +5 Branches 190 190 ===================================== + Hits 1166 1171 +5 Misses 196 196 ``` | [Flag](https://app.codecov.io/gh/cda-tum/mqt-qecc/pull/171/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | Coverage Δ | | |---|---|---| | [cpp](https://app.codecov.io/gh/cda-tum/mqt-qecc/pull/171/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | `79.5% <ø> (ø)` | | | [python](https://app.codecov.io/gh/cda-tum/mqt-qecc/pull/171/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | `97.2% <100.0%> (+<0.1%)` | :arrow_up: | | [Files](https://app.codecov.io/gh/cda-tum/mqt-qecc/pull/171?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | Coverage Δ | | |---|---|---| | [src/mqt/qecc/\_\_init\_\_.py](https://app.codecov.io/gh/cda-tum/mqt-qecc/pull/171?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xZWNjL19faW5pdF9fLnB5) | `100.0% <100.0%> (ø)` | | | [src/mqt/qecc/cc\_decoder/\_\_init\_\_.py](https://app.codecov.io/gh/cda-tum/mqt-qecc/pull/171?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xZWNjL2NjX2RlY29kZXIvX19pbml0X18ucHk=) | `84.6% <100.0%> (ø)` | | | [src/mqt/qecc/cc\_decoder/cli.py](https://app.codecov.io/gh/cda-tum/mqt-qecc/pull/171?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xZWNjL2NjX2RlY29kZXIvY2xpLnB5) | `89.4% <100.0%> (ø)` | | | [src/mqt/qecc/cc\_decoder/color\_code.py](https://app.codecov.io/gh/cda-tum/mqt-qecc/pull/171?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xZWNjL2NjX2RlY29kZXIvY29sb3JfY29kZS5weQ==) | `94.8% <ø> (ø)` | | | [src/mqt/qecc/cc\_decoder/comparison/tn\_decoder.py](https://app.codecov.io/gh/cda-tum/mqt-qecc/pull/171?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xZWNjL2NjX2RlY29kZXIvY29tcGFyaXNvbi90bl9kZWNvZGVyLnB5) | `100.0% <100.0%> (ø)` | | | [src/mqt/qecc/cc\_decoder/decoder.py](https://app.codecov.io/gh/cda-tum/mqt-qecc/pull/171?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xZWNjL2NjX2RlY29kZXIvZGVjb2Rlci5weQ==) | `98.2% <100.0%> (ø)` | | | [src/mqt/qecc/cc\_decoder/hexagonal\_color\_code.py](https://app.codecov.io/gh/cda-tum/mqt-qecc/pull/171?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xZWNjL2NjX2RlY29kZXIvaGV4YWdvbmFsX2NvbG9yX2NvZGUucHk=) | `100.0% <100.0%> (ø)` | | | [...c/mqt/qecc/cc\_decoder/square\_octagon\_color\_code.py](https://app.codecov.io/gh/cda-tum/mqt-qecc/pull/171?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xZWNjL2NjX2RlY29kZXIvc3F1YXJlX29jdGFnb25fY29sb3JfY29kZS5weQ==) | `97.2% <100.0%> (ø)` | | | [src/mqt/qecc/ecc\_qiskit\_wrapper.py](https://app.codecov.io/gh/cda-tum/mqt-qecc/pull/171?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xZWNjL2VjY19xaXNraXRfd3JhcHBlci5weQ==) | `97.8% <100.0%> (ø)` | |