-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically set compiler flags to target PEP 384 Python limited API
PEP 384 introduced a Python limited API that allows you to build one wheel that targets all Python versions on a given platform. Setuptools supports opting in to building wheels for the Python limited API by adding the following lines to ``setup.cfg``: [bdist_wheel] py_limited_api = cp36 # replace with desired min Python version However, there are two needed steps that Setuptools does not do automatically: 1. Pass the `py_limited_api=True` keyword argument to each `Extension` 2. Set the `Py_LIMITED_API` preprocessor macro to the version hex value for the desired minimum Python version This patch teaches `get_extension()` to do those two missing steps automatically if the limited API is enabled in the ``setup.cfg`` file.
- Loading branch information
Showing
2 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters