Skip to content

Commit d26e859

Browse files
committed
Make docs build offline
1 parent 194149d commit d26e859

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

‎Makefile‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ PYTHON ?= python3
44
# between httk repositories (read by docs/conf.py via HTTK_DOCS_BASE_URL).
55
DOCS_BASE_URL ?= https://docs.httk.org
66

7-
.PHONY: docs docs-live docs-clean clean
7+
.PHONY: docs docs-live docs-clean docs-inventories clean
88

99
docs: docs-clean
1010
HTTK_DOCS_BASE_URL=$(DOCS_BASE_URL) $(PYTHON) -m sphinx -E -a -b html -W --keep-going docs docs/_build/html
@@ -13,7 +13,12 @@ docs-live:
1313
HTTK_DOCS_BASE_URL=$(DOCS_BASE_URL) sphinx-autobuild docs docs/_build/html
1414

1515
docs-clean:
16-
rm -rf docs/_build
16+
rm -rf docs/_build docs/reference/autoapi
17+
18+
# Refresh the committed intersphinx inventories (the one docs task that uses the
19+
# network); docs builds themselves resolve against these vendored files offline.
20+
docs-inventories:
21+
curl -fsSL https://docs.python.org/3/objects.inv -o docs/_inventories/python.inv
1722

1823
clean: docs-clean
1924
find . -name "*.pyc" -print0 | xargs -0 rm -f

‎docs/_inventories/python.inv‎

154 KB
Binary file not shown.

‎docs/conf.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,11 @@
9797
# working.
9898
_docs_base_url = os.environ.get("HTTK_DOCS_BASE_URL", "https://docs.httk.org")
9999

100+
# The inventory is vendored in docs/_inventories/ so docs builds need no network
101+
# access; link targets still point at the live site. Refresh the committed
102+
# inventory with `make docs-inventories`.
100103
intersphinx_mapping = {
101-
"python": ("https://docs.python.org/3", None),
104+
"python": ("https://docs.python.org/3", "_inventories/python.inv"),
102105
}
103106

104107
# Plain "go to the module's docs" links, e.g. {moduledocs}`httk-core`.

0 commit comments

Comments
 (0)