Skip to content

Commit 7c218b9

Browse files
authored
Speed up nox docs sessions (#13118)
* Use --jobs auto in docs nox sessions On my 8 core system, a clean cold build takes 5-6 seconds instead of 10-11 seconds. Nothing major, but it's a welcomed QoL improvement. FYI, this flag doesn't work and will be ignored on Windows. * Stop installing pip twice in docs nox sessions At some point, session.install("pip") in the docs and docs-live nox sessions was changed to install pip in editable mode, presumably to enable reruns w/o dependency installation (-R flag) to pick up changes for our pip sphinx extension. This doesn't do anything though as pip is reinstalled normally as it's declared in docs/requirements.txt. I think it's a fair compromise that if you want to pick up changes in pip's source that show up in the documentation, you should not be using the -R nox flag.
1 parent 9626dec commit 7c218b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ def test(session: nox.Session) -> None:
127127

128128
@nox.session
129129
def docs(session: nox.Session) -> None:
130-
session.install("-e", ".")
131130
session.install("-r", REQUIREMENTS["docs"])
132131

133132
def get_sphinx_build_command(kind: str) -> List[str]:
@@ -143,6 +142,7 @@ def get_sphinx_build_command(kind: str) -> List[str]:
143142
"-c", "docs/html", # see note above
144143
"-d", "docs/build/doctrees/" + kind,
145144
"-b", kind,
145+
"--jobs", "auto",
146146
"docs/" + kind,
147147
"docs/build/" + kind,
148148
]
@@ -154,7 +154,6 @@ def get_sphinx_build_command(kind: str) -> List[str]:
154154

155155
@nox.session(name="docs-live")
156156
def docs_live(session: nox.Session) -> None:
157-
session.install("-e", ".")
158157
session.install("-r", REQUIREMENTS["docs"], "sphinx-autobuild")
159158

160159
session.run(
@@ -163,6 +162,7 @@ def docs_live(session: nox.Session) -> None:
163162
"-b=dirhtml",
164163
"docs/html",
165164
"docs/build/livehtml",
165+
"--jobs=auto",
166166
*session.posargs,
167167
)
168168

0 commit comments

Comments
 (0)