diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 38cb4c52..19dcf9e8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,6 @@ jobs: os: - ubuntu-latest python-version: - - 3.5 - 3.6 - 3.7 - 3.8 @@ -47,7 +46,6 @@ jobs: os: - macos-latest python-version: - - 3.5 - 3.6 - 3.7 - 3.8 @@ -82,7 +80,6 @@ jobs: os: - windows-latest python-version: - - 3.5 - 3.6 - 3.7 - 3.8 @@ -147,6 +144,7 @@ jobs: env: WRAPT_INSTALL_EXTENSIONS: true # Require extensions. CIBW_SKIP: pp* # Skip wheels for PyPy. + CIBW_BUILD: cp36-* # only build on 3.6 for stable cp36-abi3 - uses: actions/upload-artifact@v2 with: name: dist diff --git a/setup.cfg b/setup.cfg index b854d8bb..ae8b02da 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,7 +17,6 @@ classifiers = Development Status :: 5 - Production/Stable License :: OSI Approved :: BSD License Programming Language :: Python :: 3 - Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 @@ -32,7 +31,7 @@ project_urls = [options] zip_safe = false -python_requires = >= 3.5 +python_requires = >= 3.6 packages = find: package_dir = =src @@ -45,6 +44,7 @@ where=src [bdist_wheel] universal = false +py_limited_api=cp36 # --- Test and coverage configuration ------------------------------------------ @@ -74,13 +74,11 @@ envlist = [gh-actions] python = - 3.5: py35, py35-without-extensions, py35-install-extensions, py35-disable-extensions 3.6: py36, py36-without-extensions, py36-install-extensions, py36-disable-extensions 3.7: py37, py37-without-extensions, py37-install-extensions, py37-disable-extensions 3.8: py38, py38-without-extensions, py38-install-extensions, py38-disable-extensions 3.9: py39, py39-without-extensions, py39-install-extensions, py39-disable-extensions 3.10: py310, py310-without-extensions, py310-install-extensions, py310-disable-extensions - pypy-2.7: pypy-without-extensions pypy-3.6: pypy-without-extensions pypy-3.7: pypy-without-extensions diff --git a/setup.py b/setup.py index 1e182e36..295bcf3b 100644 --- a/setup.py +++ b/setup.py @@ -24,6 +24,7 @@ "wrapt._wrappers", sources=["src/wrapt/_wrappers.c"], optional=not force_extensions, + py_limited_api=True, ) ] diff --git a/src/wrapt/_wrappers.c b/src/wrapt/_wrappers.c index ea704d19..5c3b6e17 100644 --- a/src/wrapt/_wrappers.c +++ b/src/wrapt/_wrappers.c @@ -1,7 +1,9 @@ /* ------------------------------------------------------------------------- */ -/* stable ABI Python >= 3.5 */ -#define Py_LIMITED_API 0x03050000 +#ifndef Py_LIMITED_API +/* stable ABI Python >= 3.6, keep in sync with setup.cfg py_limited_api */ +#define Py_LIMITED_API 0x03060000 +#endif #include "Python.h"