Replies: 5 comments 3 replies
-
|
Beta Was this translation helpful? Give feedback.
-
This has been previously discussed, but I forget where. Yes, this would be a useful enhancement, if someone wants to add it. Not particularly high priority though, since e.g. for my own use I'd rather compile locally. :P It should probably support a module option? since there are performance optimizations that are disabled in the limited api, and people building for reasons other than PyPI distribution may often want to build a more specific but slightly faster binary. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your feedback. So I have started working on this tonight and would like to bounce some questions of people:
|
Beta Was this translation helpful? Give feedback.
-
Huh, so I've discovered that Cython has a similar thing: Here's how I plan to deal with that: if a user has supplied a Does this sound like it will work? I'm not sure how to reliably check if the input sources contain any Cython files. I was intending to check the file extension but I'm not sure if that catches all cases. |
Beta Was this translation helpful? Give feedback.
-
Implementation posted for review #11745 |
Beta Was this translation helpful? Give feedback.
-
Starting in CPython 3.2, there is a means for extension writers to target a limited subset of its API which allows an extension module to be compiled once and work with multiple Python versions. The API version is selected by defining a symbol (Py_LIMITED_API) to a given value.
Currently extensions compiled via the Meson python module's
extension_module
method always target the version of Python that is detected by Meson.It would be useful to me (and hopefully others too) to be able to target the limited API via
extension_module
. For example:Is this something others would either be interested in or would have reservations about? I'm opening this discussion to invite comment on this before I start working on adding this.
Some prior art: CMake (recently) added support for this.
Beta Was this translation helpful? Give feedback.
All reactions