Skip to content

Treat Sphinx warnings as errors when building docs on Travis #3770

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
Nov 12, 2014
Merged
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
Next Next commit
Add option to treat sphinx warnings as errors
  • Loading branch information
jenshnielsen committed Nov 10, 2014
commit dd3aed1b8f7047c378cdfe0e3e4f048ba9a8109a
8 changes: 8 additions & 0 deletions doc/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def html(buildername='html'):
options = "-D plot_formats=\"[('png', 80)]\""
else:
options = ''
if warnings_as_errors:
options = options + ' -W'
if os.system('sphinx-build %s -b %s -d build/doctrees . build/%s' % (options, buildername, buildername)):
raise SystemExit("Building HTML failed.")

Expand Down Expand Up @@ -136,6 +138,7 @@ def all():


small_docs = False
warnings_as_errors = False

# Change directory to the one containing this file
current_dir = os.getcwd()
Expand Down Expand Up @@ -180,9 +183,14 @@ def all():
parser.add_argument("--small",
help="Smaller docs with only low res png figures",
action="store_true")
parser.add_argument("--warningsaserrors",
help="Turn Sphinx warnings into errors",
action="store_true")
args = parser.parse_args()
if args.small:
small_docs = True
if args.warningsaserrors:
warnings_as_errors = True

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