Skip to content

Commit 8e8b17f

Browse files
xhochywesm
authored andcommitted
ARROW-97: API documentation via sphinx-apidoc
Author: Uwe L. Korn <uwelk@xhochy.com> Closes #175 from xhochy/ARROW-97 and squashes the following commits: 2ec3e11 [Uwe L. Korn] Add license headers d838e81 [Uwe L. Korn] ARROW-97: API documentation via sphinx-apidoc
1 parent 8520061 commit 8e8b17f

8 files changed

Lines changed: 661 additions & 1 deletion

File tree

ci/travis_script_python.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ python_version_tests() {
5151
--inplace
5252

5353
python -m pytest -vv -r sxX pyarrow
54+
55+
# Build documentation once
56+
if [[ "$PYTHON_VERSION" == "3.5" ]]
57+
then
58+
pip install -r doc/requirements.txt
59+
python setup.py build_sphinx
60+
fi
5461
}
5562

5663
# run tests for python 2.7 and 3.5

python/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,10 @@ The Arrow C++ library must be built with all options enabled and installed with
4747
python setup.py build_ext --inplace
4848
py.test pyarrow
4949
```
50+
51+
#### Build the documentation
52+
53+
```bash
54+
pip install -r doc/requirements.txt
55+
python setup.py build_sphinx
56+
```

python/doc/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# auto-generated module documentation
2+
pyarrow*.rst
3+
modules.rst

python/doc/Makefile

Lines changed: 237 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License. See accompanying LICENSE file.
13+
# Makefile for Sphinx documentation
14+
#
15+
16+
# You can set these variables from the command line.
17+
SPHINXOPTS =
18+
SPHINXBUILD = sphinx-build
19+
PAPER =
20+
BUILDDIR = _build
21+
22+
# Internal variables.
23+
PAPEROPT_a4 = -D latex_paper_size=a4
24+
PAPEROPT_letter = -D latex_paper_size=letter
25+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
26+
# the i18n builder cannot share the environment and doctrees with the others
27+
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
28+
29+
.PHONY: help
30+
help:
31+
@echo "Please use \`make <target>' where <target> is one of"
32+
@echo " html to make standalone HTML files"
33+
@echo " dirhtml to make HTML files named index.html in directories"
34+
@echo " singlehtml to make a single large HTML file"
35+
@echo " pickle to make pickle files"
36+
@echo " json to make JSON files"
37+
@echo " htmlhelp to make HTML files and a HTML help project"
38+
@echo " qthelp to make HTML files and a qthelp project"
39+
@echo " applehelp to make an Apple Help Book"
40+
@echo " devhelp to make HTML files and a Devhelp project"
41+
@echo " epub to make an epub"
42+
@echo " epub3 to make an epub3"
43+
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
44+
@echo " latexpdf to make LaTeX files and run them through pdflatex"
45+
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
46+
@echo " text to make text files"
47+
@echo " man to make manual pages"
48+
@echo " texinfo to make Texinfo files"
49+
@echo " info to make Texinfo files and run them through makeinfo"
50+
@echo " gettext to make PO message catalogs"
51+
@echo " changes to make an overview of all changed/added/deprecated items"
52+
@echo " xml to make Docutils-native XML files"
53+
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
54+
@echo " linkcheck to check all external links for integrity"
55+
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
56+
@echo " coverage to run coverage check of the documentation (if enabled)"
57+
@echo " dummy to check syntax errors of document sources"
58+
59+
.PHONY: clean
60+
clean:
61+
rm -rf $(BUILDDIR)/*
62+
63+
.PHONY: html
64+
html:
65+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
66+
@echo
67+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
68+
69+
.PHONY: dirhtml
70+
dirhtml:
71+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
72+
@echo
73+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
74+
75+
.PHONY: singlehtml
76+
singlehtml:
77+
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
78+
@echo
79+
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
80+
81+
.PHONY: pickle
82+
pickle:
83+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
84+
@echo
85+
@echo "Build finished; now you can process the pickle files."
86+
87+
.PHONY: json
88+
json:
89+
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
90+
@echo
91+
@echo "Build finished; now you can process the JSON files."
92+
93+
.PHONY: htmlhelp
94+
htmlhelp:
95+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
96+
@echo
97+
@echo "Build finished; now you can run HTML Help Workshop with the" \
98+
".hhp project file in $(BUILDDIR)/htmlhelp."
99+
100+
.PHONY: qthelp
101+
qthelp:
102+
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
103+
@echo
104+
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
105+
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
106+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pyarrow.qhcp"
107+
@echo "To view the help file:"
108+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pyarrow.qhc"
109+
110+
.PHONY: applehelp
111+
applehelp:
112+
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
113+
@echo
114+
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
115+
@echo "N.B. You won't be able to view it unless you put it in" \
116+
"~/Library/Documentation/Help or install it in your application" \
117+
"bundle."
118+
119+
.PHONY: devhelp
120+
devhelp:
121+
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
122+
@echo
123+
@echo "Build finished."
124+
@echo "To view the help file:"
125+
@echo "# mkdir -p $$HOME/.local/share/devhelp/pyarrow"
126+
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pyarrow"
127+
@echo "# devhelp"
128+
129+
.PHONY: epub
130+
epub:
131+
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
132+
@echo
133+
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
134+
135+
.PHONY: epub3
136+
epub3:
137+
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
138+
@echo
139+
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
140+
141+
.PHONY: latex
142+
latex:
143+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
144+
@echo
145+
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
146+
@echo "Run \`make' in that directory to run these through (pdf)latex" \
147+
"(use \`make latexpdf' here to do that automatically)."
148+
149+
.PHONY: latexpdf
150+
latexpdf:
151+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
152+
@echo "Running LaTeX files through pdflatex..."
153+
$(MAKE) -C $(BUILDDIR)/latex all-pdf
154+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
155+
156+
.PHONY: latexpdfja
157+
latexpdfja:
158+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
159+
@echo "Running LaTeX files through platex and dvipdfmx..."
160+
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
161+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
162+
163+
.PHONY: text
164+
text:
165+
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
166+
@echo
167+
@echo "Build finished. The text files are in $(BUILDDIR)/text."
168+
169+
.PHONY: man
170+
man:
171+
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
172+
@echo
173+
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
174+
175+
.PHONY: texinfo
176+
texinfo:
177+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
178+
@echo
179+
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
180+
@echo "Run \`make' in that directory to run these through makeinfo" \
181+
"(use \`make info' here to do that automatically)."
182+
183+
.PHONY: info
184+
info:
185+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
186+
@echo "Running Texinfo files through makeinfo..."
187+
make -C $(BUILDDIR)/texinfo info
188+
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
189+
190+
.PHONY: gettext
191+
gettext:
192+
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
193+
@echo
194+
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
195+
196+
.PHONY: changes
197+
changes:
198+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
199+
@echo
200+
@echo "The overview file is in $(BUILDDIR)/changes."
201+
202+
.PHONY: linkcheck
203+
linkcheck:
204+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
205+
@echo
206+
@echo "Link check complete; look for any errors in the above output " \
207+
"or in $(BUILDDIR)/linkcheck/output.txt."
208+
209+
.PHONY: doctest
210+
doctest:
211+
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
212+
@echo "Testing of doctests in the sources finished, look at the " \
213+
"results in $(BUILDDIR)/doctest/output.txt."
214+
215+
.PHONY: coverage
216+
coverage:
217+
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
218+
@echo "Testing of coverage in the sources finished, look at the " \
219+
"results in $(BUILDDIR)/coverage/python.txt."
220+
221+
.PHONY: xml
222+
xml:
223+
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
224+
@echo
225+
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
226+
227+
.PHONY: pseudoxml
228+
pseudoxml:
229+
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
230+
@echo
231+
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
232+
233+
.PHONY: dummy
234+
dummy:
235+
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
236+
@echo
237+
@echo "Build finished. Dummy builder generates no files."

0 commit comments

Comments
 (0)