PyO3 / pyo3

Rust bindings for the Python interpreter
https://pyo3.rs
Apache License 2.0
12.06k stars 744 forks source link

Rework pyo3 features to make unlimited api opt-in #4241

Open LilyFoote opened 3 months ago

LilyFoote commented 3 months ago

For #2865.

LilyFoote commented 3 months ago

@davidhewitt I meant to push this up a while ago, but life got in the way. I'm hoping this is on the right track, but I did find it difficult to be sure my changes were correct - I think a mistake here just leads to testing the wrong combination of features that still passes rather than helpful test failures.

davidhewitt commented 3 months ago

Yes, especially with https://github.com/PyO3/pyo3/issues/2865#issuecomment-2117294485 I think it makes it tricky to control what's actually being built.

Is this ready for review?

LilyFoote commented 3 months ago

Yeah, a review would be helpful. I'll also rebase later today.

davidhewitt commented 3 months ago

👍 will do my best to find a moment to review at earliest opportunity.

davidhewitt commented 2 months ago

Changes to a extension-module seem suitable for a separate PR. And possibly a first step for this PR would be to add the new feature and the compile error, and not worry about removing existing stuff yet.

davidhewitt commented 1 month ago

@LilyFoote I pushed to this branch a bit of an experiment of "what happens" if we try to make the unlimited-api feature actually gate functionality, while still using the unlimited FFI symbols for optimizations unless the abi3 feature is enabled. Probably needs some further refinement. I thought it might prompt some discussion if it feels like the right approach.

LilyFoote commented 1 month ago

Thanks! I've been meaning to make progress with this, but life has been getting in the way.