-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
gh-95991: Add some infrastructure for testing Limited API in _testcapi #95992
gh-95991: Add some infrastructure for testing Limited API in _testcapi #95992
Conversation
…estcapi - Limited API needs to be enabled per source file - Some builds don't support Limited API, so Limited API tests must be skipped on those builds (currently this is `Py_TRACE_REFS`, but that may change.) - `Py_LIMITED_API` must be defined before `<Python.h>` is included. This puts the hoop-jumping in `testcapi/parts.h`, so individual test files can be relatively simple. (Currently that's only `vectorcall_limited.c`, imagine more.)
I'm not sure about best practices for |
I also plan to add some instructions for the devguide, mentioning the structure for a #define Py_LIMITED_API 0x03...
#include "parts.h"
#ifdef LIMITED_API_AVAILABLE
(all content goes here)
#endif and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! You might want to document the test decorator in Doc/library/test.rst
.
Co-authored-by: Erlend E. Aasland <[email protected]>
This happens to move |
I don't understand the failure on the Windows buildbot:
|
Windows failures need to be resolved
@python/windows-team, do you know what's wrong here, by any chance? |
It's probably getting built before the limited API DLL ( Add the below to
|
When Py_TRACE_REFS is defined, it was discussed once to move the double linked list of objects out of PyObject, to keep the ABI compatiiblity. It shouldn't be hard to store it somewhere else. But so far, nobody proposed a concrete implementation of this idea. |
(currently this is
Py_TRACE_REFS
, but that may change.)Py_LIMITED_API
must be defined before<Python.h>
is included.This puts the hoop-jumping in
testcapi/parts.h
, so individualtest files can be relatively simple. (Currently that's only
vectorcall_limited.c
, imagine more.)