From 903859da223a3e8e31f37d130ec29547566c2f31 Mon Sep 17 00:00:00 2001 From: Juan Altmayer Pizzorno Date: Fri, 29 Apr 2022 09:40:13 -0400 Subject: [PATCH] - gave up on creating limited API (abi3) wheels for now, given that we want to use METH_FASTCALL and that's only available there in 3.10+; --- .github/workflows/build-and-upload.yml | 4 +++- setup.cfg | 2 -- setup.py | 14 +++++++++----- 3 files changed, 12 insertions(+), 8 deletions(-) delete mode 100644 setup.cfg diff --git a/.github/workflows/build-and-upload.yml b/.github/workflows/build-and-upload.yml index 9c5980a..b7a7272 100644 --- a/.github/workflows/build-and-upload.yml +++ b/.github/workflows/build-and-upload.yml @@ -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: diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 8b7e3b6..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -py_limited_api = cp38 diff --git a/setup.py b/setup.py index 31cf79a..a874e9b 100644 --- a/setup.py +++ b/setup.py @@ -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): @@ -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++' )