Skip to content

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

Merged
merged 7 commits into from
Dec 28, 2021
Merged

Implement rustdoc-scrape-examples #2070

merged 7 commits into from
Dec 28, 2021

Conversation

mejrs
Copy link
Member

@mejrs mejrs commented Dec 22, 2021

This implements rustdoc-scrape-examples for the docs that we host ourselves (not the docs.rs ones - I figure it's best to see how this goes first). Example.

This also:

  • Implements a full feature that incorporates all additional features
  • Resolves #2053
  • Fixes a link I messed up on the __call__ example in the guide
  • Fixes some links to anyhow and eyre's documentation
  • Adds cargo aliases for rendering docs
  • Renders and hosts internal documentation: Example

Note that this creates a dead link to "decorator" in the sidebar. This should be fixed by rust-lang/rust#92146

I also haven't touched the makefile yet - should I?

Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Nice, this looks great to me!

Few various tidy-up suggestions etc.

I also haven't touched the makefile yet - should I?

If you agree we should move towards cargo aliases (with "xtask" like in #2067 for more complex scripts), we can work to kill off the Makefile? If so, then don't worry about updating it here.

- 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
Copy link
Member

Choose a reason for hiding this comment

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

Should this become cargo pyo3_doc ?

Copy link
Member Author

Choose a reason for hiding this comment

The 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 guide.yml.

Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Looks good to me! Feel free to merge this as-is. I'll let you decide whether to change the docs build CI step here or in a follow up PR.

@mejrs
Copy link
Member Author

mejrs commented Dec 28, 2021

Looks good to me! Feel free to merge this as-is. I'll let you decide whether to change the docs build CI step here or in a follow up PR.

I'm not sure I even want to change it now, seeing as it seems to work fine as it is (I'm guessing the rustdocflags don't get passed for some reason?).

Moving it to guide.yml and rendering docs for each possible combination of cfgs would require rebuilding pyo3 for each of those (?).

@davidhewitt
Copy link
Member

Mmm ok, let's keep as-is for now!

@davidhewitt davidhewitt merged commit 7c2c4da into PyO3:main Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No API docs for pyo3-build-config and others on main
2 participants