[MRG+1] CircleCI: run only modified examples in CircleCI#10407
[MRG+1] CircleCI: run only modified examples in CircleCI#10407glemaitre merged 10 commits intoscikit-learn:masterfrom
Conversation
6d60f90 to
6760067
Compare
|
To be sure I get this right, this would only apply in the case where only examples are modified but if for instance a PR brings changes to the code of an estimator CircleCI would still run all the examples right? |
|
Current behaviour: when no examples is modified we just run I think you can force the full doc build by adding [doc build] in your commit message. I need to check that this is not affected by this PR by the way. |
|
Seems like a reasonable idea given the current policy, as long as it all remains intelligible |
6760067 to
90711dc
Compare
4b4fcdb to
ebbc451
Compare
ebbc451 to
1eeab7f
Compare
|
I am making this MRG. I tested this:
|
They were changed to do some testing
doc/Makefile
Outdated
| @echo "Build finished. The HTML pages are in $(BUILDDIR)/html/stable." | ||
|
|
||
| html-pattern: | ||
| # These two lines make the build a bit more lengthy, and the |
There was a problem hiding this comment.
But the second is commented out
There was a problem hiding this comment.
Copied and pasted from html pattern (for better or worse) ...
doc/Makefile
Outdated
| @echo | ||
| @echo "Build finished. The HTML pages are in $(BUILDDIR)/html/stable." | ||
|
|
||
| html-pattern: |
There was a problem hiding this comment.
I'm not sure we need a new target here... Is it hard or problematic to just use the html target?
There was a problem hiding this comment.
I could not find a way to do it cleanly in the html target, suggestions more than welcome! The main reason: what should the default pattern be? If you set the default pattern in the Makefile, then it will override any change in conf.py: the pattern is set on the command-line of the sphinx-build command. I would expect conf.py to have the last word.
There was a problem hiding this comment.
I haven't tried, but can't you do something like
ifdef EXAMPLE_RE
EXAMPLE_OPT := -d blah=$(EXAMPLE_RE)
There was a problem hiding this comment.
Outside of any target, that is
doc/developers/contributing.rst
Outdated
| while. To save some time, you can use: | ||
| - ``make html-noplot``: this will generate the documentation without the | ||
| example gallery. This is useful when changing a docstring for example. | ||
| - ``PATTERN=your_regex_goes_here make html-pattern``: only the examples |
There was a problem hiding this comment.
Hmmm OK this is a regex so I am not sure EXAMPLES is a great name. Maybe EXAMPLES_PATTERN although I liked that the target suffix and the environment variable matched. Full disclosure: I copied the names from mne-python ...
| echo BUILD: detected examples/ filename modified in $git_range: $(echo "$filenames" | grep -e ^examples/ | head -n1) | ||
| echo BUILD: detected examples/ filename modified in $git_range: $changed_examples | ||
| pattern=$(echo "$changed_examples" | paste -sd '|') | ||
| echo "$pattern" |
There was a problem hiding this comment.
Happy to add a comment but maybe you can tell about what exactly? Maybe that $pattern is a regex that decides which examples will be run? Note that I have a comment like this when build_type is called below:
# pattern for examples to run is the last line of outputbut maybe this is not enough?
There was a problem hiding this comment.
I just meant to explain why it's printing
Other minor changes including variable renaming PATTERN -> EXAMPLES_PATTERN
|
I reuse the html make target following your suggestion @jnothman. Also tackled your other comments. |
|
I will have a look now. |
|
LGTM. merging, Thanks @lesteve !!! |
Great idea from mne-python. This should reduce the CircleCI build times (from ~45 minutes to ~10 minutes + example running time) when modifying examples.
I got this from sphinx-gallery/sphinx-gallery#321 (comment).
Need to beta test the PR before this can be merged.