Skip to content
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
83 changes: 28 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ jobs:
- name: Check rust formatting (rustfmt)
run: cargo fmt --all -- --check

resolve:
runs-on: ubuntu-latest
outputs:
MSRV: ${{ steps.resolve-msrv.outputs.MSRV }}
verbose: ${{ runner.debug == '1' }}
steps:
- uses: actions/[email protected]
- uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: resolve MSRV
id: resolve-msrv
run: echo MSRV=`python -c 'import tomllib; print(tomllib.load(open("Cargo.toml", "rb"))["workspace"]["package"]["rust-version"])'` >> $GITHUB_OUTPUT

clippy:
runs-on: ubuntu-latest
steps:
Expand All @@ -40,76 +54,33 @@ jobs:
- run: make clippy

build:
needs: [fmt] # don't wait for clippy as fails rarely and takes longer
needs: [fmt, resolve] # don't wait for clippy as fails rarely and takes longer
name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} ${{ matrix.msrv }}
runs-on: ${{ matrix.platform.os }}
strategy:
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",
"3.13t",
"3.14-dev",
"3.14t-dev",
"pypy-3.11",
]
platform:
[
{
os: "macos-latest",
python-architecture: "arm64",
rust-target: "aarch64-apple-darwin",
},
{
os: "ubuntu-latest",
python-architecture: "x64",
rust-target: "x86_64-unknown-linux-gnu",
},
{
os: "windows-latest",
python-architecture: "x64",
rust-target: "x86_64-pc-windows-msvc",
},
]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.13t", "3.14-dev", "3.14t-dev", "pypy-3.11"]
platform: [{os: "macos-latest", python-architecture: "arm64", rust-target: "aarch64-apple-darwin"}, {os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu"}, {os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc"}]
include:
# Test minimal supported Rust version
- rust: 1.74.0
- rust: ${{ needs.resolve.outputs.MSRV }}
python-version: "3.13"
platform:
{
os: "ubuntu-latest",
python-architecture: "x64",
rust-target: "x86_64-unknown-linux-gnu",
}
platform: {os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu"}
msrv: "MSRV"

# Test the `nightly` feature
- rust: nightly
python-version: "3.13"
platform:
{
os: "ubuntu-latest",
python-architecture: "x64",
rust-target: "x86_64-unknown-linux-gnu",
}
platform: {os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu"}
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",
}
platform: {os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc"}

steps:
- uses: actions/checkout@v4
Expand All @@ -126,6 +97,12 @@ jobs:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.platform.rust-target }}

- if: ${{ matrix.msrv == 'MSRV' }}
name: Lock package versions for MSRV
run: cargo +stable update
env:
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: fallback

- name: Build (no features)
run: cargo build --no-default-features --verbose --target ${{ matrix.platform.rust-target }}

Expand All @@ -142,14 +119,10 @@ jobs:
run: |
python -m pip install -U uvloop

- if: ${{ matrix.msrv != 'MSRV' && !startsWith(matrix.python-version, 'pypy') }}
- if: ${{ !startsWith(matrix.python-version, 'pypy') }}
name: Test
run: cargo test --all-features --target ${{ matrix.platform.rust-target }}

- if: ${{ matrix.msrv == 'MSRV' && !startsWith(matrix.python-version, 'pypy') }}
name: Test (MSRV, --no-default-features)
run: cargo test --no-default-features --features tokio-runtime,async-std-runtime,attributes,unstable-streams --target ${{ matrix.platform.rust-target }}

env:
RUST_BACKTRACE: 1
RUSTFLAGS: "-D warnings"
Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ To see unreleased changes, please see the CHANGELOG on the main branch.

<!-- towncrier release notes start -->

## [Unreleased]

- Bump MSRV to 1.83.

## [0.27.0] - 2025-10-20

- Avoid attaching to the runtime when cloning TaskLocals by using std::sync::Arc. [#62](https://github.com/PyO3/pyo3-async-runtimes/pull/62)
Expand Down Expand Up @@ -47,5 +51,10 @@ To see unreleased changes, please see the CHANGELOG on the main branch.

Previous versions were published from [`pyo3-asyncio`](https://github.com/awestlake87/pyo3-asyncio). Consult that library for older changes.

[Unreleased]: https://github.com/PyO3/pyo3-async-runtimes/compare/v0.22.0...HEAD
[Unreleased]: https://github.com/PyO3/pyo3-async-runtimes/compare/v0.27.0...HEAD
[0.27.0]: https://github.com/PyO3/pyo3-async-runtimes/compare/v0.26.0...v0.27.0
[0.26.0]: https://github.com/PyO3/pyo3-async-runtimes/compare/v0.25.0...v0.26.0
[0.25.0]: https://github.com/PyO3/pyo3-async-runtimes/compare/v0.24.0...v0.25.0
[0.24.0]: https://github.com/PyO3/pyo3-async-runtimes/compare/v0.23.0...v0.24.0
[0.23.0]: https://github.com/PyO3/pyo3-async-runtimes/compare/v0.22.0...v0.23.0
[0.22.0]: https://github.com/PyO3/pyo3-async-runtimes/tree/0.22.0
6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ documentation = "https://docs.rs/crate/pyo3-async-runtimes/"
categories = ["api-bindings", "development-tools::ffi"]
license = "Apache-2.0"
exclude = ["/.gitignore", "/codecov.yml", "/Makefile"]
edition = "2021"
rust-version = "1.74"
edition = { workspace = true }
rust-version = { workspace = true }

[workspace]
members = ["pyo3-async-runtimes-macros"]
package.edition = "2021"
package.rust-version = "1.83"

[features]
async-std-runtime = ["async-std"]
Expand Down
3 changes: 2 additions & 1 deletion pyo3-async-runtimes-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ repository = "https://github.com/PyO3/pyo3-async-runtimes"
documentation = "https://docs.rs/crate/pyo3-async-runtimes/"
categories = ["api-bindings", "development-tools::ffi"]
license = "Apache-2.0"
edition = "2018"
edition = { workspace = true }
rust-version = { workspace = true }

[lib]
proc-macro = true
Expand Down
Loading