You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
This PR set up all the infrastructure for developing a modern `mqt.core`
Python package.
Instead of relying on `pybind11` and `setuptools` it uses
[scikit-build-core](https://github.com/scikit-build/scikit-build-core)
and [nanobind](https://github.com/wjakob/nanobind) to create a C++
extension module and package everything as a complete Python package.
This is a substantial improvement over all previous efforts that relied
on setuptools. For example, the new setup allows for fast, editable
installs where the Python package is automatically rebuilt on C++ source
code changes.
Furthermore, `nanobind` is directly included as a build time dependency
and need not be included as a git submodule.
Finally, all the nasty configuration from the `setup.py` file could be
removed. In fact, there no longer is a `setup.py` file at all.
As for `nanobind` over `pybind11`: (from
https://github.com/wjakob/nanobind)
> nanobind is a small binding library that exposes C++ types in Python
and vice versa. It is reminiscent of
[Boost.Python](https://www.boost.org/doc/libs/1_64_0/libs/python/doc/html)
and [pybind11](https://github.com/pybind/pybind11) and uses
near-identical syntax. In contrast to these existing tools, nanobind is
more efficient: bindings compile in a shorter amount of time, produce
smaller binaries, and have better runtime performance.
>
> More concretely,
[benchmarks](https://nanobind.readthedocs.io/en/latest/benchmark.html)
show up to ~4× faster compile time, ~5× smaller binaries, and ~10× lower
runtime overheads compared to pybind11. nanobind also outperforms Cython
in important metrics (3-12× binary size reduction, 1.6-4× compilation
time reduction, similar runtime performance).
Another nice feature available after this PR is the addition of CI check
gates, that is, a check that makes sure that all checks it depends on
have succeeded. This significantly simplifies branch protection rules as
there are only very few checks that actually need protection and the
rules need not be updated whenever, e.g., a new matrix entry gets added
to the CI config.
> **Note**
> The Python package itself is extremely limited at the moment and does
not expose any useful functionality. That will be added in a subsequent
PR.
## 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.
0 commit comments