Skip to content
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

Automatically set compiler flags to target PEP 384 Python limited API #26

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Feb 10, 2021

  1. 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.
    lpsinger committed Feb 10, 2021
    Configuration menu
    Copy the full SHA
    6547724 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2023

  1. Update extension_helpers/_setup_helpers.py

    Co-authored-by: Conor MacBride <conor@macbride.me>
    lpsinger and ConorMacBride committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    cdfeeac View commit details
    Browse the repository at this point in the history