Skip to content

bpo-36329: Replace 'make serve' with 'make htmlview' #826

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

Merged
merged 4 commits into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp \
devhelp epub latex latexpdf text man changes linkcheck doctest check \
serve
devhelp epub latex latexpdf text man changes linkcheck doctest htmlview check

help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " htmlview to open the index page built by the html target in your browser"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
Expand All @@ -36,7 +36,6 @@ help:
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " check to run a check for frequent markup errors"
@echo " serve to serve devguide on the localhost (8000)"

clean:
-rm -rf $(BUILDDIR)/*
Expand Down Expand Up @@ -139,8 +138,12 @@ doctest: venv
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

htmlview: html
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('_build/html/index.html'))"

check:
$(PYTHON) tools/rstlint.py -i tools -i venv

serve: html
tools/serve.py _build/html
serve:
@echo "The 'serve' target was removed, use 'htmlview' instead" \
"(see https://github.com/python/cpython/issues/80510)"
19 changes: 15 additions & 4 deletions make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ if NOT "%PAPER%" == "" (
)

if "%1" == "check" goto check
if "%1" == "serve" goto serve

if "%1" == "" goto help
if "%1" == "help" (
:help
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. html to make standalone HTML files
echo. htmlview to open the index page built by the html target in your browser
echo. dirhtml to make HTML files named index.html in directories
echo. singlehtml to make a single large HTML file
echo. pickle to make pickle files
Expand All @@ -39,7 +39,6 @@ if "%1" == "help" (
echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
echo. check to check for stylistic and formal issues using rstlint
echo. serve to serve devguide on the localhost ^(8000^)
goto end
)

Expand All @@ -49,7 +48,7 @@ if "%1" == "clean" (
goto end
)

rem Targets other than "clean", "check", "serve", "help", or "" need the
rem Targets other than "clean", "check", "help", or "" need the
rem Sphinx build command, which the user may define via SPHINXBUILD.

if not defined SPHINXBUILD (
Expand All @@ -72,6 +71,17 @@ if "%1" == "html" (
goto end
)

if "%1" == "htmlview" (
cmd /C %this% html

if EXIST "%BUILDDIR%\html\index.html" (
echo.Opening "%BUILDDIR%\html\index.html" in the default web browser...
start "" "%BUILDDIR%\html\index.html"
)

goto end
)

if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
if errorlevel 1 exit /b 1
Expand Down Expand Up @@ -196,7 +206,8 @@ cmd /C %PYTHON% tools\rstlint.py -i tools -i venv
goto end

:serve
cmd /C %PYTHON% tools\serve.py %BUILDDIR%\html
echo.The serve target was removed, use htmlview instead ^
(see https://github.com/python/cpython/issues/80510)
goto end

:end
Expand Down
37 changes: 0 additions & 37 deletions tools/serve.py

This file was deleted.