From 2564ca4e7558396f166837d8795f8e1bfd698007 Mon Sep 17 00:00:00 2001 From: Adam Reichold Date: Tue, 2 Jan 2024 09:52:45 +0100 Subject: [PATCH 1/3] Fix missing feature flags in implementation of Either conversion. --- src/conversions/either.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/conversions/either.rs b/src/conversions/either.rs index 4a41d2bd..759b282e 100644 --- a/src/conversions/either.rs +++ b/src/conversions/either.rs @@ -43,9 +43,10 @@ //! //! [either](https://docs.rs/either/ "A library for easy idiomatic error handling and reporting in Rust applications")’s +#[cfg(feature = "experimental-inspect")] +use crate::inspect::types::TypeInfo; use crate::{ - exceptions::PyTypeError, inspect::types::TypeInfo, FromPyObject, IntoPy, PyAny, PyObject, - PyResult, Python, ToPyObject, + exceptions::PyTypeError, FromPyObject, IntoPy, PyAny, PyObject, PyResult, Python, ToPyObject, }; use either::Either; @@ -97,6 +98,7 @@ where } } + #[cfg(feature = "experimental-inspect")] fn type_input() -> TypeInfo { TypeInfo::union_of(&[L::type_input(), R::type_input()]) } From 2e79c557ccc628d4081661a712463e22fc780c92 Mon Sep 17 00:00:00 2001 From: Adam Reichold Date: Tue, 2 Jan 2024 10:03:11 +0100 Subject: [PATCH 2/3] Add CI job to test the equivalent of a docs.rs build. --- .github/workflows/ci.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2342e33d..75bcfc1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -313,6 +313,22 @@ jobs: RUST_BACKTRACE: 1 TRYBUILD: overwrite + docsrs: + if: ${{ contains(github.event.pull_request.labels.*.name, 'CI-build-full') || (github.event_name != 'pull_request' && github.ref != 'refs/heads/main') }} + needs: [fmt] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + - uses: Swatinem/rust-cache@v2 + with: + key: cargo-careful + continue-on-error: true + - uses: dtolnay/rust-toolchain@nightly + with: + components: rust-src + - run: cargo rustdoc --lib --no-default-features --features "macros num-bigint num-complex hashbrown serde multiple-pymethods indexmap eyre either chrono rust_decimal" -Zunstable-options --config "build.rustdocflags=[\"--cfg\", \"docsrs\"]" + coverage: needs: [fmt] name: coverage-${{ matrix.os }} @@ -387,6 +403,8 @@ jobs: run: nox -s test-emscripten test-debug: + needs: [fmt] + if: github.ref != 'refs/heads/main' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -438,6 +456,7 @@ jobs: - build-full - valgrind - careful + - docsrs - coverage - emscripten if: always() From 9120b35f3553c231797bf2dc357fcd4fe0bf5dec Mon Sep 17 00:00:00 2001 From: Adam Reichold Date: Tue, 2 Jan 2024 18:55:13 +0100 Subject: [PATCH 3/3] Include the experimental-inspect feature for the docs.rs build thereby making it equivalent to a full build. --- .github/workflows/ci.yml | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75bcfc1b..f12c5809 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -327,7 +327,7 @@ jobs: - uses: dtolnay/rust-toolchain@nightly with: components: rust-src - - run: cargo rustdoc --lib --no-default-features --features "macros num-bigint num-complex hashbrown serde multiple-pymethods indexmap eyre either chrono rust_decimal" -Zunstable-options --config "build.rustdocflags=[\"--cfg\", \"docsrs\"]" + - run: cargo rustdoc --lib --no-default-features --features full -Zunstable-options --config "build.rustdocflags=[\"--cfg\", \"docsrs\"]" coverage: needs: [fmt] diff --git a/Cargo.toml b/Cargo.toml index 5bd9855f..59261dd0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -128,7 +128,7 @@ members = [ [package.metadata.docs.rs] no-default-features = true -features = ["macros", "num-bigint", "num-complex", "hashbrown", "serde", "multiple-pymethods", "indexmap", "eyre", "either", "chrono", "rust_decimal"] +features = ["full"] rustdoc-args = ["--cfg", "docsrs"] [workspace.lints.clippy]