Skip to content

Commit 2c0e9a6

Browse files
committed
Build: Add extended configuration for abi3 wheels.
1 parent 1051f3c commit 2c0e9a6

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

setup.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,10 @@ def handle_arg(arg: str):
377377
if option_limited_api:
378378
c_defines.append(('Py_LIMITED_API', f'0x{option_limited_api[0]:02x}{option_limited_api[1]:02x}0000'))
379379

380+
setup_options = extra_setup_args.setdefault('options', {})
381+
bdist_wheel_options = setup_options.setdefault('bdist_wheel', {})
382+
bdist_wheel_options['py_limited_api'] = f'cp{option_limited_api[0]}{option_limited_api[1]}'
383+
380384
# find Lua
381385
option_no_bundle = has_option('--no-bundle')
382386
option_use_bundle = has_option('--use-bundle')
@@ -408,6 +412,11 @@ def handle_arg(arg: str):
408412
def prepare_extensions(use_cython=True):
409413
ext_modules = []
410414
ext_libraries = []
415+
416+
extra_extension_args = {}
417+
if option_limited_api:
418+
extra_extension_args['py_limited_api'] = True
419+
411420
for config in configs:
412421
ext_name = config.get('libversion', 'lua')
413422
src, dst = os.path.join('lupa', '_lupa.pyx'), os.path.join('lupa', ext_name + '.pyx')
@@ -424,6 +433,7 @@ def prepare_extensions(use_cython=True):
424433
extra_objects=config.get('extra_objects'),
425434
include_dirs=config.get('include_dirs'),
426435
define_macros=c_defines,
436+
**extra_extension_args,
427437
))
428438

429439
if not use_cython:

0 commit comments

Comments
 (0)