Skip to content

Commit 5cc1300

Browse files
authored
Merge pull request #15 from vlaci/abi3-wheels
Use `abi3` wheels to support arbitrary Python versions
2 parents 44407c5 + 009a1c5 commit 5cc1300

4 files changed

Lines changed: 23 additions & 26 deletions

File tree

.github/workflows/create_wheels.yaml

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,54 +15,47 @@ jobs:
1515
strategy:
1616
matrix:
1717
os: [macos-latest, ubuntu-latest, windows-latest]
18-
python-version: [37, 38, 39, 310, 311]
1918

2019
steps:
21-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2221

2322
- name: Set up QEMU
2423
if: runner.os == 'Linux'
2524
uses: docker/setup-qemu-action@v2
2625
with:
2726
platforms: all
2827

29-
- name: Setup rust
30-
uses: actions-rs/toolchain@v1
31-
with:
32-
toolchain: stable
33-
3428
- name: Build wheels
35-
uses: pypa/cibuildwheel@v2.11.3
29+
uses: pypa/cibuildwheel@v3.0.0
3630
env:
37-
CIBW_BUILD: cp${{matrix.python-version}}-*
31+
CIBW_BUILD: cp38-*
3832
CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH" CARGO_TERM_COLOR="always"'
3933
CIBW_ENVIRONMENT_WINDOWS: 'PATH="$UserProfile\.cargo\bin;$PATH"'
4034

4135
- name: Upload Binaries
42-
uses: actions/upload-artifact@v3
36+
uses: actions/upload-artifact@v4
4337
with:
44-
name: wheels
38+
name: wheels-${{ matrix.os }}
4539
path: wheelhouse
4640

4741
test-wheels:
4842
needs: [build-wheels]
4943
runs-on: ${{ matrix.os }}
5044
strategy:
5145
matrix:
52-
python-version: [3.7, 3.8, 3.9, '3.10', '3.11']
5346
os: [macos-latest, ubuntu-latest, windows-latest]
5447

5548
steps:
56-
- uses: actions/checkout@v3
49+
- uses: actions/checkout@v4
5750
with:
5851
path: py_cpp_demangle_source
59-
- uses: actions/download-artifact@v3
52+
- uses: actions/download-artifact@v4
6053
with:
61-
name: wheels
62-
- name: Set up Python ${{ matrix.python-version }}
63-
uses: actions/setup-python@v4
54+
name: wheels-${{ matrix.os }}
55+
- name: Set up Python
56+
uses: actions/setup-python@v5
6457
with:
65-
python-version: ${{ matrix.python-version }}
58+
python-version: 3.x
6659
- name: Install wheel
6760
run: |
6861
pip install --force-reinstall --no-deps --no-index --find-links . cpp-demangle
@@ -76,17 +69,18 @@ jobs:
7669
if: "startsWith(github.ref, 'refs/tags/')"
7770
needs: [test-wheels]
7871
steps:
79-
- uses: actions/download-artifact@v3
72+
- uses: actions/download-artifact@v4
8073
with:
81-
name: wheels
74+
pattern: wheels-*
75+
merge-multiple: true
8276
- name: Create GitHub Release
8377
uses: fnkr/github-action-ghr@v1.3
8478
env:
8579
GHR_PATH: .
8680
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87-
- uses: actions/setup-python@v2
81+
- uses: actions/setup-python@v5
8882
with:
89-
python-version: 3.9
83+
python-version: 3.x
9084
- name: Push to PyPi
9185
env:
9286
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ cpp_demangle = "0.4.0"
1313

1414
[dependencies.pyo3]
1515
version = "0.17.3"
16-
features = ["extension-module"]
16+
features = ["extension-module", "abi3"]

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# skip testing in the cibuildwheel phase, will install the wheels later
33
# and verify
44
test-command = ""
5-
skip = ["pp*", "*musl*", "*-manylinux_i686", "*win32"]
5+
skip = ["*musl*", "*-manylinux_i686", "*win32"]
66

7-
[tool.cibuildwheel.macos]
8-
archs = ["x86_64"]
7+
[tool.cibuildwheel.macos.environment]
8+
MACOSX_DEPLOYMENT_TARGET = "10.12"
99

1010
[build-system]
1111
requires = [

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ search = name = "py_cpp_demangle"
1010
version = "{current_version}"
1111
replace = name = "py_cpp_demangle"
1212
version = "{new_version}"
13+
14+
[bdist_wheel]
15+
py_limited_api=cp38

0 commit comments

Comments
 (0)