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

Increase the strictness of the tox environment for building documentation #1587

Merged
merged 29 commits into from
Jun 30, 2022

Conversation

namurphy
Copy link
Member

Prior to this pull request, our documentation builds would pass when there were typos like plsmapy.formulary. Because of this, we ended up with a bunch of broken reST links that built up over time. I ended up doing some large PRs to fix these (e.g., #1207, #1257, and #1509).

This PR enables the -n option for sphinx-build in the build_docs environment for tox. This will cause warnings to be emitted when there are broken reST links. The -W flag (which was already present) made it so that the build would fail in case of any warnings. Having the -n option enabled will prevent the situation where broken reST links get passed through silently.

This is a follow-up on #1206.

@codecov
Copy link

codecov bot commented Jun 17, 2022

Codecov Report

Merging #1587 (3852137) into main (e6563c3) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1587   +/-   ##
=======================================
  Coverage   97.21%   97.21%           
=======================================
  Files          83       83           
  Lines        7961     7961           
=======================================
  Hits         7739     7739           
  Misses        222      222           
Impacted Files Coverage Δ
plasmapy/particles/particle_class.py 99.00% <ø> (ø)
plasmapy/utils/_units_definitions.py 100.00% <ø> (ø)
plasmapy/utils/_units_helpers.py 100.00% <ø> (ø)
plasmapy/formulary/distribution.py 100.00% <100.00%> (ø)
plasmapy/particles/particle_collections.py 99.21% <100.00%> (ø)

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 e6563c3...3852137. Read the comment docs.

@namurphy
Copy link
Member Author

Oh, good. Only 959 lines of warnings this time. 😐

(Fortunately, though, most of them are the same warning but just repeated.)

@namurphy namurphy added no changelog entry needed docs PlasmaPy Docs at http://docs.plasmapy.org labels Jun 17, 2022
@github-actions github-actions bot added the plasmapy.particles Related to the plasmapy.particles subpackage label Jun 17, 2022
@github-actions github-actions bot added plasmapy.formulary Related to the plasmapy.formulary subpackage plasmapy.utils Related to the plasmapy.utils subpackage labels Jun 17, 2022
@namurphy namurphy changed the title Use "nitpicky" documentation builds for CI Increase the strictness of the tox environment for building documentation Jun 18, 2022
@namurphy namurphy marked this pull request as ready for review June 18, 2022 01:46
@namurphy
Copy link
Member Author

I think this is the first time I've gotten a nitpicky doc build to work without errors! 🥲

Comment on lines +1 to +8
:orphan:

`plasmapy.particles.particle_collections`
=========================================

.. currentmodule:: plasmapy.particles.particle_collections

.. automodapi:: plasmapy.particles.particle_collections
Copy link
Member Author

Choose a reason for hiding this comment

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

This had only been missing for approximately 4.2 × 107 seconds!

@namurphy namurphy added the status: ready for review PRs that are ready for code review label Jun 18, 2022
@namurphy namurphy requested a review from a team June 18, 2022 01:54
@rocco8773 rocco8773 added this to the 0.8.0 milestone Jun 28, 2022
@@ -59,7 +59,7 @@ Deprecations and Removals
`~plasmapy.particles.ionization_state.IonizationState.charge_numbers`. (`#1136 <https://github.com/plasmapy/plasmapy/pull/1136>`__)
Copy link
Member

Choose a reason for hiding this comment

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

For a future thought... Do we want to keep this CHANGELOG.rst? It feels like we're just duplicating the information. To me it makes more sense to remove this file and rename docs/whatsnew -> docs/changelog, and only have the changelog in one location. The only reason I see to keep CHANGELOG.rst is if towncrier forces us to keep it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point! I'm wondering about having the separate whatsnew pages for each of the releases, and then having a main changelog page that doesn't duplicate the information, but rather does a .. include:: directive for each of the whatsnew pages. I find it useful to have a full changelog page as well as the separate whatsnew pages (which we can link to in release announcements), though we have a couple of options that would work well. In any case, we'll gain some experience with towncrier in the next few days.

Copy link
Member

Choose a reason for hiding this comment

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

I've used .. include:: in the past, but I've been moving away from it because is presents a potential security hole. I don't think it's a big deal in our usage, but still...

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, it's best to avoid potential security holes even if it doesn't seem like it'll affect us. I'll link to this comment in #1595 as a post-release thing to think about or create an issue on.

Copy link
Member

@rocco8773 rocco8773 left a comment

Choose a reason for hiding this comment

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

I'm going to review this as one of the last PRs for the 0.8.0 release. I think a lot of these changes would also be a part of #1597.

Comment on lines 1 to 3
Reduced execution time by avoiding calculations with units while keeping
unit validation. Added :file:`plasmapy/utils/units_definitions.py` to
precompute units.
Copy link
Member

Choose a reason for hiding this comment

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

This entry does not make sense on it's own. There is no context. Reduced execution timing of what? What is units_definitions.py? Also, this seems like two separate changelog entries.

Comment on lines 1 to 4
Increased the strictness of the ``build_docs`` tox_ environment so that
broken reST_ links now emit warnings which are then treated as errors,
removed the ``build_docs_nitpicky`` tox_ environment, and updated the
|documentation guide| accordingly.
Copy link
Member

Choose a reason for hiding this comment

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

Possibly add something about fixing all links that were failing under nitpicky. This could be added to this entry or as its own.

Copy link
Member

@rocco8773 rocco8773 left a comment

Choose a reason for hiding this comment

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

This looks nearly there. Just need to address those few comments I had and then we're all good.

@namurphy namurphy requested a review from rocco8773 June 30, 2022 01:54
@namurphy namurphy merged commit 55d7874 into PlasmaPy:main Jun 30, 2022
@namurphy namurphy deleted the doc-build-nitpicky branch June 30, 2022 01:59
@namurphy namurphy removed the status: ready for review PRs that are ready for code review label Jun 30, 2022
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 no changelog entry needed plasmapy.formulary Related to the plasmapy.formulary subpackage plasmapy.particles Related to the plasmapy.particles subpackage plasmapy.utils Related to the plasmapy.utils subpackage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants