Skip to content

Commit 57f1688

Browse files
authored
ci: add tests for 3.13t and pypy 3.10 (#27)
* ci: add tests for 3.13t and pypy 3.10 * skip uvloop tests on free-threaded build * only test 32-bit windows with latest Python * add rust toolchain hint
1 parent 6a29511 commit 57f1688

File tree

4 files changed

+34
-10
lines changed

4 files changed

+34
-10
lines changed

.github/workflows/ci.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ 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", "pypy-3.9"]
50+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.13t", "pypy-3.9", "pypy-3.10"]
5151
platform:
5252
[
5353
{
@@ -65,11 +65,6 @@ jobs:
6565
python-architecture: "x64",
6666
rust-target: "x86_64-pc-windows-msvc",
6767
},
68-
{
69-
os: "windows-latest",
70-
python-architecture: "x86",
71-
rust-target: "i686-pc-windows-msvc",
72-
},
7368
]
7469
exclude:
7570
# PyPy doesn't release 32-bit Windows builds any more
@@ -89,7 +84,7 @@ jobs:
8984

9085
# Test the `nightly` feature
9186
- rust: nightly
92-
python-version: "3.12"
87+
python-version: "3.13"
9388
platform:
9489
{
9590
os: "ubuntu-latest",
@@ -99,11 +94,16 @@ jobs:
9994
msrv: "nightly"
10095
extra_features: "nightly"
10196

97+
# Test 32-bit windows just on latest Python
98+
- rust: stable
99+
python-version: "3.13"
100+
platform: { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" }
101+
102102
steps:
103103
- uses: actions/checkout@v4
104104

105105
- name: Set up Python ${{ matrix.python-version }}
106-
uses: actions/setup-python@v5
106+
uses: Quansight-Labs/setup-python@v5
107107
with:
108108
python-version: ${{ matrix.python-version }}
109109
architecture: ${{ matrix.platform.python-architecture }}
@@ -125,8 +125,8 @@ jobs:
125125
- name: Build
126126
run: cargo build --features=${{env.features}} --verbose --target ${{ matrix.platform.rust-target }}
127127

128-
# uvloop doesn't compile under Windows and PyPy
129-
- if: ${{ matrix.platform.os != 'windows-latest' && !startsWith(matrix.python-version, 'pypy') }}
128+
# uvloop doesn't compile under Windows and PyPy, nor for free-threaded Python
129+
- if: ${{ matrix.platform.os != 'windows-latest' && !startsWith(matrix.python-version, 'pypy') && !endsWith(matrix.python-version, 't') }}
130130
name: Install pyo3-asyncio test dependencies
131131
run: |
132132
python -m pip install -U uvloop

pytests/test_async_std_uvloop.rs

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ fn main() -> pyo3::PyResult<()> {
44
pyo3::prepare_freethreaded_python();
55

66
Python::with_gil(|py| {
7+
// uvloop not supported on the free-threaded build yet
8+
// https://github.com/MagicStack/uvloop/issues/642
9+
let sysconfig = py.import("sysconfig")?;
10+
let is_freethreaded = sysconfig.call_method1("get_config_var", ("Py_GIL_DISABLED",))?;
11+
if is_freethreaded.is_truthy()? {
12+
return Ok(());
13+
}
14+
715
let uvloop = py.import("uvloop")?;
816
uvloop.call_method0("install")?;
917

pytests/test_tokio_current_thread_uvloop.rs

+8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ fn main() -> pyo3::PyResult<()> {
1313
});
1414

1515
Python::with_gil(|py| {
16+
// uvloop not supported on the free-threaded build yet
17+
// https://github.com/MagicStack/uvloop/issues/642
18+
let sysconfig = py.import("sysconfig")?;
19+
let is_freethreaded = sysconfig.call_method1("get_config_var", ("Py_GIL_DISABLED",))?;
20+
if is_freethreaded.is_truthy()? {
21+
return Ok(());
22+
}
23+
1624
let uvloop = py.import("uvloop")?;
1725
uvloop.call_method0("install")?;
1826

pytests/test_tokio_multi_thread_uvloop.rs

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ fn main() -> pyo3::PyResult<()> {
55
pyo3::prepare_freethreaded_python();
66

77
Python::with_gil(|py| {
8+
// uvloop not supported on the free-threaded build yet
9+
// https://github.com/MagicStack/uvloop/issues/642
10+
let sysconfig = py.import("sysconfig")?;
11+
let is_freethreaded = sysconfig.call_method1("get_config_var", ("Py_GIL_DISABLED",))?;
12+
if is_freethreaded.is_truthy()? {
13+
return Ok(());
14+
}
15+
816
let uvloop = py.import("uvloop")?;
917
uvloop.call_method0("install")?;
1018

0 commit comments

Comments
 (0)