-
Notifications
You must be signed in to change notification settings - Fork 205
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
Make boost compatible with python limited API #221
Comments
To help with searching, specifically ability to define |
To allow building multi-version Python 3 extensions. The replaced methods are error-checking variants. Ref: boostorg#221
I have made a start on this and replace the methods in #270 which builds and passes tests. However defining --- include/boost/python/detail/wrap_python.hpp
+++ include/boost/python/detail/wrap_python.hpp
@@ -175,6 +175,7 @@ typedef int pid_t;
#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION == 2 && PY_MICRO_VERSION < 2
# include <boost/python/detail/python22_fixed.h>
#else
+#define Py_LIMITED_API
# include <Python.h>
#endif Snippet of build error:
I'm a little out of my depth here so some expertise would be welcome |
That error is because tp_alloc is not available in the limited api. Follow https://www.python.org/dev/peps/pep-0384/ to fix. Basically, you have to walk through all the failures, change boost to using the limited api for as many as you can (a good practice anyway), and disable the feature if you can't. It's a big chore. |
This is really important. Compilation times with boost are already huge, since boost is meant for large-scale C++ projects. Lack of support for |
To allow building multi-version Python 3 extensions. The replaced methods are error-checking variants. Ref: boostorg#221
I thought I would do some research on this to determine what effort is required to get to a stable abi. The only downsides I have read is that it might come at a small performance cost. cPython Reference:
Push to maintain the stable abi:
Other projects with in-progress work:
Building the pip wheel with For the current code there is usage of fields that will need alternatives to just using the
|
@AllSeeingEyeTolledEweSew I am not sure whether discussing on the boost mailing lists might get more traction? |
Currently boost python cannot be compiled with limited python API. To support many python versions it would be helpful to have this option.
https://docs.python.org/3/c-api/stable.html
http://code.activestate.com/lists/python-cplusplus-sig/17408/
https://www.python.org/dev/peps/pep-0384/
The text was updated successfully, but these errors were encountered: