-
-
Notifications
You must be signed in to change notification settings - Fork 13
FEAT: add support for automatic abi3 version selection #132
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
base: main
Are you sure you want to change the base?
FEAT: add support for automatic abi3 version selection #132
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #132 +/- ##
===========================================
+ Coverage 58.31% 74.61% +16.30%
===========================================
Files 4 4
Lines 379 386 +7
===========================================
+ Hits 221 288 +67
+ Misses 158 98 -60 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bd0bcf1 to
34cd182
Compare
|
I'm not super keen on having an auto mode because it's usually good to be specific about whether one expects abi3 wheels or not, otherwise a package could silently start switching to non-abi3 wheels due to some issue with the interpreter or runtime_introspect. However if others are keen on this I think we should make |
Fair point. It should be easy enough to distinguish two auto modes actually:
Would that work better for you ? |
|
Also, if PEP 809, or something similar, gets accepted, we could be facing the need to build more than one limited-api wheel per package as soon as next year. In which case, hard coding the target version, as is the only supported option now, would force users to build (temporary) additional logic to work around it. |
1 similar comment
This comment has been minimized.
This comment has been minimized.
34cd182 to
7dd3d6d
Compare
| if py_limited_api is not None: | ||
| if py_limited_api == "auto": | ||
| fs = runtime_feature_set() | ||
| if fs.supports("py-limited-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.
btw, in case it helps, there is now a semantic distinction between the two possible falsy outputs:
Falsemeans that we know for sure the Limited API is not supported (you'd get this with CPython 3.13t or 3.14t)Nonemeans "not sure", and basically indicates that it's time to patch and upgraderuntime-introspect
meanwhile, True is only ever returned in case support is established with certainty (that's the intended behavior any way). I'm being extremely thorough in my testing approach for this library, so I feel I can confidently say that, while false negatives are possible (but should be reported and fixed), false positives should never happen.
This is at a proof-of-concept stage: I haven't bothered writing tests for it yet, but I wanted to bring it up because I always feel like this feature is missing, and while complicated to implement right in the general case, it so happens that I wrote a small library that already does the heavy lifting needed to determine whether it is safe to build abi3 binaries in a portable fashion, so, before I commit more time to it, does it sound worth an extra dependency to others ?