Invalid exports in __init__.py
when UniFFI project doesn't include .udl files
#2294
Closed
1 of 2 tasks
Labels
bug
Something isn't working
Bug Description
Hey folks,
This issue I believe is related to unresolved issue I voiced awhile back as well as the multi-crate features added in #2208.
I currently have a Python project I'm hoping can leverage an external crate's UniFFI .udl to export Python bindings for the crate. Right now I just have the external crate added as a dependency and have the following in my
lib.rs
:Running
maturin develop
, the following files get generated:__init__.py
libuniffi_pyodict.dylib
odict.py
Inside
__init__.py
, it attempts to export from a nonexistent module:Similarly,
odict.py
attempts to read fromlibpyodict.dylib
, which doesn't exist unless I manually override the cdylib name to bepyodict
, but that could be a separate issue.I looked at the source code and saw this
__init__.py
seems to be hardcoded to use the current project's name. I think this could be fixed by #1910, as it includes a change to init.py that isn't present in #2208. Clarity on the cdylib issue would also be appreciated!Your maturin version (
maturin --version
)1.7.4
Your Python version (
python -V
)3.13.0
Your pip version (
pip -V
)24.3.1
What bindings you're using
uniffi
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
Described above
The text was updated successfully, but these errors were encountered: