Title: Docs: Create venv if missing by hugovk · Pull Request #98266 · python/cpython · GitHub
Open Graph Title: Docs: Create venv if missing by hugovk · Pull Request #98266 · python/cpython
X Title: Docs: Create venv if missing by hugovk · Pull Request #98266 · python/cpython
Description: Problem I started getting this error: $ make -C Doc clean rm -rf ./venv rm -rf build/* $ make -C Doc html mkdir -p build Building NEWS from Misc/NEWS.d with blurb PATH=./venv/bin:$PATH sphinx-build -b html -d build/doctrees -j auto -W . build/html Running Sphinx v5.1.1 making output directory... done Theme error: no theme named 'python_docs_theme' found (missing theme.conf?) make: *** [build] Error 2 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 venv or $PATH: SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build And in my case it's finding it in my $PATH, so this guard passes: cpython/Doc/Makefile Line 55 in b863b9c elif $(BLURB) help >/dev/null 2>&1 && $(SPHINXBUILD) --version >/dev/null 2>&1; then \ But I don't get this warning: cpython/Doc/Makefile Lines 65 to 66 in b863b9c echo "Missing the required blurb or sphinx-build tools."; \ echo "Please run 'make venv' to install local copies."; \ Fix Two things (aka let's do it like the devguide) let's just use the tools in the venv, not $PATH (to make the guard fail, and show the warning): https://github.com/python/devguide/blob/05f6d0c8d09bd757440e0346190dbd62e06c7251/Makefile#L9-L10 and add ensure-venv target that will install the venv if the venv dir 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 .PHONY targets. 👍 I expect missing .PHONY targets will happen again, because it's normal to copy/paste a target, and forget (or not know) to update the long .PHONY line right at the top. Let's do as @zware suggested and define them right next to each target: #98189 (comment) We do this at Pillow and at work, it helps a lot. (I'll add it to the devguide and PEPs too.)
Open Graph Description: Problem I started getting this error: $ make -C Doc clean rm -rf ./venv rm -rf build/* $ make -C Doc html mkdir -p build Building NEWS from Misc/NEWS.d with blurb PATH=./venv/bin:$PATH sphinx-build...
X Description: Problem I started getting this error: $ make -C Doc clean rm -rf ./venv rm -rf build/* $ make -C Doc html mkdir -p build Building NEWS from Misc/NEWS.d with blurb PATH=./venv/bin:$PATH sphinx-build...
Opengraph URL: https://github.com/python/cpython/pull/98266
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:1d90d1aa-a201-4d7f-4ad8-bffb7aa3cde1 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B0F4:3410DA:1B2B27A:23503EB:696B362B |
| html-safe-nonce | 9b84398584caeecdadb45b0cbe5974f2eb8fb487c01cfd27f980a2607ebd0e08 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMEY0OjM0MTBEQToxQjJCMjdBOjIzNTAzRUI6Njk2QjM2MkIiLCJ2aXNpdG9yX2lkIjoiNjUwOTYyMDg2NzAyMzcxMzgzNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0fae791105a8009ffa895f2f9243e9b5ab4638bf3ddf99304f8f58bdd316368a |
| hovercard-subject-tag | pull_request:1087682438 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/98266/files |
| twitter:image | https://avatars.githubusercontent.com/u/1324225?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1324225?s=400&v=4 |
| og:image:alt | Problem I started getting this error: $ make -C Doc clean rm -rf ./venv rm -rf build/* $ make -C Doc html mkdir -p build Building NEWS from Misc/NEWS.d with blurb PATH=./venv/bin:$PATH sphinx-build... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width