File tree Expand file tree Collapse file tree 2 files changed +55
-3
lines changed
Expand file tree Collapse file tree 2 files changed +55
-3
lines changed Original file line number Diff line number Diff line change 11PYTHON ?= python
2- SPHINX_BUILD ?= $(PYTHON ) -m sphinx.cmd.build
32
43.PHONY : man html
54man html :
6- $(SPHINX_BUILD ) -a -b $@ doc build/sphinx/$@
5+ doc/build.sh $@ " $$ (pwd)/build/sphinx/$@ "
6+
7+ html : man
8+
9+ .PHONY : docs
10+ docs : man html
711
812.PHONY : sdist wheel
913sdist wheel :
1014 $(PYTHON ) -m build --$@
1115
16+ sdist : man
17+
18+ .PHONY : release
19+ release : sdist wheel
20+
1221.PHONY : clean
1322clean :
14- $(RM ) -r build/sphinx doc/api doc/generated doc/_build dist
23+ $(RM ) -rf build/sphinx doc/api doc/generated doc/_build dist
1524
1625.PHONY : format
1726format :
1827 $(PYTHON ) -m ruff format
28+
29+ .PHONY : dev-environment
30+ dev-environment :
31+ $(PYTHON ) -m pip install -e .[test,doc,formatter]
Original file line number Diff line number Diff line change 1+ #! /bin/bash -e
2+ base=$( dirname " $( dirname " $( readlink -f " $0 " ) " ) " )
3+
4+ if [ ${# } -ne 2 ]; then
5+ echo " requires 2 arguments; the sphinx mode, and where to put the output."
6+ exit 1;
7+ fi
8+ mode=" $1 "
9+ output=" $2 "
10+
11+
12+
13+ # the point of this script is to capture sphinx output for extension
14+ # failures, and also dump that log automatically.
15+
16+ # force US; sphinx errors are localized, and we're abusing grep.
17+ export LANG=en_US.UTF-8
18+
19+ # capture stderr
20+ t=$( mktemp)
21+ if python -m sphinx.cmd.build -a -b " $mode " " $base /doc" " $output " 2> $t ; then
22+ exit $?
23+ fi
24+
25+ # extract the traceback path
26+ dump=$( grep -A1 ' traceback has been saved in' " $t " | tail -n1)
27+ cat < " $t "
28+ echo
29+ if [ -z " $dump " ]; then
30+ echo " FAILED auto extracting the traceback file. you'll have to do it manually"
31+ else
32+ echo
33+ echo " contents of $dump "
34+ echo
35+ cat < " $dump "
36+ rm " $t "
37+ fi
38+
39+ exit 2
You can’t perform that action at this time.
0 commit comments