Skip to content

Commit 23ef057

Browse files
authored
Use Python Stable ABI in Swig build (#19)
* Use Python Stable ABI in Swig build * Update workflow * Update * Update OSes * Remove macos-13 * Add PyPI release to workflow * Use Python 3.10 ABI
1 parent be7c280 commit 23ef057

File tree

7 files changed

+550
-303
lines changed

7 files changed

+550
-303
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: [3.7, 3.8, 3.9, '3.10']
14+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
1515
steps:
1616
- uses: actions/checkout@v2
1717
- name: Set up Python ${{ matrix.python-version }}

.github/workflows/wheels.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,45 @@ on:
44
push:
55
branches:
66
- master
7+
pull_request:
8+
release:
9+
types: [published]
710

811
jobs:
12+
build_sdist:
13+
name: Build source distribution
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- uses: actions/setup-python@v2
19+
with:
20+
python-version: '3.10'
21+
22+
- name: Build sdist
23+
run: |
24+
python -m pip install build
25+
python -m build --sdist
26+
27+
- uses: actions/upload-artifact@v4
28+
with:
29+
name: cibw-sdist
30+
path: dist/*.tar.gz
31+
932
build_wheels:
1033
name: Build wheels on ${{ matrix.os }}
1134
runs-on: ${{ matrix.os }}
1235
strategy:
1336
matrix:
14-
os: [ubuntu-20.04, windows-2019, macOS-latest]
37+
os: [ubuntu-22.04, windows-2022, macos-14]
1538

1639
env:
1740
CIBW_SKIP: pp*
1841
CIBW_ARCHS_MACOS: x86_64 arm64
1942
CIBW_ARCHS_LINUX: x86_64 aarch64
43+
# Build only for Python 3.10 since we're using stable ABI
44+
# The resulting abi3 wheels will work for Python 3.10+
45+
CIBW_BUILD: cp310-*
2046

2147
steps:
2248
- uses: actions/checkout@v2
@@ -40,8 +66,10 @@ jobs:
4066
path: ./wheelhouse/*.whl
4167

4268
upload_pypi:
43-
needs: [build_wheels]
69+
needs: [build_wheels, build_sdist]
4470
runs-on: ubuntu-latest
71+
# Only upload to PyPI on releases
72+
if: github.event_name == 'release' && github.event.action == 'published'
4573
steps:
4674
- uses: actions/download-artifact@v4
4775
with:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ The wrapper was generated with [SWIG](http://www.swig.org/).
5858

5959
Binary wheels are provided via [PyPI](https://pypi.python.org/pypi/rundec) for Linux, macOS, and Windows (built with [GitHub Actions](https://github.com/features/actions)).
6060

61-
The Windows wheels require Python 3.5+, on Linux and macOS Python 2.7+ is sufficient.
61+
Python 3.10+ is supported.

0 commit comments

Comments
 (0)