Skip to content

Commit 43c78b7

Browse files
authored
build(docs): do not run docs Makefile target if no changes in docs/source; remove the check and test dependencies from the docs target (#560)
1 parent 7e97530 commit 43c78b7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,21 +188,24 @@ dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-build-epoch.txt:
188188
echo $(SOURCE_DATE_EPOCH) > dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-build-epoch.txt
189189

190190
# Build the HTML and Markdown documentation from the package's source.
191+
DOCS_SOURCE := $(shell git ls-files docs/source)
191192
.PHONY: docs docs-html docs-md
192193
docs: docs-html docs-md
193-
docs-html: docs/_build/html/index.html
194-
docs/_build/html/index.html: check test
194+
docs-html: docs/_build/.html-built-on
195+
docs/_build/.html-built-on: $(DOCS_SOURCE)
195196
if [ ! -d docs/source/_static ]; then \
196197
mkdir docs/source/_static/; \
197198
fi
198199
$(MAKE) -C docs/ html
199-
docs-md: docs/_build/markdown/Home.md
200-
docs/_build/markdown/Home.md: check test
200+
echo "Automatically generated by Python Package Makefile on $$(date '+%Y-%m-%d %H:%M:%S %z')." > docs/_build/.html-built-on
201+
docs-md: docs/_build/.markdown-built-on
202+
docs/_build/.markdown-built-on: $(DOCS_SOURCE)
201203
if [ ! -d docs/source/_static ]; then \
202204
mkdir docs/source/_static/; \
203205
fi
204206
$(MAKE) -C docs/ markdown
205207
mv docs/_build/markdown/index.md docs/_build/markdown/Home.md
208+
echo "Automatically generated by Python Package Makefile on $$(date '+%Y-%m-%d %H:%M:%S %z')." > docs/_build/.markdown-built-on
206209

207210
# Prune the packages currently installed in the virtual environment down to the required
208211
# packages only. Pruning works in a roundabout way, where we first generate the wheels for

0 commit comments

Comments
 (0)