Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Docs: Create venv if missing#98266
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
zware commentedOct 14, 2022
We've been down this road before and it was either not accepted or shortly reverted, though I don't remember why. There is some history to dig up and review here, though past rejection doesn't necessarily mean we must still stick to the status quo. |
JelleZijlstra commentedOct 15, 2022
hugovk commentedOct 21, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Right, so we need to be able to build using pre-downloaded toolsnot in the venv, so fix 1 and 2 are not needed. We could add a check for other missing tools in this guard: Lines 55 to 59 inb863b9c
In this case, (I think I've seen a similar problem for another tool that could be checked easily, but I can't remember what it was so I'll address it if it comes up again.) What's left? I think the bonus |
hugovk commentedNov 11, 2022
I went for a new, clean PR, please see#99396. And let's close this one, thanks for the background! |
Problem
I started getting this error:
That's because I have no venv so it can't find the theme.
The problem is we have this, which looks for Sphinx in the venvor
$PATH:And in my case it's finding it in my
$PATH, so this guard passes:cpython/Doc/Makefile
Line 55 inb863b9c
But I don't get this warning:
cpython/Doc/Makefile
Lines 65 to 66 inb863b9c
Fix
Two things (aka let's do it like the devguide)
$PATH(to make the guard fail, and show the warning):https://github.com/python/devguide/blob/05f6d0c8d09bd757440e0346190dbd62e06c7251/Makefile#L9-L10
ensure-venvtarget that will install the venv if thevenvdir is missing (to avoid the warning in the first place):https://github.com/python/devguide/blob/05f6d0c8d09bd757440e0346190dbd62e06c7251/Makefile#L58-L64
Bonus
Whilst we're changing
Docs/Makefile, PR#98189 recently fixed some missing.PHONYtargets. 👍I expect missing
.PHONYtargets will happen again, because it's normal to copy/paste a target, and forget (or not know) to update the long.PHONYline right at the top.Let's do as@zware suggested and define them right next to each target:#98189 (comment)
We do this atPillow and at work, it helps a lot. (I'll add it to the devguide and PEPs too.)