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

Cannot a #[pymodule] function as doc(hidden) since 0.14 #1720

Closed
adamreichold opened this issue Jul 8, 2021 · 3 comments · Fixed by #1722
Closed

Cannot a #[pymodule] function as doc(hidden) since 0.14 #1720

adamreichold opened this issue Jul 8, 2021 · 3 comments · Fixed by #1722

Comments

@adamreichold
Copy link
Member

adamreichold commented Jul 8, 2021

We basically use the following entry point for a Python extension

use pyo3::prelude::*;

#[doc(hidden)]
#[pymodule]
#[pyo3(name = "foobar")]
fn init(_py: Python, _m: &PyModule) -> PyResult<()> {
    Ok(())
}

but this fails to compile after upgrading to version 0.14 with the following error

error: invalid doc comment
 --> src/lib.rs:3:1
  |
3 | #[doc(hidden)]
  | ^^^^^^^^^^^^^^

(We use --document-private-items as we use the doc comments to explain the implementations details of this project and hence like to explicitly hide any boiler plate like these module initialisation functions.)

@davidhewitt
Copy link
Member

Thanks for the report! I agree this is a regression, and have opened #1722 to fix.

Appreciate this is an upgrade blocker for you, however I'll give this a bit of time to sit on main before releasing so that other fixes (if needed) have time to collect.

@adamreichold
Copy link
Member Author

adamreichold commented Jul 9, 2021

Appreciate this is an upgrade blocker for you, however I'll give this a bit of time to sit on main before releasing so that other fixes (if needed) have time to collect.

Thank you for the quick response and resolution! I did not want to convey a sense of urgency and I am sorry if I did. (Upgrading our simulation is actually blocked on a new release of rust-numpy on crates.io that is compatible with version 0.14. But then again, we face no functional issues with version 0.13 and just try to keep up with the ecosystem.)

@davidhewitt
Copy link
Member

Not at all, it was just an easy bugfix so I thought I'd kill it off quickly. Also I'm enthusiastic to help everyone upgrade as fast as possible 😂

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 a pull request may close this issue.

2 participants