Skip to content

Commit

Permalink
Move docs autoapi call to config.py setup
Browse files Browse the repository at this point in the history
  • Loading branch information
plstcharles committed Oct 17, 2018
1 parent 4aebf06 commit 969a2d5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ coverage:
.PHONY: docs
docs: install-docs
@bash -c "source $(CONDA_HOME)/bin/activate $(CONDA_ENV); \
$(CUR_DIR)/docs/sphinx "apidoc" -o $(CUR_DIR)/docs/src $(CUR_DIR)/src; \
$(MAKE) -C $(CUR_DIR)/docs clean; \
$(MAKE) -C $(CUR_DIR)/docs html;"
$(BROWSER) $(CUR_DIR)/docs/build/html/index.html
Expand Down
13 changes: 13 additions & 0 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,18 @@ def skip(app, what, name, obj, skip, options):
return False
return skip

def run_apidoc(_):
argv = ["-o", "./src/", "../src/"]
try:
# Sphinx 1.7+
from sphinx.ext import apidoc
apidoc.main(argv)
except ImportError:
# Sphinx 1.6 (and earlier)
from sphinx import apidoc
argv.insert(0, apidoc.__file__)
apidoc.main(argv)

def setup(app):
app.connect("autodoc-skip-member", skip)
app.connect("builder-inited", run_apidoc)
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ deps =
-r{toxinidir}/docs/requirements.txt
whitelist_externals = make
commands =
python docs/sphinx apidoc -o docs/src src
make -C docs clean
make -C docs html

Expand Down

0 comments on commit 969a2d5

Please sign in to comment.