Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e880e36

Browse files
hugovkezio-melotti
andauthored
Define port for htmllive to avoid collisions (#1327)
Co-authored-by: Ezio Melotti <[email protected]>
1 parent 538c4e8 commit e880e36

File tree

2 files changed

+26
-24
lines changed

2 files changed

+26
-24
lines changed

Makefile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
PYTHON = python3
66
VENVDIR = ./venv
77
SPHINXBUILD = $(VENVDIR)/bin/sphinx-build
8-
SPHINXOPTS = -W --keep-going
8+
SPHINXOPTS = --fail-on-warning --keep-going
99
BUILDDIR = _build
1010
BUILDER = html
1111
JOBS = auto
1212
PAPER =
1313
SPHINXLINT = $(VENVDIR)/bin/sphinx-lint
1414

1515
# Internal variables.
16-
PAPEROPT_a4 = -D latex_paper_size=a4
17-
PAPEROPT_letter = -D latex_paper_size=letter
18-
ALLSPHINXOPTS = -b $(BUILDER) \
19-
-d $(BUILDDIR)/doctrees \
20-
-j $(JOBS) \
16+
PAPEROPT_a4 = --define latex_paper_size=a4
17+
PAPEROPT_letter = --define latex_paper_size=letter
18+
ALLSPHINXOPTS = --builder $(BUILDER) \
19+
--doctree-dir $(BUILDDIR)/doctrees \
20+
--jobs $(JOBS) \
2121
$(PAPEROPT_$(PAPER)) \
2222
$(SPHINXOPTS) \
2323
. $(BUILDDIR)/$(BUILDER)
@@ -170,7 +170,9 @@ htmlview: html
170170

171171
.PHONY: htmllive
172172
htmllive: SPHINXBUILD = $(VENVDIR)/bin/sphinx-autobuild
173-
htmllive: SPHINXOPTS = --re-ignore="/\.idea/|/venv/" --open-browser --delay 0
173+
# Arbitrarily selected ephemeral port between 49152–65535
174+
# to avoid conflicts with other processes:
175+
htmllive: SPHINXOPTS = --re-ignore="/\.idea/|/venv/" --open-browser --delay 0 --port 55301
174176
htmllive: html
175177

176178
.PHONY: check

make.bat

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ if not defined SPHINXLINT (
2222
)
2323

2424
set BUILDDIR=_build
25-
set SPHINXOPTS=-W --keep-going -n
26-
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
25+
set SPHINXOPTS=-W --keep-going --nitpicky
26+
set ALLSPHINXOPTS=--doctree-dir %BUILDDIR%/doctrees %SPHINXOPTS% .
2727
if NOT "%PAPER%" == "" (
2828
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
2929
)
@@ -76,7 +76,7 @@ if not defined SPHINXBUILD (
7676
)
7777

7878
if "%1" == "html" (
79-
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
79+
%SPHINXBUILD% --builder html %ALLSPHINXOPTS% %BUILDDIR%/html
8080
if errorlevel 1 exit /b 1
8181
echo.
8282
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
@@ -95,39 +95,39 @@ if "%1" == "htmlview" (
9595
)
9696

9797
if "%1" == "dirhtml" (
98-
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
98+
%SPHINXBUILD% --builder dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
9999
if errorlevel 1 exit /b 1
100100
echo.
101101
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
102102
goto end
103103
)
104104

105105
if "%1" == "singlehtml" (
106-
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
106+
%SPHINXBUILD% --builder singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
107107
if errorlevel 1 exit /b 1
108108
echo.
109109
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
110110
goto end
111111
)
112112

113113
if "%1" == "pickle" (
114-
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
114+
%SPHINXBUILD% --builder pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
115115
if errorlevel 1 exit /b 1
116116
echo.
117117
echo.Build finished; now you can process the pickle files.
118118
goto end
119119
)
120120

121121
if "%1" == "json" (
122-
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
122+
%SPHINXBUILD% --builder json %ALLSPHINXOPTS% %BUILDDIR%/json
123123
if errorlevel 1 exit /b 1
124124
echo.
125125
echo.Build finished; now you can process the JSON files.
126126
goto end
127127
)
128128

129129
if "%1" == "htmlhelp" (
130-
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
130+
%SPHINXBUILD% --builder htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
131131
if errorlevel 1 exit /b 1
132132
echo.
133133
echo.Build finished; now you can run HTML Help Workshop with the ^
@@ -136,7 +136,7 @@ if "%1" == "htmlhelp" (
136136
)
137137

138138
if "%1" == "qthelp" (
139-
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
139+
%SPHINXBUILD% --builder qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
140140
if errorlevel 1 exit /b 1
141141
echo.
142142
echo.Build finished; now you can run "qcollectiongenerator" with the ^
@@ -148,55 +148,55 @@ if "%1" == "qthelp" (
148148
)
149149

150150
if "%1" == "devhelp" (
151-
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
151+
%SPHINXBUILD% --builder devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
152152
if errorlevel 1 exit /b 1
153153
echo.
154154
echo.Build finished.
155155
goto end
156156
)
157157

158158
if "%1" == "epub" (
159-
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
159+
%SPHINXBUILD% --builder epub %ALLSPHINXOPTS% %BUILDDIR%/epub
160160
if errorlevel 1 exit /b 1
161161
echo.
162162
echo.Build finished. The epub file is in %BUILDDIR%/epub.
163163
goto end
164164
)
165165

166166
if "%1" == "latex" (
167-
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
167+
%SPHINXBUILD% --builder latex %ALLSPHINXOPTS% %BUILDDIR%/latex
168168
if errorlevel 1 exit /b 1
169169
echo.
170170
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
171171
goto end
172172
)
173173

174174
if "%1" == "text" (
175-
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
175+
%SPHINXBUILD% --builder text %ALLSPHINXOPTS% %BUILDDIR%/text
176176
if errorlevel 1 exit /b 1
177177
echo.
178178
echo.Build finished. The text files are in %BUILDDIR%/text.
179179
goto end
180180
)
181181

182182
if "%1" == "man" (
183-
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
183+
%SPHINXBUILD% --builder man %ALLSPHINXOPTS% %BUILDDIR%/man
184184
if errorlevel 1 exit /b 1
185185
echo.
186186
echo.Build finished. The manual pages are in %BUILDDIR%/man.
187187
goto end
188188
)
189189

190190
if "%1" == "changes" (
191-
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
191+
%SPHINXBUILD% --builder changes %ALLSPHINXOPTS% %BUILDDIR%/changes
192192
if errorlevel 1 exit /b 1
193193
echo.
194194
echo.The overview file is in %BUILDDIR%/changes.
195195
goto end
196196
)
197197

198198
if "%1" == "linkcheck" (
199-
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
199+
%SPHINXBUILD% --builder linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
200200
if errorlevel 1 exit /b 1
201201
echo.
202202
echo.Link check complete; look for any errors in the above output ^
@@ -205,7 +205,7 @@ or in %BUILDDIR%/linkcheck/output.txt.
205205
)
206206

207207
if "%1" == "doctest" (
208-
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
208+
%SPHINXBUILD% --builder doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
209209
if errorlevel 1 exit /b 1
210210
echo.
211211
echo.Testing of doctests in the sources finished, look at the ^

0 commit comments

Comments
 (0)