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

Python: Limited C API support #12029

Closed
igo95862 opened this issue Jul 24, 2023 · 3 comments · Fixed by #11745
Closed

Python: Limited C API support #12029

igo95862 opened this issue Jul 24, 2023 · 3 comments · Fixed by #11745
Labels
modules:python Issues specific to the python module

Comments

@igo95862
Copy link

igo95862 commented Jul 24, 2023

Python documentation describing the limited API: https://docs.python.org/3/c-api/stable.html#stable-application-binary-interface

Basically this will allow the Python C extension to be forward compatible. This requires the Py_LIMITED_API macro to be set and the extension have the .abi3.so suffix.

I tried using the name_suffix but it is disabled for extension_module.

sd_bus_internals_module = python.extension_module(
    'sd_bus_internals',
    sd_bus_internals_sources,
    dependencies : libsystemd_dep,
    c_args : ['-DPy_LIMITED_API=0x03070000'],
    install : true,
    subdir : 'sdbus',
    name_suffix : 'abi3'
)

Maybe it is worth support it in python module? For example, a new option limited_api : '3.7' would set the limited api to python 3.7 and put the abi3.so suffix.

@igo95862
Copy link
Author

I found a merge request that implements this: #11745

@eli-schwartz
Copy link
Member

Also #12008

@eli-schwartz eli-schwartz added the modules:python Issues specific to the python module label Jul 24, 2023
@tristan957
Copy link
Member

Closing as duplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules:python Issues specific to the python module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants