Skip to content

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

Merged
burgholzer merged 9 commits into
mainfrom
shared-libs
Jan 14, 2025
Merged

✨ ship shared C++ libraries with mqt-core Python package#662
burgholzer merged 9 commits into
mainfrom
shared-libs

Conversation

@burgholzer

@burgholzer burgholzer commented Aug 6, 2024

Copy link
Copy Markdown
Member

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
@codecov

codecov Bot commented Aug 6, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@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.
Comment thread src/mqt/core/__init__.py 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
@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

None yet

Development

Successfully merging this pull request may close these issues.

2 participants