Skip to content

Commit 5e6c5b7

Browse files
authored
ci: test 3.14, configure trusted publishing (#55)
* ci: test 3.14, configure trusted publishing * 3.14 is prerelease * don't test uvloop on 3.14 * also fixup tests
1 parent d85ac62 commit 5e6c5b7

File tree

5 files changed

+56
-12
lines changed

5 files changed

+56
-12
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,18 @@ jobs:
4747
fail-fast: false # If one platform fails, allow the rest to keep testing.
4848
matrix:
4949
rust: [stable]
50-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.13t", "pypy-3.9", "pypy-3.10"]
50+
python-version:
51+
[
52+
"3.9",
53+
"3.10",
54+
"3.11",
55+
"3.12",
56+
"3.13",
57+
"3.13t",
58+
"3.14-dev",
59+
"3.14t-dev",
60+
"pypy-3.11",
61+
]
5162
platform:
5263
[
5364
{
@@ -66,10 +77,6 @@ jobs:
6677
rust-target: "x86_64-pc-windows-msvc",
6778
},
6879
]
69-
exclude:
70-
# PyPy doesn't release 32-bit Windows builds any more
71-
- python-version: pypy-3.9
72-
platform: { os: "windows-latest", python-architecture: "x86" }
7380
include:
7481
# Test minimal supported Rust version
7582
- rust: 1.63.0
@@ -97,7 +104,12 @@ jobs:
97104
# Test 32-bit windows just on latest Python
98105
- rust: stable
99106
python-version: "3.13"
100-
platform: { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" }
107+
platform:
108+
{
109+
os: "windows-latest",
110+
python-architecture: "x86",
111+
rust-target: "i686-pc-windows-msvc",
112+
}
101113

102114
steps:
103115
- uses: actions/checkout@v4
@@ -126,9 +138,13 @@ jobs:
126138
- name: Build
127139
run: cargo build --features=${{env.features}} --verbose --target ${{ matrix.platform.rust-target }}
128140

129-
# uvloop doesn't compile under Windows and PyPy, nor for free-threaded Python
130-
- if: ${{ matrix.platform.os != 'windows-latest' && !startsWith(matrix.python-version, 'pypy') && !endsWith(matrix.python-version, 't') }}
131-
name: Install pyo3-asyncio test dependencies
141+
# uvloop doesn't compile under
142+
# Windows, https://github.com/MagicStack/uvloop/issues/536,
143+
# nor PyPy, https://github.com/MagicStack/uvloop/issues/537
144+
# nor for free-threaded Python, see https://github.com/MagicStack/uvloop/issues/642
145+
# nor on 3.14, see https://github.com/MagicStack/uvloop/issues/637
146+
- if: ${{ matrix.platform.os != 'windows-latest' && !startsWith(matrix.python-version, 'pypy') && !endsWith(matrix.python-version, 't') && !startsWith(matrix.python-version, '3.14') }}
147+
name: Install uvloop
132148
run: |
133149
python -m pip install -U uvloop
134150

.github/workflows/release.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,31 @@ on:
44
push:
55
tags:
66
- "v*"
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: The version to build
711

812
jobs:
913
release:
14+
permissions:
15+
id-token: write
16+
1017
runs-on: ubuntu-latest
1118
environment: release
1219
steps:
13-
- name: Checkout repository
14-
uses: actions/checkout@v4
20+
- uses: actions/checkout@v5
21+
with:
22+
# The tag to build or the tag received by the tag event
23+
ref: ${{ github.event.inputs.version || github.ref }}
24+
persist-credentials: false
1525

1626
- uses: dtolnay/rust-toolchain@stable
1727

28+
- uses: rust-lang/crates-io-auth-action@v1
29+
id: auth
30+
1831
- name: Publish to crates.io
1932
run: make publish
2033
env:
21-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
34+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

pytests/test_async_std_uvloop.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ fn main() -> pyo3::PyResult<()> {
1212
return Ok(());
1313
}
1414

15+
// uvloop not yet supported on 3.14
16+
if py.version_info() >= (3, 14) {
17+
return Ok(());
18+
}
19+
1520
let uvloop = py.import("uvloop")?;
1621
uvloop.call_method0("install")?;
1722

pytests/test_tokio_current_thread_uvloop.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ fn main() -> pyo3::PyResult<()> {
2121
return Ok(());
2222
}
2323

24+
// uvloop not yet supported on 3.14
25+
if py.version_info() >= (3, 14) {
26+
return Ok(());
27+
}
28+
2429
let uvloop = py.import("uvloop")?;
2530
uvloop.call_method0("install")?;
2631

pytests/test_tokio_multi_thread_uvloop.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ fn main() -> pyo3::PyResult<()> {
1313
return Ok(());
1414
}
1515

16+
// uvloop not yet supported on 3.14
17+
if py.version_info() >= (3, 14) {
18+
return Ok(());
19+
}
20+
1621
let uvloop = py.import("uvloop")?;
1722
uvloop.call_method0("install")?;
1823

0 commit comments

Comments
 (0)