Skip to content

Commit 260b55a

Browse files
committed
Add sphinx-autobuild and new recipe for it in make files
1 parent ea12f7b commit 260b55a

File tree

4 files changed

+116
-2
lines changed

4 files changed

+116
-2
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ help: ensurevenv
1515
@echo " bumpdeps to bump dependencies in requirement files."
1616
@echo " compiledeps to update requirements.txt files to adhere to dependencies"
1717
@echo " declared in requirements.in files (with minimal version changes)."
18+
@echo " livehtml to serve dirhtml documentation locally and auto-build on changes."
1819

19-
.PHONY: help bumpdeps compiledeps ensurevenv Makefile
20+
.PHONY: help bumpdeps compiledeps ensurevenv livehtml Makefile
2021

2122
# Note to whoever sees this in future:
2223
# Using indentation before `ensurevenv` lines breaks this target
@@ -61,6 +62,9 @@ aftercompiledeps:
6162
@echo
6263
$(MAKE) ensurevenv
6364

65+
livehtml: ensurevenv
66+
./venv/bin/sphinx-autobuild -b dirhtml -d "$(BUILDDIR)/doctrees" "$(SOURCEDIR)" "$(BUILDDIR)/dirhtml" $(SPHINXOPTS) $(O)
67+
6468
# Catch-all target: route all unknown targets to Sphinx using the new
6569
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
6670
%: Makefile ensurevenv

dev-requirements.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ flake8
44
isort
55
pip-tools
66
pre-commit
7+
sphinx-autobuild

dev-requirements.txt

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,30 @@
44
#
55
# pip-compile dev-requirements.in
66
#
7+
alabaster==0.7.12
8+
# via
9+
# -c requirements.txt
10+
# sphinx
711
appdirs==1.4.4
812
# via
913
# black
1014
# virtualenv
15+
babel==2.9.1
16+
# via
17+
# -c requirements.txt
18+
# sphinx
1119
black==21.6b0
1220
# via -r dev-requirements.in
21+
certifi==2021.5.30
22+
# via
23+
# -c requirements.txt
24+
# requests
1325
cfgv==3.3.0
1426
# via pre-commit
27+
chardet==4.0.0
28+
# via
29+
# -c requirements.txt
30+
# requests
1531
click==8.0.1
1632
# via
1733
# black
@@ -20,22 +36,50 @@ colorama==0.4.4
2036
# via
2137
# -c requirements.txt
2238
# click
39+
# sphinx
40+
# sphinx-autobuild
2341
distlib==0.3.2
2442
# via virtualenv
43+
docutils==0.17.1
44+
# via
45+
# -c requirements.txt
46+
# sphinx
2547
filelock==3.0.12
2648
# via virtualenv
2749
flake8==3.9.2
2850
# via -r dev-requirements.in
2951
identify==2.2.10
3052
# via pre-commit
53+
idna==2.10
54+
# via
55+
# -c requirements.txt
56+
# requests
57+
imagesize==1.2.0
58+
# via
59+
# -c requirements.txt
60+
# sphinx
3161
isort==5.9.1
3262
# via -r dev-requirements.in
63+
jinja2==3.0.1
64+
# via
65+
# -c requirements.txt
66+
# sphinx
67+
livereload==2.6.3
68+
# via sphinx-autobuild
69+
markupsafe==2.0.1
70+
# via
71+
# -c requirements.txt
72+
# jinja2
3373
mccabe==0.6.1
3474
# via flake8
3575
mypy-extensions==0.4.3
3676
# via black
3777
nodeenv==1.6.0
3878
# via pre-commit
79+
packaging==21.0
80+
# via
81+
# -c requirements.txt
82+
# sphinx
3983
pathspec==0.8.1
4084
# via black
4185
pep517==0.10.0
@@ -48,17 +92,75 @@ pycodestyle==2.7.0
4892
# via flake8
4993
pyflakes==2.3.1
5094
# via flake8
95+
pygments==2.9.0
96+
# via
97+
# -c requirements.txt
98+
# sphinx
99+
pyparsing==2.4.7
100+
# via
101+
# -c requirements.txt
102+
# packaging
103+
pytz==2021.1
104+
# via
105+
# -c requirements.txt
106+
# babel
51107
pyyaml==5.4.1
52108
# via pre-commit
53109
regex==2021.7.6
54110
# via black
111+
requests==2.25.1
112+
# via
113+
# -c requirements.txt
114+
# sphinx
55115
six==1.16.0
56-
# via virtualenv
116+
# via
117+
# livereload
118+
# virtualenv
119+
snowballstemmer==2.1.0
120+
# via
121+
# -c requirements.txt
122+
# sphinx
123+
sphinx==4.0.3
124+
# via
125+
# -c requirements.txt
126+
# sphinx-autobuild
127+
sphinx-autobuild==2021.3.14
128+
# via -r dev-requirements.in
129+
sphinxcontrib-applehelp==1.0.2
130+
# via
131+
# -c requirements.txt
132+
# sphinx
133+
sphinxcontrib-devhelp==1.0.2
134+
# via
135+
# -c requirements.txt
136+
# sphinx
137+
sphinxcontrib-htmlhelp==2.0.0
138+
# via
139+
# -c requirements.txt
140+
# sphinx
141+
sphinxcontrib-jsmath==1.0.1
142+
# via
143+
# -c requirements.txt
144+
# sphinx
145+
sphinxcontrib-qthelp==1.0.3
146+
# via
147+
# -c requirements.txt
148+
# sphinx
149+
sphinxcontrib-serializinghtml==1.1.5
150+
# via
151+
# -c requirements.txt
152+
# sphinx
57153
toml==0.10.2
58154
# via
59155
# black
60156
# pep517
61157
# pre-commit
158+
tornado==6.1
159+
# via livereload
160+
urllib3==1.26.6
161+
# via
162+
# -c requirements.txt
163+
# requests
62164
virtualenv==20.4.7
63165
# via pre-commit
64166
wheel==0.36.2

make.bat

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ set BUILDDIR=build
1515

1616
if "%1" == "bumpdeps" goto bumpdeps
1717
if "%1" == "compiledeps" goto compiledeps
18+
if "%1" == "livehtml" goto livehtml
1819
if "%1" == "" goto help
1920

2021
call :ensurevenv
@@ -48,6 +49,7 @@ echo.---
4849
echo. bumpdeps to bump dependencies in requirement files.
4950
echo. compiledeps to update requirements.txt files to adhere to dependencies
5051
echo. declared in requirements.in files (with minimal version changes).
52+
echo. livehtml to serve dirhtml documentation locally and auto-build on changes.
5153
goto end
5254

5355
:bumpdeps
@@ -66,6 +68,11 @@ venv\Scripts\pip-compile --quiet dev-requirements.in
6668
call :aftercompiledeps
6769
goto end
6870

71+
:livehtml
72+
call :ensurevenv
73+
venv\Scripts\sphinx-autobuild -b dirhtml -d %BUILDDIR%\doctrees %SOURCEDIR% %BUILDDIR%\dirhtml %SPHINXOPTS% %O%
74+
goto end
75+
6976
:aftercompiledeps
7077
venv\Scripts\pre-commit run mixed-line-ending --files requirements.txt dev-requirements.txt >nul
7178
git diff -U1 -- requirements.txt dev-requirements.txt

0 commit comments

Comments
 (0)