-
Notifications
You must be signed in to change notification settings - Fork 893
Implement rustdoc-scrape-examples #2070
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
Changes from 3 commits
6afd80a
9512ce4
eccdcf7
ff202f4
4d1d859
ac66392
8c29709
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| [alias] | ||
| pyo3_doc = "doc --lib --no-default-features --features=full --no-deps --workspace --open --exclude pyo3-macros --exclude pyo3-macros-backend" | ||
| pyo3_doc_scrape = "doc --lib --no-default-features --features=full --no-deps --workspace --open --exclude pyo3-macros --exclude pyo3-macros-backend -Z unstable-options -Z rustdoc-scrape-examples=examples" | ||
| pyo3_doc_internal = "doc --lib --no-default-features --features=full --no-deps --workspace --open --document-private-items -Z unstable-options -Z rustdoc-scrape-examples=examples" | ||
|
|
||
| [build] | ||
| rustdocflags = ["--cfg", "docsrs"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,8 +64,8 @@ jobs: | |
| echo "suppress_build_script_link_lines=true" >> config.txt | ||
| PYO3_BUILD_CONFIG=$(pwd)/config.txt cargo check --all-targets --no-default-features | ||
| PYO3_BUILD_CONFIG=$(pwd)/config.txt cargo check --all-targets --no-default-features --features "abi3" | ||
| PYO3_BUILD_CONFIG=$(pwd)/config.txt cargo check --all-targets --no-default-features --features "$(make list_all_additive_features)" | ||
| PYO3_BUILD_CONFIG=$(pwd)/config.txt cargo check --all-targets --no-default-features --features "abi3 $(make list_all_additive_features)" | ||
| PYO3_BUILD_CONFIG=$(pwd)/config.txt cargo check --all-targets --no-default-features --features full | ||
| PYO3_BUILD_CONFIG=$(pwd)/config.txt cargo check --all-targets --no-default-features --features "abi3 full" | ||
mejrs marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| done | ||
|
|
||
| build: | ||
|
|
@@ -146,20 +146,14 @@ jobs: | |
| name: Prepare LD_LIBRARY_PATH (Ubuntu only) | ||
| run: echo LD_LIBRARY_PATH=${pythonLocation}/lib >> $GITHUB_ENV | ||
|
|
||
| - name: Prepare workflow settings | ||
| id: settings | ||
| shell: bash | ||
| run: | | ||
| echo "::set-output name=all_additive_features::$(make list_all_additive_features)" | ||
|
|
||
| - if: matrix.msrv == 'MSRV' | ||
| name: Prepare minimal package versions (MSRV only) | ||
| run: | | ||
| cargo update -p indexmap --precise 1.6.2 | ||
| cargo update -p hashbrown:0.11.2 --precise 0.9.1 | ||
|
|
||
| - name: Build docs | ||
| run: cargo doc --no-deps --no-default-features --features "${{ steps.settings.outputs.all_additive_features }}" | ||
| run: cargo doc --no-deps --no-default-features --features full | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this become There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, would you be OK with removing this step? Building docs is also tested in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm, I do think there's value in checking the docs build on all each of windows, Linux and macos. Probably doesn't need to be run for each Python variant. Could make it 3.10-only? |
||
|
|
||
| - name: Build (no features) | ||
| run: cargo build --lib --tests --no-default-features | ||
|
|
@@ -182,26 +176,26 @@ jobs: | |
| cargo test --no-default-features | ||
|
|
||
| - name: Build (all additive features) | ||
| run: cargo build --lib --tests --no-default-features --features "${{ steps.settings.outputs.all_additive_features }}" | ||
| run: cargo build --lib --tests --no-default-features --features full | ||
|
|
||
| - if: ${{ startsWith(matrix.python-version, 'pypy') }} | ||
| name: Build PyPy (abi3-py37) | ||
| run: cargo build --lib --tests --no-default-features --features "abi3-py37 ${{ steps.settings.outputs.all_additive_features }}" | ||
| run: cargo build --lib --tests --no-default-features --features "abi3-py37 full" | ||
|
|
||
| # Run tests (except on PyPy, because no embedding API). | ||
| - if: ${{ !startsWith(matrix.python-version, 'pypy') }} | ||
| name: Test | ||
| run: cargo test --no-default-features --features "${{ steps.settings.outputs.all_additive_features }}" | ||
| run: cargo test --no-default-features --features full | ||
|
|
||
| # Run tests again, but in abi3 mode | ||
| - if: ${{ !startsWith(matrix.python-version, 'pypy') }} | ||
| name: Test (abi3) | ||
| run: cargo test --no-default-features --features "abi3 ${{ steps.settings.outputs.all_additive_features }}" | ||
| run: cargo test --no-default-features --features "abi3 full" | ||
|
|
||
| # Run tests again, for abi3-py37 (the minimal Python version) | ||
| - if: ${{ (!startsWith(matrix.python-version, 'pypy')) && (matrix.python-version != '3.7') }} | ||
| name: Test (abi3-py37) | ||
| run: cargo test --no-default-features --features "abi3-py37 ${{ steps.settings.outputs.all_additive_features }}" | ||
| run: cargo test --no-default-features --features "abi3-py37 full" | ||
|
|
||
| - name: Test proc-macro code | ||
| run: cargo test --manifest-path=pyo3-macros-backend/Cargo.toml | ||
|
|
@@ -281,8 +275,8 @@ jobs: | |
| cargo llvm-cov clean --workspace | ||
| cargo llvm-cov --package $ALL_PACKAGES --no-report | ||
| cargo llvm-cov --package $ALL_PACKAGES --no-report --features abi3 | ||
| cargo llvm-cov --package $ALL_PACKAGES --no-report --features $(make list_all_additive_features) | ||
| cargo llvm-cov --package $ALL_PACKAGES --no-report --features abi3 $(make list_all_additive_features) | ||
| cargo llvm-cov --package $ALL_PACKAGES --no-report --features full | ||
| cargo llvm-cov --package $ALL_PACKAGES --no-report --features "abi3 full" | ||
| cargo llvm-cov --package $ALL_PACKAGES --no-run --lcov --output-path coverage.lcov | ||
| shell: bash | ||
| env: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| @Counter | ||
| def say_hello(): | ||
| print("hello") | ||
|
|
||
|
|
||
| say_hello() | ||
| say_hello() | ||
| say_hello() | ||
| say_hello() | ||
|
|
||
| assert say_hello.count == 4 |
Uh oh!
There was an error while loading. Please reload this page.