packaging.python.org
packaging.python.org copied to clipboard
API/ABI difference needs to be explained
I wanted to add there links to extensions.rst page:
There were links here, but @theacodes removed them because they linked to NSFW spam
But could not find a good place to inject this. I am not sure that I completely get the difference between Public API and Stable API from a perspective of extension developer, and also there is no explanation what ABI is about and what is its practical purpose.
Agreed - there's a placeholder in the binary extensions page, but I think we need to recognise that for a lot of Pythonistas, that page is going to be their first introduction to the idea of shipping compiled code at all.
It's also possible those details may belong in the embedding & extending section of the main CPython docs, or perhaps a new "HOWTO" guide.
Looks like a good task for OpenHatch project.
I was interested in working on this, but (a) the URLs referenced in @techtonik's first comment now point to something ... ahem, a bit unrelated to Python. And (b) there's no longer an "extensions.rst" file in the source. Is this issue still relevant? Do we really mean the "packaging-binary-extensions.rst" file? And if so, there is a mention of API vs. ABI, but I'm willing to admit/agree that it could use some additional explanation.
@reuven oof, I removed those. extensions.rst has indeed been renamed to packaging-binary-extensions.rst. I definitely think we could expand more on the API/ABI thing, perhaps by writing a new specification.
https://docs.python.org/3/c-api/stable.html and https://docs.python.org/3/c-api/apiabiversion.html#apiabiversion are the relevant CPython C API docs, but I think the packaging user guide needs something a bit more fundamental:
- Extension modules typically need to be rebuilt for each new Python version and each new Python interpreter
- This is indicated by compatibility tags in the created wheel archives (as per https://packaging.python.org/specifications/platform-compatibility-tags/ ), as well as in the naming of the extension modules themselves (I'm not sure we actually document that naming scheme anywhere in the CPython docs)
- For Python 3.2+, extension modules can be shared across interpreter versions by targeting the stable ABI and using a compatibility shim that gets rebuilt for each new version to handle the required operations that the stable ABI doesn't support (i.e. the way
pysipworks)
Hello , I am know some basic data structure and java and c++ language at intermediate level . and currently learning python can anyone suggest me how to contribute to open source ?
Thanks in advance .