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

Allow building mixed projects with __init__.pyi file #473

Closed
wants to merge 1 commit into from
Closed

Allow building mixed projects with __init__.pyi file #473

wants to merge 1 commit into from

Conversation

vinhowe
Copy link

@vinhowe vinhowe commented Mar 17, 2021

This makes it possible to hand author a pyi stub file for the root module until we have something like PyO3/pyo3#510.

@vinhowe vinhowe marked this pull request as draft March 18, 2021 05:53
@vinhowe
Copy link
Author

vinhowe commented Mar 18, 2021

This doesn't seem to work like I hoped. I'll have to figure out what's actually going on.

@vinhowe vinhowe closed this Mar 18, 2021
@vinhowe
Copy link
Author

vinhowe commented Mar 18, 2021

To anyone trying to do this, it looks like you need an __init__.py file after all. The .so file that Maturin puts in the directory next to it is just treated by Python as a submodule, so none of its members are available from the root module, obviously, unless you import them.

So __init__.py just looks like this:

from .package_name import *

@vinhowe vinhowe deleted the mixed-with-pyi branch April 15, 2021 08:27
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.

1 participant