Skip to content
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

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

Merged
merged 4 commits into from Nov 12, 2014

Conversation

jenshnielsen
Copy link
Member

This pr sits on top of #3737 and #3768 which should be reviewed and merged before this one could be considered.

It does a number of things:

  • Fix the last warnings when building html docs by excluding files not in the toc tree. @tacaswell I am not sure how you intended the individual files in api_changes and whats_new to be included in the docs. For now I just excluded them to get a clean build
  • Rewrite make.py to use argparse to handle commandline arguments. To make it simpler to extend the cmd arguments.
  • Add a warningsaserror flag to make.py (for now it only has an effect on the html docs) defaulta to false
  • Turn this flag on when building the docs on Travis.

I think that it is a good idea to eliminate all the Sphinx warnings when building the docs. The fixes I have made to eliminate them resulted in a number of small fixes to the docs. Broken links, wrongly formatted text etc. The issues are much easier to fix right away in the pull request stage than later (especially since the tracebacks from autodoc are often misleading) So this should ensure that no new Sphinx issues are introduced into the docs.

@jenshnielsen jenshnielsen added this to the v1.5.x milestone Nov 9, 2014
@tacaswell
Copy link
Member

The plan is to add a script to the doc build process (because it is not complicated enough yet) that aggregates them by date and adds them to the top of the proper files. Supposedly IPython has such a script, but I could not find it last time I looked.

The motivation for this was to avoid all of the rebases/messy merges that were required due to text conflicts in whats_new.rst and api_changes.rst.

@mdboom
Copy link
Member

mdboom commented Nov 10, 2014

Cool. Hopefully this will help us keep the improperly formatted docs away once and for all.

Something to consider -- should "warnings as errors" be the default? Then building the docs locally will also make these problems obvious to developers before the changes hit Travis...

@jenshnielsen
Copy link
Member Author

Yes I would vote for changing the default to warnings as errors. But I thought it was better to go with a soft option in the beginning.

tacaswell added a commit that referenced this pull request Nov 12, 2014
DOC/BLD : Treat Sphinx warnings as errors when building docs on Travis
@tacaswell tacaswell merged commit ef9fc19 into matplotlib:master Nov 12, 2014
@jenshnielsen jenshnielsen deleted the doc_w_as_error branch November 14, 2014 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants