Skip to content

Commit

Permalink
Set py-limited-api dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
Legrandin committed Aug 12, 2024
1 parent d2a1d37 commit 52b2da8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@ project_urls =
Source=https://github.com/Legrandin/pycryptodome/
Changelog=https://www.pycryptodome.org/src/changelog

[bdist_wheel]
py-limited-api = cp36

[build_sphinx]
source-dir = Doc
10 changes: 10 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import sys
import shutil
import struct
import sysconfig

sys.path.append(os.getcwd())

Expand Down Expand Up @@ -497,6 +498,14 @@ def create_cryptodome_lib():

version_string = ".".join([str(x) for x in version_tuple])

# Set the minimum ABI3 version for bdist_wheel to 3.6
# unless Python is running without GIL (as there is no established way yet to
# specify multiple ABI levels)
setup_options = {}
if sys.version_info[0] > 2:
if not sysconfig.get_config_var('Py_NOGIL'):
setup_options['options'] = {'bdist_wheel': {'py_limited_api': 'cp36'}}

setup(
name=project_name,
version=version_string,
Expand Down Expand Up @@ -538,4 +547,5 @@ def create_cryptodome_lib():
'test': TestCommand,
},
ext_modules=ext_modules,
**setup_options
)

0 comments on commit 52b2da8

Please sign in to comment.