bpo-42111: Make the xxlimited module an example of best extension module practices (GH-23226)

- Copy existing xxlimited to xxlimited53 (named for the limited API version it uses)
- Build both modules, both in debug and release
- Test both modules
This commit is contained in:
Petr Viktorin 2020-12-08 17:36:53 +01:00 committed by GitHub
parent 4aa67853cc
commit c168b5078f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 745 additions and 155 deletions

View file

@ -1803,8 +1803,16 @@ class PyBuildExt(build_ext):
## self.add(Extension('xx', ['xxmodule.c']))
if 'd' not in sysconfig.get_config_var('ABIFLAGS'):
# Non-debug mode: Build xxlimited with limited API
self.add(Extension('xxlimited', ['xxlimited.c'],
define_macros=[('Py_LIMITED_API', '0x03100000')]))
self.add(Extension('xxlimited_35', ['xxlimited_35.c'],
define_macros=[('Py_LIMITED_API', '0x03050000')]))
else:
# Debug mode: Build xxlimited with the full API
# (which is compatible with the limited one)
self.add(Extension('xxlimited', ['xxlimited.c']))
self.add(Extension('xxlimited_35', ['xxlimited_35.c']))
def detect_tkinter_explicitly(self):
# Build _tkinter using explicit locations for Tcl/Tk.