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

Update CI workflow #10

Merged
merged 13 commits into from
Oct 24, 2024
35 changes: 14 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: pip install black==22.8.0
- run: pip install black==24.10.0
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
Expand All @@ -32,7 +32,7 @@ jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
Expand All @@ -49,19 +49,16 @@ jobs:
rust: [stable]
python-version:
[
"3.7",
"3.8",
"3.9",
"3.10",
"3.11-dev",
"pypy-3.7",
"pypy-3.8",
"3.11",
"3.12",
"pypy-3.9",
]
platform:
[
{
os: "macOS-latest",
os: "macos-latest",
python-architecture: "x64",
rust-target: "x86_64-apple-darwin",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macos-latest runners are now arm:

Suggested change
python-architecture: "x64",
rust-target: "x86_64-apple-darwin",
python-architecture: "arm64",
rust-target: "aarch64-apple-darwin",

},
Expand All @@ -83,15 +80,11 @@ jobs:
]
exclude:
# PyPy doesn't release 32-bit Windows builds any more
- python-version: pypy-3.7
platform: { os: "windows-latest", python-architecture: "x86" }
- python-version: pypy-3.8
platform: { os: "windows-latest", python-architecture: "x86" }
- python-version: pypy-3.9
platform: { os: "windows-latest", python-architecture: "x86" }
include:
# Test minimal supported Rust version
- rust: 1.63.0
- rust: 1.70.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question on the MSRV bump. In PyO3 we support ranges of optional dependencies and have a helper script to downgrade them for the MSRV job to compatible versions. I'm unsure what the best option is here. Keeping the MSRV down is useful for linux distributions putting these packages in their package managers, e.g. PyO3/pyo3#3113

We last did an MSRV bump with PyO3 0.22 to 1.63, which is the current version supported by Debian stable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basing the MSRV on Debian stable and aligning it with PyO3's requirements, rather than targeting the latest version required by tokio, feel like the right approach (I'll revert back to 1.63). I'm just not sure of the best way to set this up in CI to avoid the error with tokio. The helper script sounds like what we need, but I'll need some time to figure it out.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now seems to be the last issue with CI, other than some warnings I'd like to address on another pass (some of the Rust toolchain installation actions are very outdated).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I can perhaps try to port that script tomorrow 👍

python-version: "3.10"
platform:
{
Expand All @@ -114,10 +107,10 @@ jobs:
extra_features: "nightly"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.platform.python-architecture }}
Expand Down Expand Up @@ -160,7 +153,7 @@ jobs:
needs: [fmt]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably update the coverage job to use cargo-llvm-cov and stable Rust (like PyO3 does). Possibly a follow-up?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted, I think it would be best to align with PyO3's practices. I'd like to take another pass at CI once we get the first release of pyo3-async-runtimes out the door.

Expand All @@ -174,10 +167,10 @@ jobs:
args: --all-features
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off"
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off"
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cllvm-args=--inline-threshold=0 -Clink-dead-code -Coverflow-checks=off"
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cllvm-args=--inline-threshold=0 -Clink-dead-code -Coverflow-checks=off"
- uses: actions-rs/[email protected]
id: coverage
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
file: ${{ steps.coverage.outputs.report }}
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ categories = ["api-bindings", "development-tools::ffi"]
license = "Apache-2.0"
exclude = ["/.gitignore", "/codecov.yml", "/Makefile"]
edition = "2021"
rust-version = "1.63"
rust-version = "1.70"

[workspace]
members = ["pyo3-asyncio-macros"]
Expand Down
Loading