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

Refresh cookiecutter for more robust doc build #105

Merged
merged 6 commits into from
Jul 30, 2020

Conversation

tlvu
Copy link
Contributor

@tlvu tlvu commented Jul 29, 2020

Overview

This PR applies the cookiecutter PR bird-house/cookiecutter-birdhouse#96 to ensure no silent ReadTheDocs build failure and for Travis-CI to also catch ReadTheDocs build failure before PR is merged.

Successful RtD generation: https://emu.readthedocs.io/en/test-rtd-build/ and matching RtD build logs: https://readthedocs.org/api/v2/build/11555381.txt

Changes:

  • Turn RtD warnings to build failure so they do not fail silently.

  • Change Travis-CI build config to also build Epub and Latex doc format to catch RtD failure on Travis-CI before PR is merged.

  • Various changes to remove all warnings in doc build since warnings will now fail the doc build.

    • For doc build only, to work-around warnings, use a new PYWPS release to support RST anonymous links, currently installing PYWPS from source (with commit hash locked so it is reproducible) since no release yet (PR ext_autodoc: support RST anonymous link geopython/pywps#542)

    • Anaconda build badge do not exist anymore so it had to be removed.

Unrelated changes part of this PR (sorry !):

  • Other cookiecutter changes that are unapplied previously are also part of this PR. You might want to look at each commit to avoid the noises.

tlvu added 6 commits July 28, 2020 17:48
Warning, treated as error:
/zstore/repos/emu/emu/processes/wps_wordcounter.py:docstring of emu.processes.wps_wordcounter.WordCounter:15:Unexpected section title or transition.

-----
Makefile:20: recipe for target 'html' failed
make[1]: *** [html] Error 2
make[1]: Leaving directory '/zstore/repos/emu/docs'
Makefile:166: recipe for target 'docs' failed
make: *** [docs] Error 2

Warning, treated as error:
/zstore/repos/emu/emu/processes/wps_chomsky.py:docstring of emu.processes.wps_chomsky.Chomsky:11:Unexpected section title or transition.

-----
Makefile:20: recipe for target 'html' failed
make[1]: *** [html] Error 2
make[1]: Leaving directory '/zstore/repos/emu/docs'
Makefile:166: recipe for target 'docs' failed
make: *** [docs] Error 2

Warning, treated as error:
/zstore/repos/emu/emu/processes/wps_ncmeta.py:docstring of emu.processes.wps_ncmeta.NCMeta:17:Unexpected section title or transition.

-----
Makefile:20: recipe for target 'html' failed
make[1]: *** [html] Error 2
make[1]: Leaving directory '/zstore/repos/emu/docs'
Makefile:166: recipe for target 'docs' failed
make: *** [docs] Error 2
…llowing anonymous links

Warning, treated as error:
/zstore/repos/emu/emu/processes/wps_wordcounter.py:docstring of emu.processes.wps_wordcounter.WordCounter:18:Duplicate explicit target name: "user guide".
Makefile:20: recipe for target 'html' failed
make[1]: *** [html] Error 2
make[1]: Leaving directory '/zstore/repos/emu/docs'
Makefile:165: recipe for target 'docs' failed
make: *** [docs] Error 2

All warnings fixed:

/home/docs/checkouts/readthedocs.org/user_builds/emu/checkouts/test-rtd-build/emu/processes/wps_wordcounter.py:docstring of emu.processes.wps_wordcounter.WordCounter:18: WARNING: Duplicate explicit target name: "user guide".
/home/docs/checkouts/readthedocs.org/user_builds/emu/checkouts/test-rtd-build/emu/processes/wps_ncmeta.py:docstring of emu.processes.wps_ncmeta.NCMeta:20: WARNING: Duplicate explicit target name: "user guide".
/home/docs/checkouts/readthedocs.org/user_builds/emu/checkouts/test-rtd-build/emu/processes/wps_error.py:docstring of emu.processes.wps_error.ShowError:24: WARNING: Duplicate explicit target name: "user guide".
/home/docs/checkouts/readthedocs.org/user_builds/emu/checkouts/test-rtd-build/emu/processes/wps_dry_run.py:docstring of emu.processes.wps_dry_run.SimpleDryRun:16: WARNING: Duplicate explicit target name: "user guide".
/home/docs/checkouts/readthedocs.org/user_builds/emu/checkouts/test-rtd-build/emu/processes/wps_multiple_outputs.py:docstring of emu.processes.wps_multiple_outputs.MultipleOutputs:14: WARNING: Duplicate explicit target name: "user guide".
/home/docs/checkouts/readthedocs.org/user_builds/emu/checkouts/test-rtd-build/emu/processes/wps_inout.py:docstring of emu.processes.wps_inout.InOut:59: WARNING: Duplicate explicit target name: "user guide".
/home/docs/checkouts/readthedocs.org/user_builds/emu/checkouts/test-rtd-build/emu/processes/wps_inout.py:docstring of emu.processes.wps_inout.InOut:59: WARNING: Duplicate explicit target name: "pywps docs".
/home/docs/checkouts/readthedocs.org/user_builds/emu/checkouts/test-rtd-build/emu/processes/wps_inout.py:docstring of emu.processes.wps_inout.InOut:59: WARNING: Duplicate explicit target name: "pywps docs".
Looks like the trick only works when the same link label is repeated across
different documents.

No choice but to also change the link label so they are different.

Warning, treated as error:
/zstore/repos/emu/emu/processes/wps_inout.py:docstring of emu.processes.wps_inout.InOut:59:Duplicate explicit target name: "pywps docs".
Makefile:20: recipe for target 'html' failed
make[1]: *** [html] Error 2
make[1]: Leaving directory '/zstore/repos/emu/docs'
Makefile:166: recipe for target 'docs' failed
make: *** [docs] Error 2
https://anaconda.org/birdhouse/emu/badges to not have build badge.

Warning, treated as error:
Could not fetch remote image: http://anaconda.org/birdhouse/emu/badges/build.svg [404]
Makefile:20: recipe for target 'html' failed
make[1]: *** [html] Error 2
make[1]: Leaving directory '/zstore/repos/emu/docs'
Makefile:166: recipe for target 'docs' failed
make: *** [docs] Error 2
@tlvu tlvu requested a review from cehbrecht July 29, 2020 18:46
tlvu added a commit to bird-house/cookiecutter-birdhouse that referenced this pull request Jul 29, 2020
…empty-autodoc-processes-list

Fix empty autodoc processes list silent docs build failure.

Currently, autodoc failure are treated as warnings only, resulting in
empty processes list, see
https://pavics-sdi.readthedocs.io/projects/raven/en/latest/processes.html.

This fix will turn these warnings into build failure on RtD and on
Travis-CI so we can catch those errors earlier.

Right now these warnings are falling silently !

Also changed Travis-CI config so it also builds Epub and Latex format as RtD to catch RtD errors before PR is merged.

Common fixes for those warnings are backported here.

Bonus we also catch nonexisting document reference and missing reference
in toctree, see below sample Raven warnings during docs build.

Raven succesful build logs with warnings on RtD:
https://readthedocs.org/api/v2/build/11487109.txt

/home/docs/checkouts/readthedocs.org/user_builds/pavics-raven/checkouts/latest/docs/source/index.rst:14:
WARNING: toctree contains reference to nonexisting document 'pyraven'
WARNING: autodoc: failed to import process 'processes.RavenProcess' from
module 'raven'; the following exception was raised:
No module named 'xclim.core'
WARNING: autodoc: failed to import process
'processes.RavenGR4JCemaNeigeProcess' from module 'raven'; the following
exception was raised:
No module named 'xclim.core'
WARNING: autodoc: failed to import process
'processes.RavenMOHYSEProcess' from module 'raven'; the following
exception was raised:
No module named 'xclim.core'
WARNING: autodoc: failed to import process 'processes.RavenHMETSProcess'
from module 'raven'; the following exception was raised:
No module named 'xclim.core'
WARNING: autodoc: failed to import process 'processes.RavenHBVECProcess'
from module 'raven'; the following exception was raised:
No module named 'xclim.core'
WARNING: autodoc: failed to import process
'processes.ObjectiveFunctionProcess' from module 'raven'; the following
exception was raised:
No module named 'xclim.core'
looking for now-outdated files... none found
pickling environment... done
checking consistency...
/home/docs/checkouts/readthedocs.org/user_builds/pavics-raven/checkouts/latest/docs/source/notebooks/Region_selection.ipynb:
WARNING: document isn't included in any toctree
/home/docs/checkouts/readthedocs.org/user_builds/pavics-raven/checkouts/latest/docs/source/notebooks/Running_models_with_multiple_timeseries_files.ipynb:
WARNING: document isn't included in any toctree

This PR has been tested on Raven PR Ouranosinc/raven#293, Finch PR bird-house/finch#130, FlyingPigeon bird-house/flyingpigeon#337, bird-house/flyingpigeon#336, Emu bird-house/emu#105
@cehbrecht cehbrecht added this to the 1.0.0 milestone Jul 30, 2020
@cehbrecht
Copy link
Member

@tlvu should we wait for the pywps release? Otherwise feel free to merge.

@tlvu
Copy link
Contributor Author

tlvu commented Jul 30, 2020

@tlvu should we wait for the pywps release? Otherwise feel free to merge.

Please make a pywps release but I'll merge now since this is fully working given I've locked the pywps PR commit in the pip install.

I have a few more cookiecutter fixes I intend to do so I'll still be around the birds to pull in the new pywps release once available. Thanks a lot for your help.

@tlvu tlvu merged commit f8605c3 into master Jul 30, 2020
@tlvu tlvu deleted the refresh-cookiecutter-more-robust-doc-build branch July 30, 2020 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants