DOC: Set default as -j 1
for spin docs and move -W
to SPHINXOPTS
#26478
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit tries to solve two problems.
--jobs
to1
. This matchesspin test
.-W
option is currently hardcoded in ALLSPHINXOPTS and impossible to override. This commit moves-W
to SPHINXOPTS which allows a local machine to remove -W if needed, as described in the documentation. This adds to the discussion in PR DOC: Bump pydata-sphinx-theme version #26125.[skip actions] [skip azp] [skip cirrus]
Context
While trying to build a workflow that incorporates
spin docs
, I encountered two issues. First, I noticed that the the following suggestion in the spin documentation was invalid.numpy/.spin/cmds.py
Lines 142 to 145 in fba4fc1
The fact that
-W
is hard coded inALLSPHINXOPTS
makes it impossible to remove without changing the makefile.The second issue is the known error message
This was fixed for those using
make
by removing-j2
fromSPHINXOPTS
. The circle build usesmake
but new users are directed to usespin docs
. When someone runsSPHINXOPTS="-n" make -e html
everything works fine. When someone runsspin docs
, the generated doc build command isThe problem is
-j auto
. RunningSPHINXOPTS="-j 1" spin docs
generatesThe problem remains. Using
spin docs -j 1
instead ofSPHINXOPTS="-j 1" spin docs
works. Discovering this fix was difficult for a newcomer, as the rest of the examples in the codebase model changing SPHINXOPTS.I set up 7 different codespace environments, and sometimes the docs would build without errors, while other times they would fail. My best guess now is that this may have to do with how many cores
-j auto
was able to access on each different codespace.Further Discussion
I'd love to change something to help newcomers so they don't have to question why their doc build gives an error message (that they can ignore). Here's some options.
1
, and later updating it back to auto when an upstream fix is found, would simplify things for newcomers. This PR follows this option. I purposefully matched thedefault
andhelp
fromspin test
.spin docs
appears that adds a comment to usespin docs -j 1
if they encounter a warning. IMHO, this makes it harder for newcomers to contribute. If anything, this PR will provide a record for people to find a fix.cmds.py
, but does mean the change toauto
will auto happen.As for the
-W
option change, I understand why we want the doc build to throw an error on numpy/numpy. Moving-W
toSPHINXOPTS
allows both upstream and local repos to set the option as needed.doc/neps/makefile
alone. The-W
command is still in ALLSPHINXOPTS. I can update that file as well, if wanted.