1# Makefile for Sphinx documentation 2# 3 4# You can set these variables from the command line. 5SPHINXOPTS = 6SPHINXBUILD = sphinx-build 7PAPER = 8BUILDDIR = _build 9 10# Internal variables. 11PAPEROPT_a4 = -D latex_paper_size=a4 12PAPEROPT_letter = -D latex_paper_size=letter 13ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 14 15REGENDOC_ARGS := \ 16 --normalize "/in \d+.\d+ seconds/in 0.12 seconds/" \ 17 --normalize "@/tmp/pytest-of-.*/pytest-\d+@PYTEST_TMPDIR@" \ 18 --normalize "@pytest-(\d+)\\.[^ ,]+@pytest-\1.x.y@" \ 19 --normalize "@(This is pytest version )(\d+)\\.[^ ,]+@\1\2.x.y@" \ 20 --normalize "@py-(\d+)\\.[^ ,]+@py-\1.x.y@" \ 21 --normalize "@pluggy-(\d+)\\.[.\d,]+@pluggy-\1.x.y@" \ 22 --normalize "@hypothesis-(\d+)\\.[.\d,]+@hypothesis-\1.x.y@" \ 23 --normalize "@Python (\d+)\\.[^ ,]+@Python \1.x.y@" 24 25.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest 26 27 28help: 29 @echo "Please use \`make <target>' where <target> is one of" 30 @echo " html to make standalone HTML files" 31 @echo " latexpdf to make LaTeX files and run them through pdflatex" 32 @echo " showtarget to show the pytest.org target directory" 33 @echo " install to install docs to pytest.org/SITETARGET" 34 @echo " install-ldf to install the doc pdf to pytest.org/SITETARGET" 35 @echo " regen to regenerate pytest examples using the installed pytest" 36 @echo " linkcheck to check all external links for integrity" 37 38clean: 39 -rm -rf $(BUILDDIR)/* 40 41regen: 42 PYTHONDONTWRITEBYTECODE=1 PYTEST_ADDOPT=-pno:hypothesis COLUMNS=76 regendoc --update *.rst */*.rst ${REGENDOC_ARGS} 43 44html: 45 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 46 @echo 47 @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 48 49dirhtml: 50 $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 51 @echo 52 @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 53 54singlehtml: 55 $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 56 @echo 57 @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 58 59pickle: 60 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 61 @echo 62 @echo "Build finished; now you can process the pickle files." 63 64json: 65 $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 66 @echo 67 @echo "Build finished; now you can process the JSON files." 68 69htmlhelp: 70 $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 71 @echo 72 @echo "Build finished; now you can run HTML Help Workshop with the" \ 73 ".hhp project file in $(BUILDDIR)/htmlhelp." 74 75qthelp: 76 $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 77 @echo 78 @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 79 ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 80 @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pytest.qhcp" 81 @echo "To view the help file:" 82 @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pytest.qhc" 83 84devhelp: 85 $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 86 @echo 87 @echo "Build finished." 88 @echo "To view the help file:" 89 @echo "# mkdir -p $$HOME/.local/share/devhelp/pytest" 90 @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pytest" 91 @echo "# devhelp" 92 93epub: 94 $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 95 @echo 96 @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 97 98latex: 99 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 100 @echo 101 @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 102 @echo "Run \`make' in that directory to run these through (pdf)latex" \ 103 "(use \`make latexpdf' here to do that automatically)." 104 105latexpdf: 106 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 107 @echo "Running LaTeX files through pdflatex..." 108 make -C $(BUILDDIR)/latex all-pdf 109 @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 110 111text: 112 $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 113 @echo 114 @echo "Build finished. The text files are in $(BUILDDIR)/text." 115 116man: 117 $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 118 @echo 119 @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 120 121changes: 122 $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 123 @echo 124 @echo "The overview file is in $(BUILDDIR)/changes." 125 126linkcheck: 127 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 128 @echo 129 @echo "Link check complete; look for any errors in the above output " \ 130 "or in $(BUILDDIR)/linkcheck/output.txt." 131 132doctest: 133 $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 134 @echo "Testing of doctests in the sources finished, look at the " \ 135 "results in $(BUILDDIR)/doctest/output.txt." 136 137texinfo: 138 mkdir -p $(BUILDDIR)/texinfo 139 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 140 @echo 141 @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 142 @echo "Run \`make' in that directory to run these through makeinfo" \ 143 "(use \`make info' here to do that automatically)." 144 145info: 146 mkdir -p $(BUILDDIR)/texinfo 147 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 148 @echo "Running Texinfo files through makeinfo..." 149 make -C $(BUILDDIR)/texinfo info 150 @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 151