Skip to content

Doc parallel build #6993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 29, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
BLD: add -n flag to control parallel doc build
  • Loading branch information
tacaswell committed Aug 28, 2016
commit 08d4b1998b6f2b0d7937f41ea241f4190363352c
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ script:
gdb -return-child-result -batch -ex r -ex bt --args python tests.py -s --processes=$NPROC --process-timeout=300 $TEST_ARGS
else
cd doc
python make.py html
python make.py html -n 2
# We don't build the LaTeX docs here, so linkchecker will complain
touch build/html/Matplotlib.pdf
linkchecker build/html/index.html
Expand Down
8 changes: 7 additions & 1 deletion doc/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def html(buildername='html'):
if warnings_as_errors:
options = options + ' -W'
if os.system('sphinx-build -j %d %s -b %s -d build/doctrees . build/%s' % (
2, options, buildername, buildername)):
n_proc, options, buildername, buildername)):
raise SystemExit("Building HTML failed.")

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

small_docs = False
warnings_as_errors = True
n_proc = 1

# Change directory to the one containing this file
current_dir = os.getcwd()
Expand Down Expand Up @@ -195,11 +196,16 @@ def all():
parser.add_argument("--allowsphinxwarnings",
help="Don't turn Sphinx warnings into errors",
action="store_true")
parser.add_argument("-n",
help="Number of parallel workers to use")

args = parser.parse_args()
if args.small:
small_docs = True
if args.allowsphinxwarnings:
warnings_as_errors = False
if args.n is not None:
n_proc = int(args.n)

if args.cmd:
for command in args.cmd:
Expand Down