diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 989ffed..0c2aa01 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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/checkout@v6.0.1 + - 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: @@ -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 @@ -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 }} @@ -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" diff --git a/CHANGELOG.md b/CHANGELOG.md index 96ef345..f257264 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ To see unreleased changes, please see the CHANGELOG on the main branch. +## [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) @@ -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 diff --git a/Cargo.toml b/Cargo.toml index 8d2a029..e31979e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] diff --git a/pyo3-async-runtimes-macros/Cargo.toml b/pyo3-async-runtimes-macros/Cargo.toml index 729854f..67c6467 100644 --- a/pyo3-async-runtimes-macros/Cargo.toml +++ b/pyo3-async-runtimes-macros/Cargo.toml @@ -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