PyO3 / maturin

Build and publish crates with pyo3, cffi and uniffi bindings as well as rust binaries as python packages
https://maturin.rs
Apache License 2.0
3.96k stars 275 forks source link

Function calls in Pyxel fail when using Maturin 1.7.1 or later #2290

Open kitao opened 2 weeks ago

kitao commented 2 weeks ago

Bug Description

Hi. I tried compiling Pyxel with Maturin 1.7.1+.

I changed an option in Pyxel's makefile from --skip-auditwheel to --auditwheel skip and then the compilation finished. But when run an application, the following error occurs:

    pyxel.init(300, 300, title="hoge")
    ^^^^^^^^^^
AttributeError: module 'pyxel' has no attribute 'init'

Maturin is called from Pyxel's makefile. https://github.com/kitao/pyxel/blob/main/Makefile#L102

The directory structure of Pyxel may no longer work correctly with Maturin 1.7.1 or later. https://github.com/kitao/pyxel/blob/main/python/pyproject.toml#L35-L38

https://github.com/kitao/pyxel/issues/574

Your maturin version (maturin --version)

1.7.0 → 1.7.0+

Your Python version (python -V)

Python 3.12.3

Your pip version (pip -V)

pip 24.2

What bindings you're using

pyo3

Does cargo build work?

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

Steps to Reproduce

Just build Pyxel and use it.