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 #283

Merged
merged 50 commits into from
Aug 28, 2023
Merged

♻️ Refactor Packaging and CI #283

merged 50 commits into from
Aug 28, 2023

Conversation

burgholzer
Copy link
Member

@burgholzer burgholzer commented Aug 27, 2023

Description

This PR brings a major refactoring for the overall Python packaging as well as 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

  • truly editable installs that also include the C++ part; this implies incredibly fast rebuilds that can be further improved by installing ccache.
  • completely eliminates the setup.py (and the MANIFEST.in) file and all custom build code that was required previously.

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

MQT Core has introduced reusable workflows in

These have been further refined in

Overall, this allows to

  • remove almost all workflow files of this repository
  • eliminate a lot of maintenance required in this repository to keep up with the latest best practices
  • rely on dependabot for workflow updates once MQT Core has settled enough so that it follows proper versioning and we can use tags for the workflows here instead of @main

while at the same time:

  • having automatic change detection and only triggering jobs that are really necessary; with a single pass check that can be used for branch protection
  • setting up ccache for all supported workflow jobs which greatly improves compilation times
  • setting up mold as a better linker under linux
  • splitting jobs into as many subjobs as possible and feasible to distribute work
  • automatically creating wheels for all supported platforms (including exotic platforms that need emulation) and Python versions using PyPI trusted publishing
  • enabling automatic retries for flaky jobs such as MSVC builds or coverage uploads
  • enabling automatic build parallelization via using Ninja wherever suitable
  • running an automatic workflow using the minimal versiosn for all Python dependencies to guarantee compatibility

As a nice side effect, the new CI has unveiled several issues in the HSF simulator and it's task logic that have subsequently been resolved. Upon writing regression tests, an endianness bug in the Amplitude Mode HSF simulation surfaced. With this PR, the expected results are returned.

Checklist:

  • The pull request only contains commits that are related to it.
  • I have added appropriate tests and documentation.
  • I have made sure that all CI jobs on GitHub pass.
  • The pull request introduces no new warnings and follows the project's style guidelines.

Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
@burgholzer burgholzer added documentation Improvements or additions to documentation enhancement Anything related to improvements of the existing library dependencies Pull requests that update a dependency file labels Aug 27, 2023
@burgholzer burgholzer self-assigned this Aug 27, 2023
@burgholzer burgholzer added the usability Anything related to usability label Aug 27, 2023
@codecov
Copy link

codecov bot commented Aug 27, 2023

Codecov Report

Merging #283 (3121f99) into main (c6f95af) will decrease coverage by 3.2%.
The diff coverage is 97.2%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #283     +/-   ##
=======================================
- Coverage   95.0%   91.9%   -3.2%     
=======================================
  Files         20      31     +11     
  Lines       1951    2476    +525     
  Branches     348     352      +4     
=======================================
+ Hits        1854    2276    +422     
- Misses        97     200    +103     
Flag Coverage Δ
cpp 94.9% <97.2%> (?)
python 79.9% <97.1%> (?)
Files Changed Coverage Δ
src/PathSimulator.cpp 89.0% <ø> (ø)
src/mqt/ddsim/error.py 80.0% <ø> (ø)
src/mqt/ddsim/job.py 68.8% <50.0%> (ø)
src/HybridSchrodingerFeynmanSimulator.cpp 97.2% <97.0%> (-0.2%) ⬇️
include/Simulator.hpp 94.5% <100.0%> (ø)
src/StochasticNoiseSimulator.cpp 95.5% <100.0%> (ø)
src/mqt/ddsim/__init__.py 100.0% <100.0%> (ø)
src/mqt/ddsim/hybridqasmsimulator.py 88.2% <100.0%> (ø)
src/mqt/ddsim/hybridstatevectorsimulator.py 100.0% <100.0%> (ø)
src/mqt/ddsim/pathqasmsimulator.py 57.1% <100.0%> (ø)
... and 5 more

... and 3 files with indirect coverage changes

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
…ot a power of two

Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
…hunk size

Signed-off-by: burgholzer <burgholzer@me.com>
Most parts inherently relied on the number of threads and/or the number of slices per core to be a power of two.
This commit completely revamps the task handling to drop these assumptions.
It also makes sure to clean up all produced files.

Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
@github-actions
Copy link
Contributor

Cpp-Linter Report ✔️

No problems need attention.

Have any feedback or feature suggestions? Share it here.

@burgholzer burgholzer merged commit 7eba9e8 into main Aug 28, 2023
34 checks passed
@burgholzer burgholzer deleted the refactor-ci-and-packaging branch August 28, 2023 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
continuous integration Anything related to the CI setup dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation enhancement Anything related to improvements of the existing library github_actions Pull requests that update GitHub Actions code minor Part of a minor release packaging Anything related to Python packaging python Pull requests that update Python code submodules Pull requests that update Submodules code usability Anything related to usability
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant