qir-alliance / pyqir

PyQIR is a set of APIs for generating, parsing, and evaluating Quantum Intermediate Representation (QIR).
https://qir-alliance.github.io/pyqir
MIT License
54 stars 24 forks source link

Fix build on maturin 0.15.2 and above #241

Closed evilmav closed 11 months ago

evilmav commented 1 year ago

Describe the bug

Maturin build fails starting with 0.15.x with

Warning: Couldn't find the symbol `PyInit_pyqir` in the native library. Python will fail to import this module. If you're using pyo3, check that `#[pymodule]` uses `pyqir` as module name

and failure to import the pyqir._native module at runtime. The behavior might be related to the change in 0.15.2: https://github.com/PyO3/maturin/pull/1608

To Reproduce

Steps to reproduce the behavior:

  1. Install a recent maturin version
  2. cd into pyqir/
  3. Run maturin build --release -F llvm14-0
  4. See warning

Expected behavior

The warning should not happen. The resulting module should be importable.

System information