Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add tests for 3.13t and pypy 3.10 #27

Merged
merged 4 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
fail-fast: false # If one platform fails, allow the rest to keep testing.
matrix:
rust: [stable]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.9"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.13t", "pypy-3.9", "pypy-3.10"]
platform:
[
{
Expand All @@ -65,11 +65,6 @@ jobs:
python-architecture: "x64",
rust-target: "x86_64-pc-windows-msvc",
},
{
os: "windows-latest",
python-architecture: "x86",
rust-target: "i686-pc-windows-msvc",
},
]
exclude:
# PyPy doesn't release 32-bit Windows builds any more
Expand All @@ -89,7 +84,7 @@ jobs:

# Test the `nightly` feature
- rust: nightly
python-version: "3.12"
python-version: "3.13"
platform:
{
os: "ubuntu-latest",
Expand All @@ -99,11 +94,16 @@ jobs:
msrv: "nightly"
extra_features: "nightly"

# Test 32-bit windows just on latest Python
- rust: stable
python-version: "3.13"
platform: { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" }

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: Quansight-Labs/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.platform.python-architecture }}
Expand All @@ -125,8 +125,8 @@ jobs:
- name: Build
run: cargo build --features=${{env.features}} --verbose --target ${{ matrix.platform.rust-target }}

# uvloop doesn't compile under Windows and PyPy
- if: ${{ matrix.platform.os != 'windows-latest' && !startsWith(matrix.python-version, 'pypy') }}
# uvloop doesn't compile under Windows and PyPy, nor for free-threaded Python
- if: ${{ matrix.platform.os != 'windows-latest' && !startsWith(matrix.python-version, 'pypy') && !endsWith(matrix.python-version, 't') }}
name: Install pyo3-asyncio test dependencies
run: |
python -m pip install -U uvloop
Expand Down
8 changes: 8 additions & 0 deletions pytests/test_async_std_uvloop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ fn main() -> pyo3::PyResult<()> {
pyo3::prepare_freethreaded_python();

Python::with_gil(|py| {
// uvloop not supported on the free-threaded build yet
// https://github.com/MagicStack/uvloop/issues/642
let sysconfig = py.import("sysconfig")?;
let is_freethreaded = sysconfig.call_method1("get_config_var", ("Py_GIL_DISABLED",))?;
if is_freethreaded.is_truthy()? {
return Ok(());
}

let uvloop = py.import("uvloop")?;
uvloop.call_method0("install")?;

Expand Down
8 changes: 8 additions & 0 deletions pytests/test_tokio_current_thread_uvloop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ fn main() -> pyo3::PyResult<()> {
});

Python::with_gil(|py| {
// uvloop not supported on the free-threaded build yet
// https://github.com/MagicStack/uvloop/issues/642
let sysconfig = py.import("sysconfig")?;
let is_freethreaded = sysconfig.call_method1("get_config_var", ("Py_GIL_DISABLED",))?;
if is_freethreaded.is_truthy()? {
return Ok(());
}

let uvloop = py.import("uvloop")?;
uvloop.call_method0("install")?;

Expand Down
8 changes: 8 additions & 0 deletions pytests/test_tokio_multi_thread_uvloop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ fn main() -> pyo3::PyResult<()> {
pyo3::prepare_freethreaded_python();

Python::with_gil(|py| {
// uvloop not supported on the free-threaded build yet
// https://github.com/MagicStack/uvloop/issues/642
let sysconfig = py.import("sysconfig")?;
let is_freethreaded = sysconfig.call_method1("get_config_var", ("Py_GIL_DISABLED",))?;
if is_freethreaded.is_truthy()? {
return Ok(());
}

let uvloop = py.import("uvloop")?;
uvloop.call_method0("install")?;

Expand Down
Loading