Skip to content

Commit

Permalink
- gave up on creating limited API (abi3) wheels for now, given that
Browse files Browse the repository at this point in the history
  we want to use METH_FASTCALL and that's only available there in 3.10+;
  • Loading branch information
jaltmayerpizzorno committed Apr 29, 2022
1 parent 1bd9614 commit 903859d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build-and-upload.yml
Expand Up @@ -30,11 +30,13 @@ jobs:
container: ${{ matrix.container }}
strategy:
matrix:
python_version: ['3.8']
python_version: ['3.8', '3.9', '3.10']
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
include:
- os: ubuntu-latest
container: quay.io/pypa/manylinux_2_24_x86_64 # https://github.com/pypa/manylinux
- os: macos-latest
python_version: 3.8
upload_source: true # just need ONE of them to do it

steps:
Expand Down
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

14 changes: 9 additions & 5 deletions setup.py
Expand Up @@ -15,13 +15,17 @@ def read_file(name):
dev_build = ('.dev' + environ['DEV_BUILD']) if 'DEV_BUILD' in environ else ''

def cxx_version():
return "-std=c++17" if sys.platform != "win32" else "/std:c++17"
return ["-std=c++17" if sys.platform != "win32" else "/std:c++17"]

def platform_args():
if sys.platform == 'darwin':
return "-arch x86_64 -arch arm64 -arch arm64e".split()
elif sys.platform == 'win32':
return ["/DPy_LIMITED_API"]
return []

def limited_api_args():
# We would like to use METH_FASTCALL, but that's only available in the
# Python 3.10+ stable ABI, and we'd like to support Python 3.8+
# return ['-DPy_LIMITED_API=0x030a0000']
return []

class CppExtension(build_ext):
Expand All @@ -35,8 +39,8 @@ def build_extensions(self):
tracker = setuptools.extension.Extension(
'slipcover.tracker',
sources=['tracker.cxx'],
extra_compile_args=[cxx_version()] + platform_args(),
py_limited_api=True,
extra_compile_args=cxx_version() + platform_args + limited_api_args()
py_limited_api=bool(limited_api_args()),
language='C++'
)

Expand Down

0 comments on commit 903859d

Please sign in to comment.