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

Update tox configuration for building docs #1206

Merged
merged 17 commits into from
Aug 11, 2021

Conversation

namurphy
Copy link
Member

@namurphy namurphy commented Jul 23, 2021

This makes/proposes a few changes:

  • I added a new test, build_docs_nitpicky, that issues warnings for missing links.
  • I added the --keep-going flag when we have the -W flag. This way the test doc build will keep going after a warning, which will let us fix multiple warnings at the same time instead of having to wait for the doc build run multiple times.
  • I changed all doc builds to use --parallel=auto. This is experimental, and does not make the change in GitHub Actions alter our GitHub Actions setup, so as far as I can tell, the doc builds there will still only be done on one core rather than in parallel. (edited as a clarification)

@codecov
Copy link

codecov bot commented Jul 23, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@df46639). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head 795ab10 differs from pull request most recent head b46f96f. Consider uploading reports for the commit b46f96f to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1206   +/-   ##
=======================================
  Coverage        ?   96.99%           
=======================================
  Files           ?       71           
  Lines           ?     7050           
  Branches        ?        0           
=======================================
  Hits            ?     6838           
  Misses          ?      212           
  Partials        ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update df46639...b46f96f. Read the comment docs.

@namurphy
Copy link
Member Author

Building the docs in nitpicky mode:

build finished with problems, 1466 warnings.

Huh.

Copy link
Member

@StanczakDominik StanczakDominik left a comment

Choose a reason for hiding this comment

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

The changes themselves look good! I can approve it now while we wait for the other PRs to go into main.

@github-actions github-actions bot added the docs PlasmaPy Docs at http://docs.plasmapy.org label Jul 27, 2021
@namurphy namurphy marked this pull request as ready for review July 27, 2021 15:51
tox.ini Outdated
@@ -41,14 +41,21 @@ changedir = {toxinidir}
extras = docs
setenv =
HOME = {envtmpdir}
commands = sphinx-build docs docs{/}_build{/}html -W -b html
commands = sphinx-build docs docs{/}_build{/}html -W --keep-going -j=auto -b html
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
commands = sphinx-build docs docs{/}_build{/}html -W --keep-going -j=auto -b html
commands = sphinx-build docs docs{/}_build{/}html -W --keep-going -b html {posargs}

Copy link
Member

Choose a reason for hiding this comment

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

tox -- -j=auto in github action workflow

@namurphy
Copy link
Member Author

namurphy commented Jul 27, 2021

From today's meeting...

  • don't set auto-parallelization by default.

Comment on lines +132 to +136
When writing documentation, please make sure to fix any warnings that
arise. To enforce this, the ``build_docs`` and ``build_docs_nitpicky``
tox_ environments will fail after completing the documentation build
if they encountered any warnings (via the ``-W`` and ``--keep-going``
flags to `sphinx-build`_).
Copy link
Member

Choose a reason for hiding this comment

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

Would you like to add a github action for nitpicky?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not yet, but I would really like to once all of the ∼10³ nitpicky warnings → errors are resolved. That's going to take some time and might also depend on #1158 (and/or maybe #1149?) to be resolved to define what optional, etc. mean in the parameters section of docstrings. Eventually a GitHub Action for nitpicky would be great!

@namurphy
Copy link
Member Author

pre-commit.ci autofix

@namurphy namurphy merged commit 009d82c into PlasmaPy:main Aug 11, 2021
@namurphy namurphy deleted the tox-docs-nitpicky branch August 11, 2021 11:06
Tlord18 pushed a commit to Tlord18/PlasmaPy that referenced this pull request Oct 6, 2021
* Add build_docs_nitpicky test thing to tox.ini

* Continue doc build after a warning when using -W option

* Add --parallel=auto flag to doc builds with tox

* Fix parallel argument to sphinx-build for tox

* Fix order of options

* Add changelog entry for tox docs env updates

* Update doc guide on tox environments

* Add changelog entry for updating doc guide regarding tox envs

* Update doc guide section on tox docs builds

* Fix reST link

* Remove auto parallelization for doc builds via tox

* Separate changelog entries

* Further details on the -j flag for parallelization in doc builds

Co-authored-by: Erik Everson <[email protected]>

* Separate changelog entries

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: Erik Everson <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Tlord18 pushed a commit to Tlord18/PlasmaPy that referenced this pull request Oct 6, 2021
* Add build_docs_nitpicky test thing to tox.ini

* Continue doc build after a warning when using -W option

* Add --parallel=auto flag to doc builds with tox

* Fix parallel argument to sphinx-build for tox

* Fix order of options

* Add changelog entry for tox docs env updates

* Update doc guide on tox environments

* Add changelog entry for updating doc guide regarding tox envs

* Update doc guide section on tox docs builds

* Fix reST link

* Remove auto parallelization for doc builds via tox

* Separate changelog entries

* Further details on the -j flag for parallelization in doc builds

Co-authored-by: Erik Everson <[email protected]>

* Separate changelog entries

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: Erik Everson <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs PlasmaPy Docs at http://docs.plasmapy.org
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants