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

Fix RtD silent build failure in autodoc directive #293

Merged
merged 19 commits into from
Jul 29, 2020

Conversation

tlvu
Copy link
Contributor

@tlvu tlvu commented Jul 24, 2020

Overview

This PR fixes RtD silent build failure in autodoc directive. The process list https://pavics-sdi.readthedocs.io/projects/raven/en/latest/processes.html is currently empty and it's not supposed to be like that. We never got alerted because it's failing silently.

Fixed RtD build: https://pavics-sdi.readthedocs.io/projects/raven/en/test-rtd-build/processes.html and matching RtD build log https://readthedocs.org/api/v2/build/11555558.txt (commit baba22f)

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.

Unrelated changes part of this PR (sorry !):

  • Refresh cookiecutter (first commit in this PR is technically not part of the intended fix of this PR).

  • Remove Travis-CI directive to only build master branch so all dev branch gets build on Travis-CI. Otherwise we either have to create a PR when branch is not even ready or hardcode branch name in .travis.yml and have to remember to remove it at the end, very annoying. See comment in Bias correction #292 (comment)

Additional Information

Matching cookiecutter PR bird-house/cookiecutter-birdhouse#96

@richardarsenault You are probably not interested in the low level details in this PR. I just want to draw your attention to the fact that I found 2 notebooks missing in the toctree (Region_selection.ipynb, Running_models_with_multiple_timeseries_files.ipynb). I added them to the end of the toctree, wonder if you are okay with the ordering or these 2 notebooks were intended to not appear in the doc.

tlvu added 16 commits July 20, 2020 19:49
Warning, treated as error:
/repos/raven/docs/source/index.rst:14:toctree contains reference to nonexisting document 'pyraven'
Makefile:23: recipe for target 'html' failed
Warning, treated as error:
autodoc: failed to import process 'processes.RavenProcess' from module 'raven'; the following exception was raised:
No module named 'xskillscore'
Makefile:23: recipe for target 'html' failed

Could not mock import xskillscore because of

import xskillscore as xs

  File "/repos/raven/raven/processes/wps_forecast_evaluation.py", line 13, in <module>
    all_metrics = xs.core.deterministic.__all__ + xs.core.probabilistic.__all__
TypeError: unsupported operand type(s) for +: '__all__' and '__all__'
Warning, treated as error:
autodoc: failed to import process 'processes.RavenProcess' from module 'raven'; the following exception was raised:
bottleneck modules failed to import, likely due to a mismatch in NumPy versions. Either upgrade numpy to 1.16+ or install with:
        pip install --no-build-isolation --no-cache-dir bottleneck
Makefile:23: recipe for target 'html' failed
make[1]: *** [html] Error 2
  File "/home/lvu/.conda/envs/raven-docs/lib/python3.6/site-packages/properscoring/_crps.py", line 9, in <module>
    _normconst = 1.0 / np.sqrt(2.0 * np.pi)
TypeError: unsupported operand type(s) for *: 'float' and 'pi'
Warning, treated as error:
/zstore/repos/raven/docs/source/notebooks/Region_selection.ipynb:document isn't included in any toctree
Makefile:23: recipe for target 'html' failed
make[1]: *** [html] Error 2
…octree

Warning, treated as error:
/zstore/repos/raven/docs/source/notebooks/Running_models_with_multiple_timeseries_files.ipynb:document isn't included in any toctree
Makefile:23: recipe for target 'html' failed
make[1]: *** [html] Error 2
To avoid having to harcode new dev branch name each time to trigger
Travis-CI or having to create PR too early to trigger Travis-CI and spam
everyone in the process.

I just want to test my doc changes on Travis-CI.
…s-CI

RtD also build epub and latex format so have to enable them on
Travis-CI.

Warning, treated as error:
conf value "version" should not be empty for EPUB3
Makefile:23: recipe for target 'html' failed
make[1]: *** [html] Error 2
$ make SPHINXOPTS='-b epub' docs
Generating docs with Sphinx ...
make[1]: Entering directory '/zstore/repos/raven/docs'
Removing everything under 'build'...
Running Sphinx v3.1.2
making output directory... done

Warning, treated as error:
conf value "version" should not be empty for EPUB3
Makefile:23: recipe for target 'html' failed
make[1]: *** [html] Error 2
make[1]: Leaving directory '/zstore/repos/raven/docs'
Makefile:257: recipe for target 'docs' failed
make: *** [docs] Error 2
WARNING: unknown mimetype for _static/README.txt, ignoring
WARNING: unknown mimetype for _static/favicon.ico, ignoring
WARNING: unknown mimetype for notebooks/Delineation_workflow.ipynb, ignoring
WARNING: unknown mimetype for notebooks/Perform_Regionalization.ipynb, ignoring
WARNING: unknown mimetype for notebooks/Raven_run_parallel_basins.ipynb, ignoring
WARNING: unknown mimetype for notebooks/Region_selection.ipynb, ignoring
WARNING: unknown mimetype for notebooks/Run_Raven_with_Parallel_parameters.ipynb, ignoring
WARNING: unknown mimetype for notebooks/Running_models_with_multiple_timeseries_files.ipynb, ignoring
WARNING: unknown mimetype for notebooks/canopex.ipynb, ignoring
WARNING: unknown mimetype for notebooks/computing_objective_functions.ipynb, ignoring
WARNING: unknown mimetype for notebooks/getting_variables_other_than_flow.ipynb, ignoring
WARNING: unknown mimetype for notebooks/gridded_data_subset.ipynb, ignoring
WARNING: unknown mimetype for notebooks/multi_model_simulation.ipynb, ignoring
WARNING: unknown mimetype for notebooks/running_OSTRICH_gr4jcn.ipynb, ignoring
WARNING: unknown mimetype for notebooks/running_OSTRICH_hbvec.ipynb, ignoring
WARNING: unknown mimetype for notebooks/running_OSTRICH_hmets.ipynb, ignoring
WARNING: unknown mimetype for notebooks/running_OSTRICH_mohyse.ipynb, ignoring
WARNING: unknown mimetype for notebooks/running_gr4jcn.ipynb, ignoring
WARNING: unknown mimetype for notebooks/running_hbv_ec.ipynb, ignoring
WARNING: unknown mimetype for notebooks/running_hmets.ipynb, ignoring
WARNING: unknown mimetype for notebooks/running_mohyse.ipynb, ignoring
WARNING: unknown mimetype for notebooks/time_series_analysis.ipynb, ignoring
WARNING: unknown mimetype for notebooks/watershed_subset.ipynb, ignoring
Wrong syntax introduced in my earlier commit 6e6f637.
@tlvu
Copy link
Contributor Author

tlvu commented Jul 24, 2020

@richardarsenault
Copy link
Contributor

@tlvu Yeah that seems OK to me (the notebooks I mean). They are supposed to be there so that looks good to me. Can't really comment on the other things though!

Copy link
Contributor

@Zeitsperre Zeitsperre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Are most of these changes adapted from the cookiecutter?

Dockerfile Outdated Show resolved Hide resolved
@tlvu
Copy link
Contributor Author

tlvu commented Jul 27, 2020

Are most of these changes adapted from the cookiecutter?

Yes and new changes are also backported back to the cookiecutter.

tlvu added 2 commits July 29, 2020 14:51
test: pin older version of pytest because current nbval 0.9.5 is not compatible with latest pytest 6.0.0

See bird-house/cookiecutter-birdhouse@b696969
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
@tlvu tlvu merged commit 6e56ed1 into master Jul 29, 2020
@tlvu tlvu deleted the fix-rtd-silent-build-failure-in-autodoc-directive branch July 29, 2020 22:12
Zeitsperre pushed a commit that referenced this pull request Aug 17, 2023
…in-autodoc-directive

Fix RtD silent build failure in autodoc directive.

This PR fixes RtD silent build failure in autodoc directive.  The process list https://pavics-sdi.readthedocs.io/projects/raven/en/latest/processes.html is currently empty and it's not supposed to be like that.  We never got alerted because it's failing silently.

Fixed RtD build: https://pavics-sdi.readthedocs.io/projects/raven/en/test-rtd-build/processes.html and matching RtD build log https://readthedocs.org/api/v2/build/11555558.txt (commit 5521c48)

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.

Unrelated changes part of this PR (sorry !):

* Refresh cookiecutter (first commit in this PR is technically not part of the intended fix of this PR).

* Remove Travis-CI directive to only build `master` branch so all dev branch gets build on Travis-CI.  Otherwise we either have to create a PR when branch is not even ready or hardcode branch name in `.travis.yml` and have to remember to remove it at the end, very annoying.  See comment in #292 (comment)

## Additional Information

Matching cookiecutter PR bird-house/cookiecutter-birdhouse#96

@richardarsenault You are probably not interested in the low level details in this PR.  I just want to draw your attention to the fact that I found 2 notebooks missing in the toctree (Region_selection.ipynb, Running_models_with_multiple_timeseries_files.ipynb).  I added them to the end of the toctree, wonder if you are okay with the ordering or these 2 notebooks were intended to not appear in the doc.
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

3 participants