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

Run Sphinx on CI to catch errors/warnings #1518

Merged
merged 8 commits into from May 8, 2020
Merged

Conversation

huonw
Copy link
Member

@huonw huonw commented May 6, 2020

This adds a CI step that runs Sphinx, and catches errors and warnings. This will help us keep our documentation rendering as good as possible.

It takes this approach rather than just setting fail_on_warning: true in the .readthedocs.yaml configuration file because we can get clearer and better error messages and description.

Example output, with the problems from before #1360 was fixed: https://buildkite.com/stellar/stellargraph-public/builds/3994#annotation-sphinx-doc-build

image

See: #1432

@codeclimate
Copy link

codeclimate bot commented May 6, 2020

Code Climate has analyzed commit a9ac99c and detected 0 issues on this pull request.

View more on Code Climate.

@huonw huonw marked this pull request as ready for review May 6, 2020 06:01
@huonw huonw requested review from timpitman and TheDen May 6, 2020 06:01
Copy link
Contributor

@timpitman timpitman left a comment

Choose a reason for hiding this comment

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

just a small question about requirements, but this looks excellent - much easier to see than digging in readthedocs 👍 📖

@@ -4,3 +4,4 @@ nbsphinx==0.6.1
nbsphinx-link==1.3.0
# needed for Pygments highlighting in notebooks
ipython==7.13.0
sphinx_rtd_theme==0.4.3
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not entirely sue why our existing doc requirements were pinned? rtd itself appears to install sphinx-rtd-theme<0.5

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I don't quite know why either. I guess it ensures our docs don't break accidentally, but maybe it's suboptimal for this, because we won't automatically pick up improvements to the theme. However, I think these will overrule the RtDs defaults (that is, our requirements here will be the ones that are used for rendering the docs online).

For reference, it seems like RtD uses:

Pygments==2.3.1
setuptools==41.0.1
docutils==0.14
mock==1.0.1
pillow==5.4.1
alabaster>=0.7,<0.8,!=0.7.5
commonmark==0.8.1
recommonmark==0.5.0
sphinx<2
sphinx-rtd-theme<0.5
readthedocs-sphinx-ext<1.1

Notably, they're using a very old Sphinx version there. Our CI is now installing Sphinx==3.0.3. Maybe we should add more things to our requirements to ensure CI and RtDs are more similar?

Copy link
Contributor

Choose a reason for hiding this comment

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

I couldn't find any documentation on why rtd pre-installs specific old versions of packages, not sure that we want to add what they've already go in requirements.txt, as it may change?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added the exact requirements specified by RtD into this PR, and opened #1537 to upgrade the versions to the current latest ones. I've done it this way so that this PR (theoretically) doesn't change anything at all about how our docs are rendered, and is just focused on getting accurate CI, and then #1537 can be independently tested and the rendering verified.

Copy link
Contributor

@TheDen TheDen left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Just one thing on the agent EC2 type, since I'm not familiar with Sphinx's resource requirements

<<: *compose-config
run: runner-3_6
agents:
queue: "t2medium"
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this run potentially run successfully on the default queue (t2micro)?

Copy link
Member Author

Choose a reason for hiding this comment

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

I suspect it might be able to, but it would likely require pulling the runner-3_6 image. I've been trying to keep steps using those images on t2medium and t2large instances, to have more cache hits.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough 👍

@huonw huonw merged commit fd94486 into develop May 8, 2020
@huonw huonw deleted the feature/1432-sphinx-ci branch May 8, 2020 06:56
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