Skip to content
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

Updating doc building to Sphinx 4.3.2 (python 3) #2662

Merged
merged 33 commits into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
67397a4
Update make_citations to work with pybtex 0.22+.
QuLogic May 3, 2019
258e063
Robert's initial commits (40 commits)
barsch Jun 24, 2020
10b2b15
Damian's commits (40 commits)
heavelock Feb 10, 2021
3fc781a
Fix duplicate page number in citation.
QuLogic May 2, 2019
da3f3e1
Update make_citations to work with pybtex 0.22+.
QuLogic May 3, 2019
6221481
starting to cleanup/upgrade doc building process using sphinx
barsch Jun 24, 2020
a9051cc
Robert's commits (29 commits)
barsch Jun 25, 2020
29a76b1
Damian's squashed commits (40 commits)
heavelock Feb 10, 2021
f3ec2e1
improvements (20 commits)
ThomasLecocq Jan 11, 2022
e2baf35
improvements (40 commits)
ThomasLecocq Jan 11, 2022
643dead
improvements (14 commits)
ThomasLecocq Jan 13, 2022
b42cfc9
Changelog
ThomasLecocq Jan 13, 2022
53c57e4
still indexing issues, but the pages are complete now
ThomasLecocq Jan 14, 2022
023b3a2
better UX browsing (adds warnings, will solve them later)
ThomasLecocq Jan 14, 2022
0fe2cb2
trace & stats mixedup
ThomasLecocq Jan 14, 2022
4d4f620
unpin version/revision number so docs are built fully for each push
ThomasLecocq Jan 14, 2022
dd99aa4
typo
ThomasLecocq Jan 14, 2022
57ebb35
add workflow for deploying docs
trichter Jan 14, 2022
e18301b
trigger
trichter Jan 14, 2022
f5ef80d
comment status
trichter Jan 14, 2022
b8edaf4
use test load
trichter Jan 14, 2022
659c73d
comment ssh
trichter Jan 14, 2022
4eb5e95
try to fix display of env variable
trichter Jan 14, 2022
8ff10cd
remove docs.yml
trichter Jan 14, 2022
b7a6f50
replace the final basemap stuff with cartopy
ThomasLecocq Jan 17, 2022
6d2c888
PEP errors
ThomasLecocq Jan 17, 2022
a9214b7
get rid of basemap
ThomasLecocq Jan 17, 2022
9b27d74
get rid of basemap
ThomasLecocq Jan 17, 2022
b0e8b28
add cartopy check to sources.py
ThomasLecocq Jan 17, 2022
7dfe9b3
linter ....
ThomasLecocq Jan 17, 2022
e35b633
should probably be a better way to do this, but test would pass
ThomasLecocq Jan 17, 2022
613ebee
reverting image changes
ThomasLecocq Jan 17, 2022
73c5077
div gallery
ThomasLecocq Jan 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/docs_building.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Docs building"
on: pull_request

jobs:
docs:
runs-on: ubuntu-latest
container: heavelock/obspydocs:latest
steps:
- uses: actions/checkout@v2
- run: |
python -m pip install .
cd misc/docs
make html
- run: tar cfJ documentation.tar.xz misc/docs/build/html/
- uses: actions/upload-artifact@v2
with:
name: DocumentationHTML
path: documentation.tar.xz
12 changes: 5 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@ coverage.xml
dist/
distribute-*.egg
distribute-*.tar.gz
misc/docs/source/packages/autogen
misc/docs/source/_static/css/
misc/docs/source/_static/font.css
misc/docs/source/_static/fonts/
misc/docs/source/_templates/footer.html
misc/docs/source/_templates/navbar-local.html
misc/docs/source/packages/autogen/
misc/docs/source/credits.rst
misc/docs/source/citations.rst
misc/docs/_build/
misc/docs/node_modules/
misc/docs/package-lock.json
misc/docs/build/
misc/docker/logs/
obspy/lib/*.pyd
obspy/lib/*.so
Expand All @@ -50,3 +47,4 @@ misc/installer/anaconda/conda_builds
.vscode/**
venv
weather.mseed
/misc/docs/.build/
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Changes:
therefore deprecated and have no effect anymore (see #2720)
* refactored obspy-runtest to use pytest and modified several command
line arguments (see #2489)
* cleaned the documentation, build process, and docstrings (see #2662)
- obspy.core:
* read_inventory(): add "level" option to read files faster when less level
of detail is needed. currently only implemented for StationXML reading
Expand Down
33 changes: 0 additions & 33 deletions misc/docs/DEPENDENCIES.txt

This file was deleted.

219 changes: 19 additions & 200 deletions misc/docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,212 +1,31 @@
# Makefile for Sphinx documentation
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
PYTHON = python

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp \
epub latex latex-png-images latexpdf-png-images latexpdf text man \
changes linkcheck doctest gettext coverage coverager citations \
credits assets

# Put it first so that "make" without argument is like "make help".
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " serverhtml to make HTML files for serving online"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to make create coverage HTML files"
@echo " coverager to make create coverage HTML files and report test"
@echo " citations to generate citations page"
@echo " credits to generate credits page"
@echo " assets to generate static assets for local browsing"
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

clean:
@rm -rf $(BUILDDIR)/*
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@rm -rf source/packages/autogen/obspy.*
@$(PYTHON) make_assets.py -c -f

coverage:
@coverage run --rcfile=.coveragerc -m obspy.scripts.runtests -q --all
@coverage html --rcfile=.coveragerc -d $(BUILDDIR)/html/coverage
@coverage xml --rcfile=.coveragerc -o $(BUILDDIR)/html/coverage.xml

coverager:
@coverage run --rcfile=.coveragerc -m obspy.scripts.runtests -r -q --all
@coverage html --rcfile=.coveragerc -d $(BUILDDIR)/html/coverage
@coverage xml --rcfile=.coveragerc -o $(BUILDDIR)/html/coverage.xml

c_coverage:
@$(PYTHON) make_c_coverage.py $(BUILDDIR)/html/c_coverage

citations:
@$(PYTHON) make_citations.py

credits:
@$(PYTHON) make_credits.py

assets:
@$(PYTHON) make_assets.py

html: assets credits citations
if [ ! -d $(BUILDDIR) ]; then mkdir $(BUILDDIR); fi
if [ ! -d $(BUILDDIR)/html ]; then mkdir $(BUILDDIR)/html; fi
SPHINX=true $(SPHINXBUILD) -w $(BUILDDIR)/html/sphinx-build_warnings.txt -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 1> $(BUILDDIR)/html/sphinx-build_stdout.txt 2> $(BUILDDIR)/html/sphinx-build_stderr.txt
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

serverhtml:
if [ ! -d $(BUILDDIR) ]; then mkdir $(BUILDDIR); fi
if [ ! -d $(BUILDDIR)/html ]; then mkdir $(BUILDDIR)/html; fi
$(SPHINXBUILD) -b html -A use_local_assets=0 $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/obspy.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/obspy.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/obspy"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/obspy"
@echo "# devhelp"

epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

latex-png-images: latex
bash $(BUILDDIR)/../tex_replace_pdf_suffix.sh $(BUILDDIR)/latex

latexpdf: latex
@echo "Running LaTeX files through pdflatex..."
make -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

latexpdf-png-images: latex-png-images latexpdf

text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."

info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."

gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."

changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
.PHONY: help Makefile

doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
install-obspy-dev:
python -m pip install ../../

docset: html docset_after_html
# If you want to build docs from docker where you mounted new version of obspy you have to first reinstall it
html-docker: install-obspy-dev
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docset_after_html:
ifeq ($(DOCSETVERSION),)
$(eval DOCSETVERSION := $(shell head -3 $(BUILDDIR)/html/objects.inv | grep ' ObsPy Documentation ' | sed 's#.*(\(.*\)).*#\1#'))
endif
cd $(BUILDDIR)/html && rm -rf icon.png && ln -s _static/obspy-logo_32x32.png icon.png
rm -rf "$(BUILDDIR)/ObsPy $(DOCSETVERSION).docset"
cd $(BUILDDIR) && doc2dash -n 'ObsPy $(DOCSETVERSION)' -i html/icon.png html/
sed 's#\(<string>[Oo]bs[Pp]y\) .*\(</string>\)#\1 ${DOCSETVERSION}\2#' --in-place "$(BUILDDIR)/ObsPy $(DOCSETVERSION).docset/Contents/Info.plist"
rm -f $(BUILDDIR)/html/icon.png
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)