Repository navigation
use the right python "make -C Doc/ serve" #80510
Description
Activity
When serving the documentation with
make -C Doc/ serve, we can not specify the path of the python binary.My use case, I wanted to debug the wsgiref.simple_server method, used by Tools/scripts/serve.py. It's just impossible because we use the default python3 binary from the system or from the virtualenv (pyenv. etc...)
- added3.8 (EOL)end of lifeend of lifedocsDocumentation in the Doc dirDocumentation in the Doc dir
on Mar 17, 2019 New changeset 09a9f17 by Julien Palard (Stéphane Wirtel) in branch 'master':
bpo-36329: Declare the version of Python to use for Tools/scripts/serve.py (bpo-12385)
09a9f17Personally, I'd prefer removing the 'serve' target completely. make -C Doc htmlview should already cover most of its use cases. There is no deprecation period needed and there is already a replacement (and IMO better) for it.
Personally, I'd prefer removing the 'serve' target completely. make -C
Doc htmlview should already cover most of its use cases. There is no
deprecation period needed and there is already a replacement (and IMO
better) for it.Hi Berker,
When I have read your message, I was surprised because this target
already exists since 2010. It's true we can run the makefile withmy current workflow is
make -C Doc/ venv && make -C Doc/ html serve and open my browser at
http://localhost:8000but with your suggestion, I think it's better for us and also for the
contributors, just make -C Doc/ venv htmlview. This target will open the
browser with the result of the html build.So, I have discussed with @julien Palard and he told me that he did not
use the 'serve' target and he discovered the target via my issue.But there will be an other issue, in the devguide, there is also a
'serve' target in the Makefile with a copy of tools/serve.py.But there is no htmlview target.
For the moment, we have a common solution for the two project if we want
to show the result to the user, make serve.We could:
- remove 'make serve' from CPython and Devguide
- remove tools/serve.py from CPython and Devguide
- add htmlview to the DevGuide
- update the documentation
+1 for removing the serve.py script and use htmlview.
Yeah, we can add htmlview to devguide. I’ve even added it to Django after I
discovered it in CPython :)--Berker
I've made PRs for this:
- CPython Docs: bpo-36329: Remove 'make -C Doc serve' in favour of 'make -C Doc htmlview' #32354
- Devguide: bpo-36329: Replace 'make serve' with 'make htmlview' devguide#826
Also set this bpo for Python 3.11.
- added3.11only security fixesonly security fixesand removed3.8 (EOL)end of lifeend of life
on Apr 6, 2022 For those seeking the old "serve" ability, after
make -C Doc htmlrun:python -m http.server -b localhost -p HTTP/1.1 -d Doc/build/html/ 8088I use that with a default port forwarding on my ssh session (aka
ssh -L 8088:localhost:8088or equivalent in your .ssh/config) to my development systems.I rarely have the ability for a development system to run a web browser or automatically tell my desktop browser full of important authentications where to go. In general as risk mitigation, but also in part because I'm happy using remote dev environments and ChromeOS.
We also have
make -C Doc htmllivethat serves, rebuilds and reloads using https://github.com/sphinx-doc/sphinx-autobuild.sphinx-autobuild has
--portand--hostoptions which could set viaSPHINXOPTS(make sure to re-add the existing options if needed) but no--protocol.Lines 147 to 150 in d9cfe7e
.PHONY: htmllive htmllive: SPHINXBUILD = $(VENVDIR)/bin/sphinx-autobuild htmllive: SPHINXOPTS = --re-ignore="/venv/" --open-browser --delay 0 htmllive: html Reacted by Ezio Melotti and Gregory P. Smith
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields: