Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix __init__ exports when using multiple UniFFI bindings #2305

Merged
merged 3 commits into from
Nov 24, 2024

Conversation

Nickersoft
Copy link
Contributor

This PR is a continuation of the work started in #1910 and #2208 that updates the generated __init__.py to export from all Python files and not just the one it assumes has been created for the local project.

Closes #2294.

There is one remaining concern I have, and that is around dylib files. I believe each crate that uses a UniFFI may try to reference its own dylib file, but only a single dylib will exist in Maturin's build directory. So I'm still not sure the expected strategy here or how that should be managed for multi-crate projects.

@Nickersoft Nickersoft changed the title Fix __init__ exports when using multiple UniFFI bindings Fix __init__ exports when using multiple UniFFI bindings Nov 16, 2024
@Nickersoft
Copy link
Contributor Author

Strange that these tests are failing – they all pass locally for me when running cargo test. Does anyone have an idea as to why?

@messense
Copy link
Member

@Nickersoft You need to have uniffi-bindgen in PATH, otherwise it will skip running related tests.

@Nickersoft
Copy link
Contributor Author

Thanks @messense! I got a lot more tests to pass now. There are still some Windows failures though, as it can't find a Python interpreter for some reason. Any idea why? Didn't think I changed anything that would affect it.

@messense
Copy link
Member

Don't worry about it, it's an existing issue.

Copy link
Member

@messense messense left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@messense messense merged commit ceaefd5 into PyO3:main Nov 24, 2024
32 of 34 checks passed
@messense
Copy link
Member

There is one remaining concern I have, and that is around dylib files. I believe each crate that uses a UniFFI may try to reference its own dylib file, but only a single dylib will exist in Maturin's build directory. So I'm still not sure the expected strategy here or how that should be managed for multi-crate projects.

Can you open an issue with a repro to track this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid exports in __init__.py when UniFFI project doesn't include .udl files
2 participants