-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
When cargo building pyo3 projects auto-add in the extension-module feature please #325
Comments
I think that's a very good idea! |
Blocked on PyO3/pyo3#1040 being resolved. |
After #605 lands, you can add the Edit: if you are using maturin 0.13.0 and later, [tool.maturin]
features = ["pyo3/extension-module"] |
I believe |
Reading between the lines here, I think this issue closing means we could take an update to getting_started.md's examples and maybe to the FAQ to allow folks to run I'm willing to do that, would like to confirm what's desired. I think what we want is the example [tool.maturin]
features = ["pyo3/extension-module"] while the example [dependencies]
pyo3 = "0.18.0" (Or I could be convinced to make that |
I could also be convinced that the recommended set up would be better as the mixed Python and Rust code per the maturin guide. I could be convinced since being able to write Python tests out of the box make it easier to ensure the Python API is ergonomic, while allowing |
You can generate a mixed Python/Rust project with |
Pull requests are welcome, I think we can also update the maturin/src/templates/Cargo.toml.j2 Lines 14 to 15 in 46f4b1a
|
1479: Enable `extension-module` feature in `pyproject.toml` in project templates r=konstin a=messense Implements #325 (comment). Thanks for the idea `@jmhodges!` Co-authored-by: messense <messense@icloud.com>
1479: Enable `extension-module` feature in `pyproject.toml` in project templates r=konstin a=messense Implements #325 (comment). Thanks for the idea `@jmhodges!` Co-authored-by: messense <messense@icloud.com>
At the moment maturin warns if a pyo3 project is built without the extension-module feature.
We can already do:
maturin develop --cargo-extra-args="--features pyo3/extension-module"
Why not add that flag in automatically if it's clear that it's not there? Having pyo3/extension-module turned on as a default feature seems like a footgun as people will just run cargo test and expect stuff to work on cli, IDEs etc. but will run into linking problems if they don't use --no-default-features. It's both unergonomic and confusing as the linker errors give no clue that you should have disabled a feature so it's tough on new users.
It would be great if maturin just by default did the right thing :-) -
(it could still squark that it wasn't found so adding it in explicitly.)
thoughs?
The text was updated successfully, but these errors were encountered: