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

Re-export __all__ in __init__.py for pure Rust project #886

Merged
merged 4 commits into from
Apr 29, 2022

Conversation

mhils
Copy link
Contributor

@mhils mhils commented Apr 29, 2022

maturin already re-exports __doc__, but __all__ is also useful to be reexported. There are a bunch of Python documentation generators which make use of this. In our case (I work on pdoc), re-exporting __all__ means we correctly detect that it's my_project and not my_project.my_project. 😃

On that note, thank you folks for the fantastic work you are doing with PyO3/maturin! 🍰
We're working on some Rust extensions for @mitmproxy and PyO3 has just been super wonderful. ❤️

This is useful for Python documentation generators which inspect `__all__`.
For example, pdoc then correctly displays `module_name` instead of `module_name.module_name`
@netlify
Copy link

netlify bot commented Apr 29, 2022

Deploy Preview for maturin-guide ready!

Name Link
🔨 Latest commit 86a6588
🔍 Latest deploy log https://app.netlify.com/sites/maturin-guide/deploys/626bd6696d914b000942c726
😎 Deploy Preview https://deploy-preview-886--maturin-guide.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@mhils mhils force-pushed the reexport-all branch 2 times, most recently from 5173a30 to 72d8fad Compare April 29, 2022 11:25
src/module_writer.rs Outdated Show resolved Hide resolved
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.

Looks good to me, could you please add a changelog entry, thanks!

@mhils
Copy link
Contributor Author

mhils commented Apr 29, 2022

Done, thank you for the super quick review! 🍰

@messense messense enabled auto-merge April 29, 2022 12:14
@messense messense merged commit 4a18862 into PyO3:main Apr 29, 2022
@mhils mhils deleted the reexport-all branch April 29, 2022 12:46
@messense
Copy link
Member

messense commented May 7, 2022

Released in v0.12.15, should be out soon: https://github.com/PyO3/maturin/actions/runs/2285132178

@mhils
Copy link
Contributor Author

mhils commented May 7, 2022

Awesome, thanks! 🍰 😃

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.

2 participants