ronaldoussoren / pyobjc

The Python <-> Objective-C Bridge with bindings for macOS frameworks
https://pyobjc.readthedocs.io
541 stars 47 forks source link

Investigate moving '_inlines' and '_protocols' to shared libraries #617

Open ronaldoussoren opened 1 month ago

ronaldoussoren commented 1 month ago

The `_inline_tab' is currently exported from a Python extension module, it might be possible to just use the dlopen API directly to load the library and extract the symbol from it.

A number of framework bindings have a helper exension module that just ensures that the protocols defined in the framework are available. Those could be plain dylibs that are loaded using dlopen.

Both changes would convert a number of framework bindings to not having extension modules, making them platform dependent python only wheels.

Currently not particularly important, but switching to multi-phase init for #608 requires dropping usage of the limited API / stable ABI and that results in more python version specific wheels.

Note that this may require changes to py2app to end up with nice app bundles.

ronaldoussoren commented 1 month ago

Easy way to find all candidates: look for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED once all extensions have been converted to multi phase init.