Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 08d4b19

Browse files
committed
BLD: add -n flag to control parallel doc build
1 parent 26638c9 commit 08d4b19

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ script:
142142
gdb -return-child-result -batch -ex r -ex bt --args python tests.py -s --processes=$NPROC --process-timeout=300 $TEST_ARGS
143143
else
144144
cd doc
145-
python make.py html
145+
python make.py html -n 2
146146
# We don't build the LaTeX docs here, so linkchecker will complain
147147
touch build/html/Matplotlib.pdf
148148
linkchecker build/html/index.html

doc/make.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def html(buildername='html'):
5353
if warnings_as_errors:
5454
options = options + ' -W'
5555
if os.system('sphinx-build -j %d %s -b %s -d build/doctrees . build/%s' % (
56-
2, options, buildername, buildername)):
56+
n_proc, options, buildername, buildername)):
5757
raise SystemExit("Building HTML failed.")
5858

5959
# Clean out PDF files from the _images directory
@@ -147,6 +147,7 @@ def all():
147147

148148
small_docs = False
149149
warnings_as_errors = True
150+
n_proc = 1
150151

151152
# Change directory to the one containing this file
152153
current_dir = os.getcwd()
@@ -195,11 +196,16 @@ def all():
195196
parser.add_argument("--allowsphinxwarnings",
196197
help="Don't turn Sphinx warnings into errors",
197198
action="store_true")
199+
parser.add_argument("-n",
200+
help="Number of parallel workers to use")
201+
198202
args = parser.parse_args()
199203
if args.small:
200204
small_docs = True
201205
if args.allowsphinxwarnings:
202206
warnings_as_errors = False
207+
if args.n is not None:
208+
n_proc = int(args.n)
203209

204210
if args.cmd:
205211
for command in args.cmd:

0 commit comments

Comments
 (0)