-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #238 from bgilbert/abi3
convert: use Python Limited API on Python 3.11 and above
- Loading branch information
Showing
4 changed files
with
32 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,11 @@ | ||
# Adding wheels for a new Python release | ||
# Adding a new Python release | ||
|
||
- Update Git main | ||
- [ ] `git checkout main` | ||
- [ ] Add classifier for new Python version to `setup.py` | ||
- [ ] Add classifier for new Python version to `pyproject.toml' | ||
- [ ] Add new Python version to lists in `.github/workflows/python.yml` | ||
- [ ] Commit and open a PR | ||
- [ ] Merge the PR when CI passes | ||
- [ ] Add new Python jobs to [branch protection required checks](https://github.com/openslide/openslide-python/settings/branches) | ||
- Build new wheels | ||
- [ ] Check out a new branch from the most recent release tag | ||
- [ ] Add new Python version to lists in `.github/workflows/python.yml`, commit, and open a DNM PR | ||
- [ ] Find the [workflow run](https://github.com/openslide/openslide-python/actions) for the PR; download its wheels artifact | ||
- [ ] Close the PR | ||
- [ ] In OpenSlide Python checkout, `git checkout v<version> && git clean -dxf && mkdir dist` | ||
- [ ] Copy downloaded wheels _from new Python release only_ into `dist` directory | ||
- [ ] `twine upload dist/*` | ||
- [ ] Upload new wheels to [GitHub release](https://github.com/openslide/openslide-python/releases) | ||
- [ ] Update MacPorts package | ||
- [ ] Update website: Python 3 versions in `download/index.md` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,26 @@ | ||
import sys | ||
|
||
from setuptools import Extension, setup | ||
|
||
# use the Limited API on Python 3.11+; build release-specific wheels on | ||
# older Python | ||
_abi3 = sys.version_info >= (3, 11) | ||
|
||
setup( | ||
ext_modules=[ | ||
Extension('openslide._convert', ['openslide/_convert.c']), | ||
Extension( | ||
'openslide._convert', | ||
['openslide/_convert.c'], | ||
# hide symbols that aren't in the Limited API | ||
define_macros=[('Py_LIMITED_API', '0x030b0000')] if _abi3 else [], | ||
# tag extension module for Limited API | ||
py_limited_api=_abi3, | ||
), | ||
], | ||
options={ | ||
# tag wheel for Limited API | ||
'bdist_wheel': {'py_limited_api': 'cp311'} | ||
if _abi3 | ||
else {}, | ||
}, | ||
) |