Skip to content

Commit c35fda4

Browse files
committed
fix(docs): clean up sources and treat warnings as errors
Many deficiencies in the docs were being skipped over because `sphinx-build` is lenient. Adding the `-W` flag treats issues such as "missing reference" and "class not found" as errors.
1 parent eff8c2e commit c35fda4

8 files changed

Lines changed: 67 additions & 102 deletions

File tree

client/deis.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ def apps_destroy(self, args):
502502
Options:
503503
-a --app=<app>
504504
the uniquely identifiable name for the application.
505+
505506
--confirm=<app>
506507
skips the prompt for the application name. <app> is the uniquely identifiable
507508
name for the application.
@@ -914,19 +915,20 @@ def clusters_create(self, args):
914915
Arguments:
915916
<id>
916917
a uniquely identifiable name for the cluster, such as 'dev' or 'prod'.
918+
917919
<domain>
918920
a domain under which app hostnames will live. This must be provided to support
919921
multiple applications hosted on the cluster.
920-
921-
Note: this requires wildcard DNS configuration on the domain. For example, a
922+
NOTE: this requires wildcard DNS configuration on the domain. For example, a
922923
<domain> of `deisapp.com` requires that `*.deisapp.com` resolves to one of the
923924
cluster's router endpoints or the load balancer in front of the routers.
925+
924926
--hosts=<hosts>
925927
a comma-separated list of the cluster members' private IP addresses.
928+
926929
--auth=<auth>
927930
a local file path to an SSH private key. This is the key used to provision and
928931
connect to the cluster members. This key must not have a password.
929-
930932
NOTE: for EC2 and Rackspace, this key is likely `~/.ssh/deis`.
931933
932934
Options:
@@ -1108,6 +1110,7 @@ def config_list(self, args):
11081110
Options:
11091111
--oneline
11101112
print output on one line.
1113+
11111114
-a --app=<app>
11121115
the uniquely identifiable name of the application.
11131116
"""
@@ -1899,6 +1902,7 @@ def perms_list(self, args):
18991902
-a --app=<app>
19001903
lists all users with permission to <app>. <app> is the uniquely identifiable name
19011904
for the application.
1905+
19021906
--admin
19031907
lists all users with system administrator privileges.
19041908
"""
@@ -1924,6 +1928,7 @@ def perms_create(self, args):
19241928
-a --app=<app>
19251929
grants <username> permission to use <app>. <app> is the uniquely identifiable name
19261930
for the application.
1931+
19271932
--admin
19281933
grants <username> system administrator privileges.
19291934
"""
@@ -1957,6 +1962,7 @@ def perms_delete(self, args):
19571962
-a --app=<app>
19581963
revokes <username> permission to use <app>. <app> is the uniquely identifiable name
19591964
for the application.
1965+
19601966
--admin
19611967
revokes <username> system administrator privileges.
19621968
"""

controller/api/serializers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def from_native(self, data):
3333

3434

3535
class UserSerializer(serializers.ModelSerializer):
36-
"""Serialize a :class:`~api.models.User` model."""
36+
"""Serialize a User model."""
3737

3838
class Meta:
3939
"""Metadata options for a UserSerializer."""
@@ -52,7 +52,7 @@ def data(self):
5252

5353

5454
class AdminUserSerializer(serializers.ModelSerializer):
55-
"""Serialize admin status for a :class:`~api.models.User` model."""
55+
"""Serialize admin status for a User model."""
5656

5757
class Meta:
5858
model = User

controller/api/urls.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
2828
.. http:get:: /api/apps/(string:id)/
2929
30-
Retrieve a :class:`~api.models.Application` by its `id`.
30+
Retrieve a :class:`~api.models.App` by its `id`.
3131
3232
.. http:delete:: /api/apps/(string:id)/
3333
@@ -65,14 +65,6 @@
6565
6666
Create a new :class:`~api.models.Build`.
6767
68-
.. http:get:: /api/apps/(string:id)/limits/
69-
70-
Retrieve the latest :class:`~api.models.Limit`.
71-
72-
.. http:post:: /api/apps/(string:id)/limits/
73-
74-
Create a new :class:`~api.models.Limit`.
75-
7668
.. http:get:: /api/apps/(string:id)/releases/(int:version)/
7769
7870
Retrieve a :class:`~api.models.Release` by its `version`.
@@ -137,11 +129,6 @@
137129
See also
138130
:meth:`AppViewSet.run() <api.views.AppViewSet.run>`
139131
140-
.. http:post:: /api/apps/(string:id)/calculate/
141-
142-
See also
143-
:meth:`AppViewSet.calculate() <api.views.AppViewSet.calculate>`
144-
145132
146133
Application Sharing
147134
===================
@@ -200,11 +187,11 @@
200187
201188
.. http:post:: /api/auth/register/
202189
203-
Create a new :class:`~django.contrib.auth.models.User`.
190+
Create a new User.
204191
205192
.. http:delete:: /api/auth/register/
206193
207-
Destroy the logged-in :class:`~django.contrib.auth.models.User`.
194+
Destroy the logged-in User.
208195
209196
.. http:post:: /api/auth/login
210197
@@ -292,8 +279,6 @@
292279
views.AppViewSet.as_view({'post': 'logs'})),
293280
url(r'^apps/(?P<id>{})/run/?'.format(settings.APP_URL_REGEX),
294281
views.AppViewSet.as_view({'post': 'run'})),
295-
url(r'^apps/(?P<id>{})/calculate/?'.format(settings.APP_URL_REGEX),
296-
views.AppViewSet.as_view({'post': 'calculate'})),
297282
# apps sharing
298283
url(r'^apps/(?P<id>{})/perms/(?P<username>[-_\w]+)/?'.format(settings.APP_URL_REGEX),
299284
views.AppPermsViewSet.as_view({'delete': 'destroy'})),

controller/registry/private.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ def publish_release(source, config, target):
1919
Given a source image and dictionary of last-mile configuration,
2020
create a target Docker image on the registry.
2121
22-
For example publish_release('registry.local:5000/gabrtv/myapp:v22',
23-
{'ENVVAR': 'values'},
24-
'registry.local:5000/gabrtv/myapp:v23',)
22+
For example::
23+
24+
publish_release('registry.local:5000/gabrtv/myapp:v22',
25+
{'ENVVAR': 'values'},
26+
'registry.local:5000/gabrtv/myapp:v23')
27+
2528
results in a new Docker image at 'registry.local:5000/gabrtv/myapp:v23' which
2629
contains the new configuration as ENV entries.
2730
"""

docs/Makefile

Lines changed: 46 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,31 @@
55
SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
77
PAPER =
8-
PYTHON = python
9-
ZIP = zip
108
BUILDDIR = _build
119

1210
READTHEDOCS = true
1311
export READTHEDOCS
1412

13+
# # User-friendly check for sphinx-build
14+
# ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
15+
# $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
16+
# endif
17+
1518
# Internal variables.
1619
PAPEROPT_a4 = -D latex_paper_size=a4
1720
PAPEROPT_letter = -D latex_paper_size=letter
1821
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
1922
# the i18n builder cannot share the environment and doctrees with the others
2023
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
2124

22-
.PHONY: test check-sphinx help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
23-
24-
test: clean
25-
@if [ ! -d venv ]; then virtualenv venv; fi
26-
venv/bin/pip install -q -r docs_requirements.txt
27-
venv/bin/$(SPHINXBUILD) -a -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
28-
test -f $(BUILDDIR)/dirhtml/index.html
29-
30-
check-sphinx:
31-
# User-friendly check for sphinx-build
32-
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
33-
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
34-
endif
35-
36-
dirhtml: check-sphinx
37-
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
38-
@echo
39-
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
40-
41-
auto: dirhtml
42-
sphinx-autobuild -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
25+
.PHONY: help clean test html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
4326

4427
help:
4528
@echo "Please use \`make <target>' where <target> is one of"
4629
@echo " html to make standalone HTML files"
4730
@echo " dirhtml to make HTML files named index.html in directories"
48-
@echo " server to make dirhtml as above, then serve it at http://0.0.0.0:8000/"
31+
@echo " server to make HTML as above and serve it at http://localhost:8000/"
32+
@echo " test to validate the dirhtml output"
4933
@echo " singlehtml to make a single large HTML file"
5034
@echo " pickle to make pickle files"
5135
@echo " json to make JSON files"
@@ -68,38 +52,51 @@ help:
6852
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
6953

7054
clean:
71-
rm -rf docs.zip $(BUILDDIR)/*
72-
73-
zipfile: dirhtml
74-
cd $(BUILDDIR)/dirhtml; $(ZIP) -r -D -o ../../docs.zip .
55+
rm -rf $(BUILDDIR)/*
7556

76-
html: check-sphinx
57+
html:
7758
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
7859
@echo
7960
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
8061

81-
singlehtml: check-sphinx
62+
dirhtml:
63+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
64+
@echo
65+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
66+
67+
server: dirhtml
68+
@cd $(BUILDDIR)/dirhtml; python -m SimpleHTTPServer 8000
69+
70+
test: clean
71+
@if [ ! -d venv ]; then virtualenv venv; fi
72+
venv/bin/pip install -q -r docs_requirements.txt
73+
venv/bin/$(SPHINXBUILD) -b dirhtml -N -W $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
74+
grep -q \<h1\>Welcome _build/dirhtml/index.html || exit 1
75+
@echo
76+
@echo "Test finished. The HTML pages are in $(BUILDDIR)/dirhtml."
77+
78+
singlehtml:
8279
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
8380
@echo
8481
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
8582

86-
pickle: check-sphinx
83+
pickle:
8784
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
8885
@echo
8986
@echo "Build finished; now you can process the pickle files."
9087

91-
json: check-sphinx
88+
json:
9289
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
9390
@echo
9491
@echo "Build finished; now you can process the JSON files."
9592

96-
htmlhelp: check-sphinx
93+
htmlhelp:
9794
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
9895
@echo
9996
@echo "Build finished; now you can run HTML Help Workshop with the" \
10097
".hhp project file in $(BUILDDIR)/htmlhelp."
10198

102-
qthelp: check-sphinx
99+
qthelp:
103100
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
104101
@echo
105102
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
@@ -108,7 +105,7 @@ qthelp: check-sphinx
108105
@echo "To view the help file:"
109106
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/deis.qhc"
110107

111-
devhelp: check-sphinx
108+
devhelp:
112109
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
113110
@echo
114111
@echo "Build finished."
@@ -117,83 +114,80 @@ devhelp: check-sphinx
117114
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/deis"
118115
@echo "# devhelp"
119116

120-
epub: check-sphinx
117+
epub:
121118
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
122119
@echo
123120
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
124121

125-
latex: check-sphinx
122+
latex:
126123
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
127124
@echo
128125
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
129126
@echo "Run \`make' in that directory to run these through (pdf)latex" \
130127
"(use \`make latexpdf' here to do that automatically)."
131128

132-
latexpdf: check-sphinx
129+
latexpdf:
133130
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
134131
@echo "Running LaTeX files through pdflatex..."
135132
$(MAKE) -C $(BUILDDIR)/latex all-pdf
136133
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
137134

138-
latexpdfja: check-sphinx
135+
latexpdfja:
139136
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
140137
@echo "Running LaTeX files through platex and dvipdfmx..."
141138
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
142139
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
143140

144-
text: check-sphinx
141+
text:
145142
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
146143
@echo
147144
@echo "Build finished. The text files are in $(BUILDDIR)/text."
148145

149-
man: check-sphinx
146+
man:
150147
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
151148
@echo
152149
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
153150

154-
texinfo: check-sphinx
151+
texinfo:
155152
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
156153
@echo
157154
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
158155
@echo "Run \`make' in that directory to run these through makeinfo" \
159156
"(use \`make info' here to do that automatically)."
160157

161-
info: check-sphinx
158+
info:
162159
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
163160
@echo "Running Texinfo files through makeinfo..."
164161
make -C $(BUILDDIR)/texinfo info
165162
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
166163

167-
gettext: check-sphinx
164+
gettext:
168165
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
169166
@echo
170167
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
171168

172-
changes: check-sphinx
169+
changes:
173170
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
174171
@echo
175172
@echo "The overview file is in $(BUILDDIR)/changes."
176173

177-
linkcheck: check-sphinx
174+
linkcheck:
178175
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
179176
@echo
180177
@echo "Link check complete; look for any errors in the above output " \
181178
"or in $(BUILDDIR)/linkcheck/output.txt."
182179

183-
doctest: check-sphinx
180+
doctest:
184181
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
185182
@echo "Testing of doctests in the sources finished, look at the " \
186183
"results in $(BUILDDIR)/doctest/output.txt."
187184

188-
xml: check-sphinx
185+
xml:
189186
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
190187
@echo
191188
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
192189

193-
pseudoxml: check-sphinx
190+
pseudoxml:
194191
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
195192
@echo
196193
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
197-
198-
server: dirhtml
199-
@cd $(BUILDDIR)/dirhtml; $(PYTHON) -m SimpleHTTPServer 8000

docs/contributing/releases.rst

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@ Release Checklist
77
=================
88

99
These instructions are to assist the Deis maintainers with creating a new Deis
10-
product release.
11-
12-
.. image:: http://upload.wikimedia.org/wikipedia/commons/3/37/Grace_Hopper_and_UNIVAC.jpg
13-
:width: 220
14-
:height: 193
15-
:align: right
16-
:alt: Grace Hopper and UNIVAC, from the Wikimedia Commons
17-
18-
Please keep this document up-to-date with any changes in this process.
10+
product release. Please keep this document up-to-date with any changes in this process.
1911

2012
deis Repo
2113
---------

0 commit comments

Comments
 (0)