Since Python 3.2, there exists a stable ABI that allows linking against Python3
instead of enumerating each single version. This is achieved by certain restrictions.
Try to achieve this for PySide.
Goal: Build wheels for Python 3.5, 3.6, 3.7 etc.
Having a deeper look at the topic revealed the following:
The limited API changes the way how Python3 is built.
Some macros are turned into functions, and a lot of functionality
is simply not exposed. The setting is activated by defining
(in our case)
#define Py_LIMITED_API 0x03050000
Unfortunately, there are 18 modules which need more or less rigorous changes before the limited API will work.
[Note: The former text was too optimistic and wrong, due to caching effects.]
The one module that was completely excluded is datetime.
I talked with the Python developers. It turned out that not very
many projects use this feature, and it could be a little finer
grained concerning datetime, but obviously they could not justify
to put too much effort into this feature.
The general advice with unsupported C-modules is to use the Python
interface and fish the missing functions out of the interpreter
This principle can be applied to many places where direct access is not allowed.
Things become most complicated with the typeobject file, because no direct access is allowed any longer. But there is an alternative interface which we have to learn to use.
Py_buffer was an exception. Instead of seeking a Python replacement, the module was renamed and copied, and we will keep that version. This decision was taken from
PyQt - they have done the same.
Currently 17 out of 18 modules are resolved. I am right now stuck because we first need to support heap type objects. Without them, the limited API is impossible.
References: PEP 384
|For Gerrit Dashboard: PYSIDE-560|
|218007,23||PEP 384-1: Estimate the problem size||5.9||pyside/pyside-setup||Status: NEW||-2||0|
|218008,23||PEP 384-2: First simple conversions||5.9||pyside/pyside-setup||Status: NEW||-2||0|
|218009,26||PEP 384-3: Replace builtin variables by Python calls||5.9||pyside/pyside-setup||Status: NEW||-2||0|
|218010,27||PEP 384-4: More not so simple cases||5.9||pyside/pyside-setup||Status: NEW||-2||0|
|218011,27||PEP 384-5: Yet some more simple functions||5.9||pyside/pyside-setup||Status: NEW||-2||0|
|218012,27||PEP 384-6: The last simple functions||5.9||pyside/pyside-setup||Status: NEW||-2||0|
|223803,19||PEP 384-8: Enable the Limited Windows Build||5.9||pyside/pyside-setup||Status: NEW||0||0|
|228425,11||PEP 384-9: Finish Limited Access to Type Objects||5.9||pyside/pyside-setup||Status: NEW||-2||0|
|229912,19||PEP 384-10: Remove the PyHeapType objects from shiboken||5.9||pyside/pyside-setup||Status: NEW||0||0|
|231965,1||WIP: Remove PepType wherever possible||5.9||pyside/pyside-setup||Status: NEW||-2||0|
|214859,10||WIP: Pep384 step 1: Estimate the problem size||5.6||pyside/pyside-setup||Status: ABANDONED||-2||0|
|216208,5||WIP: Pep384 step 2: First simple conversions||5.6||pyside/pyside-setup||Status: ABANDONED||-2||0|
|216389,7||WIP: Pep384 step 3: Replacing builtin variables by Python calls||5.6||pyside/pyside-setup||Status: ABANDONED||-2||0|
|216937,2||WIP: Pep384 step 4: More not so simple cases||5.6||pyside/pyside-setup||Status: ABANDONED||-2||0|
|217101,2||WIP: Pep384 step 4: More not so simple cases||5.6||pyside/pyside-setup||Status: ABANDONED||-2||0|
|217102,1||WIP: Pep384 step 5: Yet some more simple functions||5.6||pyside/pyside-setup||Status: ABANDONED||-2||0|
|217185,3||WIP: Pep384 step 5: Yet some more simple functions||5.6||pyside/pyside-setup||Status: ABANDONED||-2||0|
|217202,6||WIP: Pep384 step 6: The last simple functions||5.6||pyside/pyside-setup||Status: ABANDONED||-2||0|
|217474,5||WIP: Pep384 step 7: Adjust signature.cpp to the limited API||5.6||pyside/pyside-setup||Status: ABANDONED||-2||0|
|218013,31||PEP 384-7: Adjust signature.cpp to the limited API||5.9||pyside/pyside-setup||Status: ABANDONED||-2||0|
|223613,1||Pep384 step 8: Enable the Limited Windows Build||5.9||pyside/pyside-setup||Status: ABANDONED||-1||0|
|230082,3||WIP: Squashed Heaptype/Limited API changes||5.9||pyside/pyside-setup||Status: ABANDONED||-2||0|
|230864,9||PEP 384-squash: Implement PEP 384||5.9||pyside/pyside-setup||Status: MERGED||-2||0|
|231410,5||Fix glitch in voidptr.cpp after the PEP 384 commit||5.9||pyside/pyside-setup||Status: MERGED||+2||0|
|234917,4||Pep 384 Final Cut: Remove PepType||5.11||pyside/pyside-setup||Status: MERGED||+2||0|
|235812,3||Fix Some Minor Limited API Omissions And Quirks||5.11||pyside/pyside-setup||Status: MERGED||+2||0|
|259396,8||Avoid too much stickiness when using --reuse-build||5.12||pyside/pyside-setup||Status: MERGED||+2||0|