Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up nox docs sessions #13118

Merged
merged 2 commits into from
Dec 22, 2024
Merged

Speed up nox docs sessions #13118

merged 2 commits into from
Dec 22, 2024

Conversation

ichard26
Copy link
Member

@ichard26 ichard26 commented Dec 16, 2024

On my 8 core system, a clean cold build takes 5-6 seconds with --jobs auto instead of 10-11 seconds. Nothing major, but it's a welcomed QoL improvement. FYI, this flag doesn't work on Windows.

In addition, I've removed the direct editable installation of pip in the nox sessions as it's going to be reinstalled again (normally) via docs/requirements.txt. Looking at the history, at some point, session.install("pip") in the docs and docs-live sessions was changed to install pip in editable mode, presumably to enable reruns w/o dependency installation (-R nox flag) to pick up changes for our pip sphinx extension. This doesn't do anything though nowadays for the aforementioned reason.

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 on Windows.
@ichard26 ichard26 added type: docs Documentation related skip news Does not need a NEWS file entry (eg: trivial changes) labels Dec 16, 2024
@pfmoore
Copy link
Member

pfmoore commented Dec 17, 2024

To confirm - the flag doesn’t error on Windows, it just gives no benefit?

@ichard26
Copy link
Member Author

I'll take a look on the weekend. I really do need to set up a Windows dev environment. I keep pushing it off 🙂

@pfmoore
Copy link
Member

pfmoore commented Dec 17, 2024

Sorry, I assumed you knew, I was just asking for clarification of your statement. I just ran a docs build command with --jobs auto on my Windows system, and it seems to run without error. I can't say whether it helps or not, but that's a different question. As long as it doesn't break building on Windows, I'm fine with this.

@pfmoore
Copy link
Member

pfmoore commented Dec 17, 2024

From the Sphinx docs "Windows is not supported". Which I assume from the experiment above means "This option is ignored on Windows". It would be nice if they were clearer about that 🙁

@ichard26
Copy link
Member Author

Can confirm it seems to be ignored on Windows (I finally got a barebones Python setup on my Windows install).

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.
@ichard26
Copy link
Member Author

Hmm, pip is installed twice in every docs session as it's directly installed via session.install("-e", ".") and indirectly installed via docs/requirements.txt. Looking at the history, at some point, session.install("pip") in the docs and docs-live sessions was changed to install pip in editable mode, presumably to enable reruns w/o dependency installation (-R nox 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've also removed the redundant and effectively useless editable installs of pip.

@ichard26 ichard26 changed the title Use --jobs auto in docs nox sessions Speed up nox docs sessions Dec 21, 2024
@ichard26
Copy link
Member Author

Merging as it's a small contributor QoL win, trivially low risk, and I haven't heard any objections in the past week.

@ichard26 ichard26 merged commit 7c218b9 into pypa:main Dec 22, 2024
31 checks passed
@ichard26 ichard26 deleted the parallelize-docs branch December 22, 2024 21:46
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
skip news Does not need a NEWS file entry (eg: trivial changes) type: docs Documentation related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants