DOC Add make.bat for building documentation on Windows#1963
DOC Add make.bat for building documentation on Windows#1963rcap107 merged 7 commits intoskrub-data:mainfrom
Conversation
|
I was looking into the issue with Windows documentation builds and tried putting together a I do have a quick question about testing this, though. Since I'm developing strictly on Linux right now, I don't actually have a local Windows environment to run this batch script natively. I tried to mirror the existing logic as closely as possible, but I'm basically hoping the Windows CI pipeline will catch any batch syntax quirks I might have missed. Does this approach work for this issue? I'll keep a close eye on the action logs and push fixes if the CI complains, but let me know if I should be handling this differently or if I missed any specific cache folders in the clean target! |
|
Hi @DCchoudhury15, thanks for the PR. The CI is unlikely to spot any issues with the file because the docs are built with the regular makefile and the test matrix is only checking for the actual test suite. I think there isn't an alternative to doing it the manual way and try to run it somehow on a machine that runs Windows. I'll try to do that to review the file when I can. |
|
Thanks for the clarification @rcap107! I'm going to set up a Windows VM |
|
Hi @DCchoudhury15, before merging this PR there should also be an update to the pyproject.toml file to add target specific commands. Pixi allows to do this using https://pixi.prefix.dev/latest/workspace/multi_platform_configuration/#activation There should be a specific entry for building the documentation with the bat file if the platform is win64. |
|
Hi @rcap107! I tested the I also added the Windows specific pixi tasks to |
rcap107
left a comment
There was a problem hiding this comment.
Thanks a lot for the PR, I was also able to run the scripts on a windows machine.
I could not run the optuna example with build-doc, were you able to do so? If there is a simple fix for it, we could go for it, otherwise I think we can just proceed as is, given that the CI is running on linux anyway.
| if exist "%BUILDDIR%\" ( | ||
| rmdir /q /s "%BUILDDIR%" | ||
| echo. Removed %BUILDDIR%\ | ||
| ) | ||
| if exist "auto_examples\" ( | ||
| rmdir /q /s "auto_examples" | ||
| echo. Removed auto_examples\ | ||
| ) | ||
| if exist "generated\" ( | ||
| rmdir /q /s "generated" | ||
| echo. Removed generated\ | ||
| ) | ||
| if exist "reference\generated\" ( | ||
| rmdir /q /s "reference\generated" | ||
| echo. Removed reference\generated\ | ||
| ) | ||
| if exist "generated_for_index\" ( | ||
| rmdir /q /s "generated_for_index" | ||
| echo. Removed generated_for_index\ | ||
| ) | ||
| if exist "reference\" ( | ||
| for %%i in ("reference\*.rst") do del /q "%%i" 2>nul | ||
| echo. Removed reference\*.rst | ||
| ) | ||
| goto end |
There was a problem hiding this comment.
I noticed that more files are being cleaned here than in the original makefile. That's good! Could you update the linux makefile to match?
| build-doc = { cmd = "make.bat html", cwd = "doc" } | ||
| build-doc-quick = { cmd = "make.bat html-noplot", cwd = "doc" } | ||
| clean-doc = { cmd = "make.bat clean", cwd = "doc" } | ||
| linkcheck = { cmd = "make.bat linkcheck", cwd = "doc" } | ||
| linkcheck-quick = { cmd = "make.bat linkcheck-noplot", cwd = "doc" } |
There was a problem hiding this comment.
This should fix the windows targets
| build-doc = { cmd = "make.bat html", cwd = "doc" } | |
| build-doc-quick = { cmd = "make.bat html-noplot", cwd = "doc" } | |
| clean-doc = { cmd = "make.bat clean", cwd = "doc" } | |
| linkcheck = { cmd = "make.bat linkcheck", cwd = "doc" } | |
| linkcheck-quick = { cmd = "make.bat linkcheck-noplot", cwd = "doc" } | |
| build-doc = { cmd = ".\\make.bat html", cwd = "doc" } | |
| build-doc-quick = { cmd = ".\\make.bat html-noplot", cwd = "doc" } | |
| clean-doc = { cmd = ".\\make.bat clean", cwd = "doc" } | |
| linkcheck = { cmd = ".\\make.bat linkcheck", cwd = "doc" } | |
| linkcheck-quick = { cmd = ".\\make.bat linkcheck-noplot", cwd = "doc" } |
de11b9d to
e307abf
Compare
e307abf to
494abcc
Compare
|
Hi @rcap107! I just pushed the updates for both of your suggestions. I changed the I ran the full From looking at the traceback, it seems |
Co-authored-by: Riccardo Cappuzzo <7548232+rcap107@users.noreply.github.com>
|
Hi @DCchoudhury15, thanks a lot for the fixes.
Yes, that's the same problem that I saw. I think we can proceed as is, but I think there should be a mention of this problem in the contribution doc where the Windows command is explained, so that people that try to use it don't get surprising results. Something like
That should help with avoiding some confusion. I think the PR is pretty much done and is only missing a message like the one I wrote to avoid potential confusion for new contributors. I might leave it open for a few days to let other maintainers leave comments if needed, but I'll likely merge this at the start of next week. |
|
Hi @rcap107, I've added the note to CONTRIBUTING.rst right after the make.bat html section. Let me know if the wording looks good or if you'd like any changes! |
50bedac to
35ff550
Compare
Looks good to me, I think we can merge this after all. Thanks a lot for the help! |
Description
Addresses #1720
Adds a
make.batscript to thedoc/folder so that Windows userscan build the documentation without needing Make/Makefiles.
The script supports the same targets as the existing
Makefile:html- full build including galleryhtml-noplot- fast build without running exampleslinkcheck- check external linkslinkcheck-noplot- check links without galleryclean- remove all build outputAlso updates
CONTRIBUTING.rstto document the Windows equivalentsalongside the existing Linux/macOS commands.
Checklist
How Has This Been Tested?
Tested the equivalent
make html-noplotbuild successfully on Linuxusing
pixi run build-doc-quick. Themake.batmirrors the sameSphinx commands as the
Makefile.AI Disclosure