From 53473eff9ac4ee09dac747aad60772273df3a534 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 14 Apr 2024 21:28:26 +0200 Subject: [PATCH 1/4] docs: Make contributing.md slightly more clear for newer contributors --- .github/pull_request_template.md | 2 +- Contributing.md | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index b344525cabe..11375e966b3 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -8,6 +8,6 @@ Please consider adding the following to your pull request: - docs to all new functions and / or detail in the guide - tests for all new or changed functions -PyO3's CI pipeline will check your pull request. To run its tests +PyO3's CI pipeline will check your pull request, thus make sure you have checked the `Contributing.md` guidelines. To run most of its tests locally, you can run ```nox```. See ```nox --list-sessions``` for a list of supported actions. diff --git a/Contributing.md b/Contributing.md index 054099b431a..11f9c4642f7 100644 --- a/Contributing.md +++ b/Contributing.md @@ -92,9 +92,23 @@ Here are a few things to note when you are writing PRs. ### Continuous Integration -The PyO3 repo uses GitHub Actions. PRs are blocked from merging if CI is not successful. +The PyO3 repo uses GitHub Actions. PRs are blocked from merging if CI is not successful. Formatting, linting and tests are checked for all Rust and Python code. In addition, all warnings in Rust code are disallowed (using `RUSTFLAGS="-D warnings"`). -Formatting, linting and tests are checked for all Rust and Python code. In addition, all warnings in Rust code are disallowed (using `RUSTFLAGS="-D warnings"`). +#### Linting Python code +`nox -s ruff` + +#### Linting Rust code +`nox -s rustfmt` + +#### Semver checks +`cargo semver-checks check-release` + +#### Clippy +`nox -s clippy-all` + +#### Tests +`cargo test --features full` +``` Tests run with all supported Python versions with the latest stable Rust compiler, as well as for Python 3.9 with the minimum supported Rust version. From cbca542fc41e9182462ab7d9294defdea458157d Mon Sep 17 00:00:00 2001 From: David Date: Sun, 14 Apr 2024 22:08:08 +0200 Subject: [PATCH 2/4] Remove accidental backticks Rearrange overview of commands --- Contributing.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Contributing.md b/Contributing.md index 11f9c4642f7..d95c5df037d 100644 --- a/Contributing.md +++ b/Contributing.md @@ -94,6 +94,10 @@ Here are a few things to note when you are writing PRs. The PyO3 repo uses GitHub Actions. PRs are blocked from merging if CI is not successful. Formatting, linting and tests are checked for all Rust and Python code. In addition, all warnings in Rust code are disallowed (using `RUSTFLAGS="-D warnings"`). +Tests run with all supported Python versions with the latest stable Rust compiler, as well as for Python 3.9 with the minimum supported Rust version. + +If you are adding a new feature, you should add it to the `full` feature in our *Cargo.toml** so that it is tested in CI. + #### Linting Python code `nox -s ruff` @@ -108,11 +112,7 @@ The PyO3 repo uses GitHub Actions. PRs are blocked from merging if CI is not suc #### Tests `cargo test --features full` -``` - -Tests run with all supported Python versions with the latest stable Rust compiler, as well as for Python 3.9 with the minimum supported Rust version. -If you are adding a new feature, you should add it to the `full` feature in our *Cargo.toml** so that it is tested in CI. You can run these tests yourself with `nox`. Use `nox -l` to list the full set of subcommands you can run. From 531b4e0e7ff3cf2813f435f76f4f24b1bb426540 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 14 Apr 2024 22:09:28 +0200 Subject: [PATCH 3/4] Placed on wrong line --- Contributing.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Contributing.md b/Contributing.md index d95c5df037d..a869cb0b67e 100644 --- a/Contributing.md +++ b/Contributing.md @@ -98,6 +98,9 @@ Tests run with all supported Python versions with the latest stable Rust compile If you are adding a new feature, you should add it to the `full` feature in our *Cargo.toml** so that it is tested in CI. +You can run these tests yourself with +`nox`. Use `nox -l` to list the full set of subcommands you can run. + #### Linting Python code `nox -s ruff` @@ -113,10 +116,6 @@ If you are adding a new feature, you should add it to the `full` feature in our #### Tests `cargo test --features full` - -You can run these tests yourself with -`nox`. Use `nox -l` to list the full set of subcommands you can run. - #### UI Tests PyO3 uses [`trybuild`][trybuild] to develop UI tests to capture error messages from the Rust compiler for some of the macro functionality. From 178a1b6fe444f08d20e0af1dc4b9620850a4e76a Mon Sep 17 00:00:00 2001 From: David Date: Sun, 14 Apr 2024 23:03:29 +0200 Subject: [PATCH 4/4] Add extra overview command --- Contributing.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Contributing.md b/Contributing.md index a869cb0b67e..111e814ac8f 100644 --- a/Contributing.md +++ b/Contributing.md @@ -116,6 +116,9 @@ You can run these tests yourself with #### Tests `cargo test --features full` +#### Check all conditional compilation +`nox -s check-feature-powerset` + #### UI Tests PyO3 uses [`trybuild`][trybuild] to develop UI tests to capture error messages from the Rust compiler for some of the macro functionality.