Skip to content

Commit a5ee8db

Browse files
committed
release: add cp310 ABI3 fallback wheels
1 parent 542f9db commit a5ee8db

3 files changed

Lines changed: 19 additions & 6 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121

2222
# Used to host cibuildwheel
2323
- uses: actions/setup-python@v7
24+
with:
25+
python-version: "3.x"
2426

2527
- name: Install cibuildwheel
2628
run: python -m pip install cibuildwheel==4.2.1
@@ -50,14 +52,16 @@ jobs:
5052
persist-credentials: false
5153

5254
- uses: actions/setup-python@v7
55+
with:
56+
python-version: "3.x"
5357

5458
- name: Install cibuildwheel and abi3audit
5559
run: python -m pip install cibuildwheel==4.2.1 abi3audit
5660

5761
- name: Build ABI3 wheel
5862
env:
5963
BENCODER_LIMITED_API: "1"
60-
CIBW_BUILD: "cp312-*"
64+
CIBW_BUILD: "cp310-*"
6165
CIBW_ENVIRONMENT: "BENCODER_LIMITED_API=1"
6266
run: python -m cibuildwheel --output-dir wheelhouse
6367

@@ -91,13 +95,14 @@ jobs:
9195
path: dist/*.tar.gz
9296

9397
test_abi3:
94-
name: Test ABI3 wheel on latest Python (${{ matrix.os }})
98+
name: Test ABI3 wheel on Python ${{ matrix.python-version }} (${{ matrix.os }})
9599
needs: build_abi3
96100
runs-on: ${{ matrix.os }}
97101
strategy:
98102
fail-fast: false
99103
matrix:
100104
os: [ubuntu-latest, windows-latest, macos-latest]
105+
python-version: ["3.10", "3.x"]
101106

102107
steps:
103108
- uses: actions/checkout@v7
@@ -106,7 +111,7 @@ jobs:
106111

107112
- uses: actions/setup-python@v7
108113
with:
109-
python-version: "3.x"
114+
python-version: ${{ matrix.python-version }}
110115

111116
- uses: actions/download-artifact@v8
112117
with:

‎README.rst‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ Usage
4141
ChangeLog
4242
----------
4343

44+
Version 3.0.3
45+
~~~~~~~~~~~~~~~
46+
47+
+ Add a `cp310-abi3` fallback wheel for CPython 3.10 and newer
48+
+ Keep per-version native wheels for optimized builds
49+
4450
Version 3.0.2
4551
~~~~~~~~~~~~~~~
4652

‎setup.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
pyx_path = 'bencoder.pyx'
1010
c_path = 'bencoder.c'
1111
use_limited_api = os.environ.get("BENCODER_LIMITED_API", "0") == "1"
12+
abi3_tag = "cp310"
13+
abi3_api = "0x030A0000"
1214

1315
if os.path.exists(c_path):
1416
# Remove C file to force Cython recompile.
@@ -28,9 +30,9 @@
2830
[pyx_path],
2931
extra_compile_args=["-O3"],
3032
py_limited_api=True,
31-
define_macros=[("Py_LIMITED_API", "0x030C0000")],
33+
define_macros=[("Py_LIMITED_API", abi3_api)],
3234
)
33-
setup_options = {"bdist_wheel": {"py_limited_api": "cp312"}}
35+
setup_options = {"bdist_wheel": {"py_limited_api": abi3_tag}}
3436
else:
3537
extension = Extension(
3638
"bencoder",
@@ -69,7 +71,7 @@ def run_tests(self):
6971

7072
setup(
7173
name='bencoder.pyx',
72-
version='3.0.2',
74+
version='3.0.3',
7375
description='Yet another bencode implementation in Cython',
7476
long_description=open('README.rst', 'r').read(),
7577
author='whtsky',

0 commit comments

Comments
 (0)