-
-
Notifications
You must be signed in to change notification settings - Fork 281
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
Support for abi3
Python packages with abi3audit
checks
#1865
Comments
It seems like at a minimum would could add |
Another option would be to add a |
OS-specific noarch packages exist already today, so we are already in awkward territory :D Splitting packages into different JSONs is decided only by conda-index, so we can technically instruct it to place the noarch + __linux packages in all linux-*/repodata.json files (not saying that we should, but we can) 😂 |
Some feedstocks are already looking into this. See: conda-forge/qiskit-terra-feedstock#41 |
And for those watching this space, check conda-forge/python-feedstock#669. |
It would be nice if abi3audit supported conda packages (I know there is an upstream issue linked above already). In my testing for now, I run it with explicit paths to the .so files of the installed package to check. |
Just a note on Python 3.13, when using free-threading (so GIL disabled) in Python 3.13, it is not possible to use the Limited C API or Stable ABI Of course the non-free-threading (so GIL enabled) Python 3.13, can continue to use the Limited C API and Stable ABI More details in this doc |
Thinking about the issue above, having some kind of virtual or metapackage that all For example package:
name: python_abi3
version: 1.0.0
build:
number: 0
skip: true # [not is_freethreading]
requirements:
host:
- python
run:
- python A consumer then might look like {% set min_py_ver = "3.11" %}
package:
name: mypkg
version: 1.0.0
build:
number: 0
noarch: true # [not is_freethreading]
script:
- python -m pip install . # [is_freethreading]
- python -m pip install . --py-limited-api=cp{{ min_py_ver.replace(".", "") }} # [not is_freethreading]
requirements:
host:
- python # [is_freethreading]
- python {{ min_py_ver }} # [not is_freethreading]
- python_abi3 # [not is_freethreading]
run:
- python # [is_freethreading]
- python {{ min_py_ver }} # [not is_freethreading]
- python_abi3 # [is_freethreading] That way we still get a |
Proposal
Add support for
abi3
Python packages to reduce the amount of artifacts produced for compatible projects (compliance checked withabi3audit
).Details
CPython has a "stable API" defined in PEP 384, which goes all the way back to Python 3.2. This allows compiled modules to run on newer Python versions than the one they were compiled against, as long as they only use the stable subset. Such packages are labeled as
abi3
.conda-forge could package compatible packages like this, reducing the amount of artifacts (and build matrix entries) from
V×P
toP
(V
= Number of supported Python versions,P
= Number of platforms).In [this blog post] (recommended read!), authors reveal how this works in practice for PyPI, and how some packages opt-in to this label without actual compliance. To fix this issue, a tool
abi3audit
is developed, which can check for symbol usage and violations of the abi3 contract.Implementation
If this sounds nice, we can think of how to implement it. Some ideas:
abi3
compatibility whenever possible.abi3
mode, where Python inhost
is using the oldest supported Python, butrun
pins for>={oldest}
.site-packages
placement with symlinks,post-link
scripts, patches in CPython default path.conda
andconda-build
to support a newnoarch
variant (e.g.python-abi3
) to handle this natively. This has the drawback of users needing to update to a newer conda to use this new package type.Other notes
abi3audit
so it can scan non-abi3 objects.References
The text was updated successfully, but these errors were encountered: