Skip to content

Commit 4bb2bcb

Browse files
authored
docs nox session: delete old build beforehand (#13471)
While Sphinx is good at only rebuilding what was changed, it often doesn't rebuild *enough*. For example, if you update a document that is referenced by another, the embedded reference title in the latter is not updated on the next build. This also can hide warnings (which then fail the docs CI ... which is quite annoying). To fix this, simply delete the old docs build output entirely beforehand. If a developer wants a fast edit-build-view cycle, then the docs-live session is what they should be using.
1 parent 65da0ff commit 4bb2bcb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

noxfile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def get_sphinx_build_command(kind: str) -> list[str]:
156156
]
157157
# fmt: on
158158

159+
shutil.rmtree("docs/build", ignore_errors=True)
159160
session.run(*get_sphinx_build_command("html"))
160161
session.run(*get_sphinx_build_command("man"))
161162

0 commit comments

Comments
 (0)