-
Notifications
You must be signed in to change notification settings - Fork 762
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
Complete abi3 support #1152
Complete abi3 support #1152
Conversation
Use PyType_Spec for creating new types in Rust
Now the command for testing abi3 features is |
The changes you have here look good to me, once CI is passing of course :-) I think there's still a handful of fixes needed, but we're close! |
Cargo.toml
Outdated
macros = ["ctor", "indoc", "inventory", "paste", "pyo3cls", "unindent"] | ||
# Enable the use of `not(Py_LIMITED_API)` s. | ||
# This is incompatible with abi3(PEP384). See https://www.python.org/dev/peps/pep-0384/ more. | ||
all-apis = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer the (c)python terminology of "stable abi"/"limited api"/"abi3" or an inverted term such as "unstable abi" or "unlimited api".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I choose unstable-api
This looks great, thanks to both of you for implementing this! I'll update maturin to support building abi3 packages, and have two questions regarding coordination. I'd like to automatically detect whether the project only needs a single As far as I've understood, abi3 grows with each python version, so imho it would be a good idea if we had some way of communicating the lowest supported python version. This ensures that users don't accidentally rely on features that are only in more recent versions. Imho it would be ideal if pyo3 could set the python version cfg flags based on that version, so maturin can directly build |
Looks I accidentally removed
Thanks, do you know some good documents for that? Or do we need to check each version precisely? |
bcceb24
to
8624306
Compare
@kngwyu do you want this to merge for the 0.12 release? I think that 0.12 is now amost ready, with all docs waiting in PRs. So I'd like to release 0.12 this week. I'm a little wary of merging this just before 0.12 releases, because the move to heap types seems like it can change runtime behaviour in ways that we might not discover immediately. So I vote we release 0.12 asap, and then merge this so that we can have some time to gain confidence while we work towards 0.13. |
I've tested this branch with one of my projects and it works, however I'm now getting |
There are some remaining problems and I don't think we can address all these problems immediately. |
Fixed a few compilation errors on the abi3 branch
Properly mark a function as limited API only
Complete the process of disabling buffers with Py_LIMITED_API
I think this might technically be backwards incompatible if you had a custom metaclass with fancy behavior, but pyo3 doesn't seem to have any native support for those.
Fill tp_dict on types in an abi3-friendly way
The implementation is more complex, because there's no equivalent to tp_name in the limited API
Make PyType::name abi3 compatible
Improved documentation for abi3
Assorted updates to the abi3 branch from review
merge master into abi3 branch to resolve conflicts
:flips table: another merge conflict, this time in CHANGELOG. I'm happy to keep resolving these as they come up in PRs -- but let me know if that's not how y'all would prefer to handle this.(It's my hope that we're close to merge ready, and keeping it conflict free will help.) |
😬 sorry - hopefully now that Alternatively don't worry about fixing CHANGELOG conflicts for the moment? We can tidy that up just before merge. |
If that's your preference, it's fine by me.
…On Mon, Oct 12, 2020 at 7:23 PM David Hewitt ***@***.***> wrote:
😬 sorry - hopefully now that 0.12.3 is released and I'm going to let
changes stack up for 0.13 the CHANGELOG conflicts might settle down.
Alternatively don't worry about fixing CHANGELOG conflicts for the moment?
We can tidy that up just before merge.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1152 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAGBDFPEKAGRJ5EUFJBQLSKOFWPANCNFSM4Q3DDTMQ>
.
--
All that is necessary for evil to succeed is for good people to do nothing.
|
Merge master into abi3 branch, resolving conflicts
Renew #[pyproto] implementation for abi3 branch
I think we can merge this after adding some notes about abi3 support of maturin in the guide. |
I don't know anything about maturin, so I can't really help there. Are you able to do that? |
It is already done by @konstin so what we need is just to note the minimum required version (and confirm it is correct). |
|
||
By default, Python extension modules can only be used with the same Python version they were compiled against -- if you build an extension module with Python 3.5, you can't import it using Python 3.8. [PEP 384](https://www.python.org/dev/peps/pep-0384/) introduced the idea of the limited Python API, which would have a stable ABI enabling extension modules built with it to be used against multiple Python versions. This is also known as `abi3`. | ||
|
||
Note that [maturin] >= 0.9.0 or [setuptools-rust] >= 0.12.0 is going to support `abi3` wheels. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@konstin
Is it OK to say this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@alex |
Thank you for all your help getting this merged. This is very exciting! |
For #1125.
Continuation of #1132.
What I did so far are
all-apis
but feel free to propose alternative.unstable-api
adviced by konstin.cfg
.TODO:
tp_dict
initialization codes (=classattr
). It should be changed a lot.__text__signature__
.unstable-api
feature.... and so on.
Sorry @alex for the conflict. I'm going to work on
tp_dict
problem for now and contributions for other areas are welcome.