diff options
| author | mattip <matti.picus@gmail.com> | 2019-04-15 12:17:20 +0300 |
|---|---|---|
| committer | mattip <matti.picus@gmail.com> | 2019-04-15 14:27:48 +0300 |
| commit | 01fb828e848af97f2c7896db28f7e185c2b4bd0e (patch) | |
| tree | db02e8efb104c94b01961af47846304a08634085 /doc/Makefile | |
| parent | 37da972f018a5605aba398b2dacc103f619971cf (diff) | |
| download | numpy-01fb828e848af97f2c7896db28f7e185c2b4bd0e.tar.gz | |
BUILD: fail documentation build if numpy version does not match
Diffstat (limited to 'doc/Makefile')
| -rw-r--r-- | doc/Makefile | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/doc/Makefile b/doc/Makefile index c70111385..e15010371 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -10,10 +10,14 @@ PYVER:=$(shell python3 -c 'from sys import version_info as v; print("{0}.{1}".format(v[0], v[1]))') PYTHON = python$(PYVER) +NUMPYVER:=$(shell python3 -c "import numpy; print(numpy.version.git_revision[:10])") +GITVER ?= $(shell cd ..; python3 -c "from setup import git_version; \ + print(git_version()[:10])") + # You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = LANG=C sphinx-build -PAPER = +SPHINXOPTS ?= +SPHINXBUILD ?= LANG=C sphinx-build +PAPER ?= FILES= @@ -44,6 +48,16 @@ help: clean: -rm -rf build/* source/reference/generated +version-check: +ifneq ($(NUMPYVER),$(GITVER)) + @echo installed numpy $(NUMPYVER) != current repo git version $(GITVER) + @echo set GITVER to $(NUMPYVER) to override + @exit 1 +else + # for testing + # @echo installed numpy $(NUMPYVER) matches git version $(GITVER); exit 1 +endif + gitwash-update: rm -rf source/dev/gitwash install -d source/dev/gitwash @@ -119,7 +133,7 @@ build/generate-stamp: $(wildcard source/reference/*.rst) mkdir -p build touch build/generate-stamp -html: generate +html: generate version-check mkdir -p build/html build/doctrees $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html $(FILES) $(PYTHON) postprocess.py html build/html/*.html @@ -132,7 +146,7 @@ html-scipyorg: @echo @echo "Build finished. The HTML pages are in build/html." -pickle: generate +pickle: generate version-check mkdir -p build/pickle build/doctrees $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle $(FILES) @echo @@ -142,7 +156,7 @@ pickle: generate web: pickle -htmlhelp: generate +htmlhelp: generate version-check mkdir -p build/htmlhelp build/doctrees $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp $(FILES) @echo @@ -153,11 +167,11 @@ htmlhelp-build: htmlhelp build/htmlhelp/numpy.chm %.chm: %.hhp -hhc.exe $^ -qthelp: generate +qthelp: generate version-check mkdir -p build/qthelp build/doctrees $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) build/qthelp $(FILES) -latex: generate +latex: generate version-check mkdir -p build/latex build/doctrees $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex $(FILES) $(PYTHON) postprocess.py tex build/latex/*.tex @@ -167,18 +181,18 @@ latex: generate @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ "run these through (pdf)latex." -coverage: build +coverage: build version-check mkdir -p build/coverage build/doctrees $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) build/coverage $(FILES) @echo "Coverage finished; see c.txt and python.txt in build/coverage" -changes: generate +changes: generate version-check mkdir -p build/changes build/doctrees $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes $(FILES) @echo @echo "The overview file is in build/changes." -linkcheck: generate +linkcheck: generate version-check mkdir -p build/linkcheck build/doctrees $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck $(FILES) @echo |
