Skip to content

Commit 349fb17

Browse files
authored
Merge branch 'trunk' into typo
2 parents 43e9156 + 45f6c14 commit 349fb17

File tree

7 files changed

+147
-32
lines changed

7 files changed

+147
-32
lines changed

.github/workflows/github-deploy.yml

Lines changed: 47 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,66 @@ on:
33
push:
44
branches:
55
- default
6-
tags:
7-
- v*
6+
# To simplify the release process, the publishing is triggered on tag.
7+
# We should make sure to only push tags for new releases.
8+
# If we start using tags for non-release purposes,
9+
# this needs to be updated.
10+
#
11+
# We need to explicitly configure an expression that matches anything.
12+
tags: [ "**" ]
813
pull_request:
914

15+
16+
defaults:
17+
run:
18+
# Use bash on Windows for consistency.
19+
shell: bash
20+
21+
1022
jobs:
1123
build_wheels:
1224
name: Build wheels on ${{ matrix.os }}
1325
runs-on: ${{ matrix.os }}
1426
strategy:
27+
fail-fast: false
1528
matrix:
16-
os: [ubuntu-20.04, windows-latest, macos-latest]
29+
os: [ubuntu-latest, windows-latest, macos-latest]
1730

1831
steps:
19-
- uses: actions/checkout@v2
32+
- uses: actions/checkout@v4
2033

21-
- uses: actions/setup-python@v2
34+
- uses: actions/setup-python@v4
2235
name: Install Python
2336
with:
24-
python-version: '3.9'
37+
python-version: '3.14'
2538

26-
- name: Install cibuildwheel
39+
- name: Install deps
2740
run: |
28-
python -m pip install cibuildwheel==2.1.1
41+
python -m pip install cibuildwheel==3.2.1 abi3audit==0.0.22
2942
3043
- name: Build wheels
3144
run: |
3245
python -m cibuildwheel --output-dir wheelhouse
3346
34-
- uses: actions/upload-artifact@v2
47+
- name: Check files
48+
run: ls -al wheelhouse/
49+
50+
- name: Audit ABI3 wheels
51+
run: |
52+
abi3audit -vsS wheelhouse/*abi3*.whl
53+
54+
- uses: actions/upload-artifact@v4
3555
with:
56+
name: artifact-wheels-${{ matrix.os }}
3657
path: ./wheelhouse/*.whl
3758

3859
build_sdist:
3960
name: Build source distribution
4061
runs-on: ubuntu-latest
4162
steps:
42-
- uses: actions/checkout@v2
63+
- uses: actions/checkout@v4
4364

44-
- uses: actions/setup-python@v2
65+
- uses: actions/setup-python@v4
4566
name: Install Python
4667
with:
4768
python-version: '3.9'
@@ -53,25 +74,28 @@ jobs:
5374
- name: Build sdist
5475
run: python -m build --sdist
5576

56-
- uses: actions/upload-artifact@v2
77+
- uses: actions/upload-artifact@v4
5778
with:
79+
name: artifact-sdist
5880
path: dist/*.tar.gz
5981

6082
upload_pypi:
6183
needs: [build_wheels, build_sdist]
6284
runs-on: ubuntu-latest
63-
# upload to PyPI on every tag starting with 'v'
64-
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
65-
# alternatively, to publish when a GitHub Release is created, use the following rule:
66-
# if: github.event_name == 'release' && github.event.action == 'published'
85+
permissions:
86+
# IMPORTANT: this permission is mandatory for trusted publishing
87+
id-token: write
6788
steps:
68-
- uses: actions/download-artifact@v2
89+
- uses: actions/download-artifact@v4
6990
with:
70-
name: artifact
91+
pattern: artifact-*
92+
merge-multiple: true
7193
path: dist
7294

73-
- uses: pypa/gh-action-pypi-publish@master
74-
with:
75-
user: __token__
76-
password: ${{ secrets.pypi_password }}
77-
# To test: repository_url: https://test.pypi.org/legacy/
95+
- name: Check files
96+
run: ls -al dist/
97+
98+
- name: Publish to PyPI - on tag
99+
# Skip upload to PyPI if we don't have a tag
100+
if: startsWith(github.ref, 'refs/tags/')
101+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ __pycache__/
1111
build/
1212
develop-eggs/
1313
dist/
14+
wheelhouse/
1415
downloads/
1516
eggs/
1617
.eggs/

CHANGELOG.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
Changelog
22
=========
33

4-
1.0.3 (unreleased)
5-
------------------
64

7-
- Nothing changed yet.
5+
2025.11.0 (2025-11-02)
6+
----------------------
7+
8+
- Enable ABI3 binary wheels for generic Python support.
89

910

1011
1.0.2 (2021-08-10)

README.rst

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,59 @@
1+
Introduction
2+
============
3+
14
A trivial extension that just raises an exception.
25
See L{twisted.test.test_failure.test_failureConstructionWithMungedStackSucceeds}.
6+
7+
Only used to help test twisted/twisted.
8+
9+
Report issues at https://github.com/twisted/twisted/issues
10+
11+
Dev process
12+
===========
13+
14+
* We use `cibuildwheel` to generate the wheels.
15+
* You will need access to a Docker server.
16+
* You will need Python 3.11 or newer to run cibuildwheel.
17+
This does not affect the generated wheels,
18+
as they are build inside the container.
19+
* Use `python -m cibuildwheel --output-dir wheelhouse` to generate the wheels.
20+
This is the same command use by GitHub Actions.
21+
You can update the `pyproject.toml` file to adjust the cibuildwheel options.
22+
23+
24+
Release process
25+
===============
26+
27+
28+
Pre-release steps
29+
-----------------
30+
31+
* Make sure that a ticket is created for twisted/twisted that covers
32+
the new release and explain why we need the new release.
33+
* Create a new branch with a name that starts with the twisted/twisted
34+
issue number. Ex: `12528-python-3.14-support`
35+
* Update the version inside setup.cfg. We now use calendar versioning.
36+
* Make the required code changes.
37+
* Create a pull request and make sure all checks pass.
38+
The wheels are generated as part of the PR checks,
39+
but they are not yet published to PyPI.
40+
* Request a review from `twisted-contributors`
41+
42+
43+
Release steps
44+
-------------
45+
46+
* Use GitHub Release to create a new release together with a new tag.
47+
* You don't have to create a GitHub Release, the important part is to
48+
create a new tag.
49+
* The tag value is the version. Without any prefix.
50+
* Once a tag is pushed to the repo, GitHub Action will re-run all the jobs
51+
and will publish to PyPI.
52+
53+
54+
Post-release steps
55+
------------------
56+
57+
* Update the version inside setup.cfg to the next development version.
58+
Increment the micro version and add a .dev0 suffix.
59+
* Merge the pull request

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,11 @@ requires = [
55
"cython >= 0.29.21",
66
]
77
build-backend = "setuptools.build_meta"
8+
9+
[tool.cibuildwheel]
10+
# We enable all builds and then cherry-pick the platforms via the `build`
11+
# configuration below.
12+
enable = ["all"]
13+
# See https://cibuildwheel.pypa.io/en/stable/options/#build-skip
14+
# Not sure why it was failing on PyPy 3.11.
15+
build = "cp38-* pp310-*"

setup.cfg

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = cython-test-exception-raiser
3-
version = 1.0.3.dev0
3+
version = 25.11.1.dev0
44
description = A trivial extension that just raises an exception.
55
long_description = file: README.rst
66
long_description_content_type = text/x-rst
@@ -10,15 +10,17 @@ maintainer = Thomas Grainger
1010
maintainer_email = [email protected]
1111
url = https://github.com/twisted/cython-test-exception-raiser
1212
license = MIT
13-
python_requires = >=3.6
13+
python_requires = >=3.8
1414
classifiers =
1515
Programming Language :: Python :: 3
1616
Programming Language :: Python :: 3 :: Only
17-
Programming Language :: Python :: 3.6
18-
Programming Language :: Python :: 3.7
1917
Programming Language :: Python :: 3.8
2018
Programming Language :: Python :: 3.9
2119
Programming Language :: Python :: 3.10
20+
Programming Language :: Python :: 3.11
21+
Programming Language :: Python :: 3.12
22+
Programming Language :: Python :: 3.13
23+
Programming Language :: Python :: 3.14
2224

2325
[options]
2426
packages = find:

setup.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
1-
from setuptools import setup
1+
from setuptools import Extension, setup
22
from Cython.Build import cythonize
33

4+
# ABI3 example from https://github.com/joerick/python-abi3-package-sample
5+
# Cython docs at
6+
# https://docs.cython.org/en/latest/src/userguide/limited_api.html
7+
#
8+
# Py_LIMITED_API values:
9+
#
10+
# 0x03080000 - Python 3.8 - the minimum version that Cython supports.
11+
# 0x030B0000 - Python 3.11 - support typed memoryviews.
12+
# 0x030C0000 - Python 3.12 - support vectorcall (performance improvement).
413

5-
setup(ext_modules=cythonize("cython_test_exception_raiser/raiser.pyx"))
14+
setup(
15+
ext_modules=cythonize([
16+
Extension(
17+
name="raiser",
18+
sources=["cython_test_exception_raiser/raiser.pyx"],
19+
define_macros=[
20+
# For now we are at python 3.8 as we still support 3.10.
21+
("Py_LIMITED_API", 0x03080000),
22+
],
23+
py_limited_api=True
24+
),
25+
]),
26+
options={"bdist_wheel": {"py_limited_api": "cp38"}},
27+
)

0 commit comments

Comments
 (0)