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

✨ ship shared C++ libraries with mqt-core Python package #662

Merged
merged 9 commits into from
Jan 14, 2025

Conversation

burgholzer
Copy link
Member

@burgholzer burgholzer commented Aug 6, 2024

Description

This PR adapts the mqt.core Python package to also ship the complete MQT Core C++ library in a compact form so that the Python package can be used as the single source for the C++ and the Python side in top-level projects.
In turn, the mqt-core-python target is (finally) removed, which was long overdue.
Top-level projects are now expected to rely on the mqt-core Python package for importing circuits from Qiskit.

To minimise the growth of the mqt-core Python wheels, Python package build will now build shared libraries as opposed to static libraries. The resulting wheels now have a couple megabytes, which should still be reasonable.
However, to minimise the risk of running into space issues on PyPI further, this PR stops building emulated wheels for the mqt-core Python package. We have no real signs that people are using them in any meaningful way and they take forever to build. Hence, removing them seams like a win-win.

Given the potential breaking nature of the discontinuation of the mqt-core-python target, the next release after this release is merged will be v3.0. I'd expect a couple more breaking changes to come in over the next couple of weeks before that release though.

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.

@burgholzer burgholzer added usability Anything related to usability feature New feature or request minor Minor version update Core Anything related to the Core library and IR c++ Anything related to C++ code python Anything related to Python code packaging Anything related to Python packaging labels Aug 6, 2024
@burgholzer burgholzer added this to the MQT Core milestone Aug 6, 2024
@burgholzer burgholzer self-assigned this Aug 6, 2024
@burgholzer burgholzer mentioned this pull request Aug 6, 2024
4 tasks
Copy link

codecov bot commented Aug 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.0%. Comparing base (fe97778) to head (fdb61f0).
Report is 10 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #662   +/-   ##
=====================================
  Coverage   92.0%   92.0%           
=====================================
  Files        123     125    +2     
  Lines      13776   13828   +52     
  Branches    2153    2153           
=====================================
+ Hits       12684   12735   +51     
- Misses      1092    1093    +1     
Flag Coverage Δ
cpp 91.8% <ø> (-0.1%) ⬇️
python 99.7% <100.0%> (+<0.1%) ⬆️
Files with missing lines Coverage Δ
include/mqt-core/dd/RealNumber.hpp 100.0% <ø> (ø)
src/mqt/core/__init__.py 100.0% <100.0%> (ø)
src/mqt/core/__main__.py 100.0% <100.0%> (ø)
src/mqt/core/_commands.py 100.0% <100.0%> (ø)

... and 1 file with indirect coverage changes

@burgholzer burgholzer force-pushed the shared-libs branch 2 times, most recently from a932c19 to 5382514 Compare August 9, 2024 10:25
@burgholzer burgholzer force-pushed the shared-libs branch 5 times, most recently from 1e105c6 to 34c57c6 Compare August 11, 2024 10:56
burgholzer added a commit that referenced this pull request Aug 13, 2024
## Description

This PR pulls out a couple of changes from #662 that can go into the
library immediately, while that PR is still in draft.
Mostly fixes a couple of linter/compiler warnings and improves the
handling of Boost / boost_multiprecision.

## Checklist:

<!---
This checklist serves as a reminder of a couple of things that ensure
your pull request will be merged swiftly.
-->

- [x] The pull request only contains commits that are related to it.
- [x] I have added appropriate tests and documentation.
- [x] I have made sure that all CI jobs on GitHub pass.
- [x] The pull request introduces no new warnings and follows the
project's style guidelines.
src/mqt/core/__init__.py Fixed Show fixed Hide fixed
@burgholzer burgholzer force-pushed the shared-libs branch 3 times, most recently from 26df787 to b15a4ac Compare September 5, 2024 18:52
@burgholzer burgholzer added major Major version update and removed minor Minor version update labels Sep 6, 2024
burgholzer added a commit that referenced this pull request Sep 28, 2024
## Description

This PR updates the CD workflow so that anytime it runs on a push to
`main`, it uploads the resulting package to Test PyPI. This allows to
battle test the packages before official releases.
This will be especially important in the context of #662.

## Checklist:

<!---
This checklist serves as a reminder of a couple of things that ensure
your pull request will be merged swiftly.
-->

- [x] The pull request only contains commits that are related to it.
- [x] I have added appropriate tests and documentation.
- [x] I have made sure that all CI jobs on GitHub pass.
- [x] The pull request introduces no new warnings and follows the
project's style guidelines.
@burgholzer burgholzer force-pushed the shared-libs branch 3 times, most recently from 654e252 to 0450f25 Compare September 29, 2024 15:12
@burgholzer burgholzer force-pushed the shared-libs branch 4 times, most recently from f5e6793 to ac3a3dc Compare January 12, 2025 19:04
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
🚨 ignore check-wheel-contents warnings

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>
additionally ignore DLLs in wheels for delvewheel repair. Delvewheel cannot find these by default and would error if this was not set.

Signed-off-by: Lukas Burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: Lukas Burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
This is mostly to avoid PyPI space limitations as we typically support all non-EOL Python versions (5) and a total of three emulated platforms.
This adds 15 wheels to each release on PyPI, which amounts to over 42% of all wheels (15/35).
It also considerably adds to the overall build time.

Signed-off-by: burgholzer <burgholzer@me.com>
@burgholzer burgholzer marked this pull request as ready for review January 14, 2025 21:02
@burgholzer burgholzer merged commit ce5f0ae into main Jan 14, 2025
36 checks passed
@burgholzer burgholzer deleted the shared-libs branch January 14, 2025 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Anything related to C++ code Core Anything related to the Core library and IR feature New feature or request major Major version update packaging Anything related to Python packaging python Anything related to Python code usability Anything related to usability
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant