Support for stable CPython ABI? #4474
HDembinski
started this conversation in
Ideas
Replies: 2 comments
-
We made the stable API work in a fork: https://github.com/meshinspector/mrbind-pybind11 The way we do it is by compiling small shim libraries for each Python version we need to support, then loading the appropriate one at runtime. |
Beta Was this translation helpful? Give feedback.
0 replies
-
nanobind supports the stable abi but pybind11 currently doesn't. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I recently learned that CPython offers a subset of its API which is forward stable. https://docs.python.org/3/c-api/stable.html
The stable API allows you to write compiled extensions which are compatible with all future minor CPython versions. It is supposed to provide full functionality and merely limited in performance a bit.
Does pybind11 support the stable ABI? I could not find any hints it does. If this was an option, it would allow library authors like myself to build wheels for let's say CPython 3.8 and have that work for 3.9, 3.10, 3.11, ... Currently, I have to build a wheel for each of these versions.
Beta Was this translation helpful? Give feedback.
All reactions