Skip to content

Commit f789385

Browse files
authored
Merge pull request #3722 from PyO3/fix-doc-build
Fix missing feature flags in implementation of Either conversion.
2 parents be4d562 + 9120b35 commit f789385

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,22 @@ jobs:
313313
RUST_BACKTRACE: 1
314314
TRYBUILD: overwrite
315315

316+
docsrs:
317+
if: ${{ contains(github.event.pull_request.labels.*.name, 'CI-build-full') || (github.event_name != 'pull_request' && github.ref != 'refs/heads/main') }}
318+
needs: [fmt]
319+
runs-on: ubuntu-latest
320+
steps:
321+
- uses: actions/checkout@v4
322+
- uses: actions/setup-python@v4
323+
- uses: Swatinem/rust-cache@v2
324+
with:
325+
key: cargo-careful
326+
continue-on-error: true
327+
- uses: dtolnay/rust-toolchain@nightly
328+
with:
329+
components: rust-src
330+
- run: cargo rustdoc --lib --no-default-features --features full -Zunstable-options --config "build.rustdocflags=[\"--cfg\", \"docsrs\"]"
331+
316332
coverage:
317333
needs: [fmt]
318334
name: coverage-${{ matrix.os }}
@@ -387,6 +403,8 @@ jobs:
387403
run: nox -s test-emscripten
388404

389405
test-debug:
406+
needs: [fmt]
407+
if: github.ref != 'refs/heads/main'
390408
runs-on: ubuntu-latest
391409
steps:
392410
- uses: actions/checkout@v4
@@ -438,6 +456,7 @@ jobs:
438456
- build-full
439457
- valgrind
440458
- careful
459+
- docsrs
441460
- coverage
442461
- emscripten
443462
if: always()

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ members = [
128128

129129
[package.metadata.docs.rs]
130130
no-default-features = true
131-
features = ["macros", "num-bigint", "num-complex", "hashbrown", "serde", "multiple-pymethods", "indexmap", "eyre", "either", "chrono", "rust_decimal"]
131+
features = ["full"]
132132
rustdoc-args = ["--cfg", "docsrs"]
133133

134134
[workspace.lints.clippy]

src/conversions/either.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@
4343
//!
4444
//! [either](https://docs.rs/either/ "A library for easy idiomatic error handling and reporting in Rust applications")’s
4545
46+
#[cfg(feature = "experimental-inspect")]
47+
use crate::inspect::types::TypeInfo;
4648
use crate::{
47-
exceptions::PyTypeError, inspect::types::TypeInfo, FromPyObject, IntoPy, PyAny, PyObject,
48-
PyResult, Python, ToPyObject,
49+
exceptions::PyTypeError, FromPyObject, IntoPy, PyAny, PyObject, PyResult, Python, ToPyObject,
4950
};
5051
use either::Either;
5152

@@ -97,6 +98,7 @@ where
9798
}
9899
}
99100

101+
#[cfg(feature = "experimental-inspect")]
100102
fn type_input() -> TypeInfo {
101103
TypeInfo::union_of(&[L::type_input(), R::type_input()])
102104
}

0 commit comments

Comments
 (0)