Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DOC/BUILD add ability for conf to skip whole sections#24907

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jklymak merged 1 commit intomatplotlib:mainfromjklymak:doc-conf-with-shortcuts
Jan 14, 2023

Conversation

jklymak
Copy link
Member

@jklymakjklymak commentedJan 8, 2023
edited
Loading

PR Summary

UPDATE: 11 Jan:

The doc build is painfully slow. This gives devs an easy way to populateexclude_patterns inconf.py with subdirectories they do not want while they are doing development,and to not do the gallery builds if those subdirectories are excluded. Of course the resulting build is broken with dropped references etc, so the developer should putconf.py back to its pristine state, but this should be a handy tool.

Note to build just theuser subdirectory using this takes 5s on my machine (if I exclude theprev_whats_new).

Closes#24906

Behaviour:

The interface ismake html-skip-subdirs which calls$(SPHINXBUILD) -D skip_sub_dirs=1 -b html ....

It tries to readdoc/.mpl_skip_subdirs.yaml. If that does not exist, that file is created and looks like:

comment:For use with make html-skip-subdirsskip_subdirs:-users/prev_whats_new/*-api/*-gallery/*-tutorials/*-plot_types/*-devel/*

If all ofgallery/* (etc) is skipped, then sphinx-gallery does not get run on that subdirectory. OTOH if only subdirectories of it are skipped, then the whole gallery is run (only once though, if gallery not previously generated).

With the above default theusers/* directory is built in 5 seconds on my machine, in contrast to the full doc build that takes upwards of 10 minutes.

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (andpytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a.. versionadded:: directive in the docstring and documented indoc/users/next_whats_new/
  • API changes are marked with a.. versionchanged:: directive in the docstring and documented indoc/api/next_api_changes/
  • Release notes conform with instructions innext_whats_new/README.rst ornext_api_changes/README.rst

melissawm reacted with eyes emoji
@jklymakjklymak added the Documentation: buildbuilding the docs labelJan 8, 2023
@story645
Copy link
Member

if this was gonna go in, any way to pass in the exclusions on the command line?

@jklymak
Copy link
MemberAuthor

I think via environment variables is the only way and that is pretty ugly. Even command line is pretty ugly with a bunch of excludes.

@rcomer
Copy link
Member

I think via environment variables is the only way and that is pretty ugly. Even command line is pretty ugly with a bunch of excludes.

I’m wondering whether it would be easy or desirable to do it with some sort of config file that is git-ignored. Then you could set it to whatever you like for local building and not need to revert each time you push.

Downside would be that I guess it would persist when you check out some other branch. I would likely forget about it and get confused about what’s going on with my doc build…

story645 reacted with thumbs up emoji

@story645
Copy link
Member

I would likely forget about it and get confused about what’s going on with my doc build…

could add a line to the conf printing excluded folders/files

@rcomer
Copy link
Member

I would likely forget about it and get confused about what’s going on with my doc build…

could add a line to the conf printing excluded folders/files

Possibly hard to spot amongst all the other output from the doc build?

@story645
Copy link
Member

story645 commentedJan 8, 2023
edited
Loading

Possibly hard to spot amongst all the other output from the doc build?

I'd put it at the very top b/f the sphinx generated output, where there really isn't much:

image

also possibly add a space/ "SPHINX OUTPUT BEGINS NOW" header between these two sections.

rcomer reacted with thumbs up emoji

@jklymak
Copy link
MemberAuthor

This commit adds amake html-skip-dirs option, andmake html goes back to a full build. Still have to edit theconf.py.

It would be pretty easy to add a config file for this, but I hesitate just because I don't quite understand how that actually is git ignored. Either we distribute an example config file, or we don't. If we don't, then adding it to the gitignore is fine, but then users need to make it themselves by hand. Is that what we want?

rcomer and story645 reacted with thumbs up emoji

@rcomer
Copy link
Member

@jklymak fair point.

It occurs to me that the contributor could also just not stage theirconf.py changes. Though that for me would mean having to break thegit commit -a habit!

@jklymak
Copy link
MemberAuthor

I docommit -a all the time as well. But I'd dogit restore conf.py to get it back to its original state.

But I guess having the user make askip-dir.yml or something isn't very hard and could be in the comments of Makefile

eg.

skip_dirs: users/prev_whats_new/*   - gallery/*   - api/*   - tutorials/*   - plot_types/*   - devel/*

should work.

@jklymakjklymakforce-pushed thedoc-conf-with-shortcuts branch 3 times, most recently from00b53a6 to47ad4a2CompareJanuary 9, 2023 02:32
@jklymak
Copy link
MemberAuthor

OK, latest commit does this via a yaml.make html-skip-subdirs will makedoc/.mpl_skip_subdirs.yaml with a default minimal build. The user can add or subtract entries to this (including commenting things out). Or if they remove it, it will get generated again whenmake html-skip-subdirs is called. This is.gitignore-d

story645 and rcomer reacted with thumbs up emoji

@story645
Copy link
Member

Any chance you have a windows machine to update the make.bat? Otherwise thats a good first issue follow up. I think here it's gonna be basically the same command? )

@jklymak
Copy link
MemberAuthor

I just pushed a change to make.bat. No idea if it works ;-)

@jklymakjklymakforce-pushed thedoc-conf-with-shortcuts branch 3 times, most recently from8b612e5 tobcb08eaCompareJanuary 9, 2023 04:24
@tacaswelltacaswell added this to thev3.8.0 milestoneJan 9, 2023
@jklymakjklymakforce-pushed thedoc-conf-with-shortcuts branch from1290285 tode27da7CompareJanuary 11, 2023 21:18
@jklymak
Copy link
MemberAuthor

Rebased so all tests should pass.

I know folks are busy with the release, but I'll agitate for this one a bit. a) it's a huge convenience for folks who are just changing a small part of the docs and b) it's also not user-facing, so the interface need not be set in stone. I've updated the proposal in the description above.

story645 reacted with thumbs up emoji

@QuLogic
Copy link
Member

QuLogic commentedJan 12, 2023
edited
Loading

As a note, one can set something inconf.py from thecommand line via -D setting=value. However, I believe that doing so would mean that you could not check that value within the file itself, and you would need to move the processing of the value to another extension.

@jklymakjklymakforce-pushed thedoc-conf-with-shortcuts branch 2 times, most recently frome2b90ac to7047f32CompareJanuary 12, 2023 21:45
@story645story645force-pushed thedoc-conf-with-shortcuts branch 2 times, most recently from814f9cd to0896b1fCompareJanuary 13, 2023 00:53
@jklymakjklymakforce-pushed thedoc-conf-with-shortcuts branch from0896b1f to2541f23CompareJanuary 13, 2023 02:50
@jklymak
Copy link
MemberAuthor

squashed...

@jklymak
Copy link
MemberAuthor

I'll self merge this, because I want to use it ;-) and it's not at all user-facing.

@jklymakjklymak merged commit651a874 intomatplotlib:mainJan 14, 2023
@jklymakjklymak deleted the doc-conf-with-shortcuts branchJanuary 14, 2023 04:25
@rcomer
Copy link
Member

It did have two approvals. Thanks@jklymak I am using this already 👍

jklymak and story645 reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@anntzeranntzeranntzer left review comments

@rcomerrcomerrcomer left review comments

@tacaswelltacaswelltacaswell approved these changes

@story645story645story645 approved these changes

Assignees
No one assigned
Labels
Documentation: buildbuilding the docs
Projects
None yet
Milestone
v3.8.0
Development

Successfully merging this pull request may close these issues.

[DOC/BUILD] add ability to selectively build docs
6 participants
@jklymak@story645@rcomer@QuLogic@tacaswell@anntzer

[8]ページ先頭

©2009-2025 Movatter.jp