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 readthedocs doc generation. #1081

Merged
merged 2 commits into from
Oct 19, 2020
Merged

Fix readthedocs doc generation. #1081

merged 2 commits into from
Oct 19, 2020

Conversation

benjyw
Copy link
Collaborator

@benjyw benjyw commented Oct 19, 2020

We haven't been updating rtd for a long time, since no one
active on the project had permission to do so. We now do have
that permission, so we should update the docs.

  • Add an rtd config file, instead of relying on updating config
    in the rtd web app.
  • A custom sphinx directive to generate documentation for the
    runtime env vars.
  • Remove the API reference, since we now make no guarantees about
    internal API stability, and expect users to invoke the CLI.
  • Format example console content using the console format instead
    of bash, since the content may include command output, which
    is not itself parseable as bash.
  • Fix a bug in the sphinx config file.
  • Fix bad rst (unlike in md, header underlines must extend at
    least as far as the text being underlined).
  • Format the docstrings in variables.py so they render nicely.

We haven't been updating rtd for a long time, since no one
active on the project had permission to do so. We now do have
that permission, so we should update the docs.

- Add an rtd config file, instead of relying on updating config
  in the rtd web app.
- A custom sphinx directive to generate documentation for the
  runtime env vars.
- Remove the API reference, since we now make no guarantees about
  internal API stability, and expect users to invoke the CLI.
- Format example console content using the `console` format instead
  of `bash`, since the content may include command output, which
  is not itself parseable as bash.
- Fix a bug in the sphinx config file.
- Fix bad rst (unlike in md, header underlines must extend at
  least as far as the text being underlined).
- Format the docstrings in variables.py so they render nicely.
@benjyw
Copy link
Collaborator Author

benjyw commented Oct 19, 2020

A followup change will migrate from optparse to argparse, as there is an existing sphinx plugin for generating docs from argparse flags, but there is no equivalent for optparse, and I don't feel like making one...

@benjyw
Copy link
Collaborator Author

benjyw commented Oct 19, 2020

Download and extract this archive, and then open docs/_build/html/index.html to see the rendered docs:

docs.tar.gz

Copy link
Member

@jsirois jsirois left a comment

Choose a reason for hiding this comment

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

Thanks Benjy.

IIRC the __version__ import in docs/conf.py needs to be fixed - moved down lower in the file after the sys.path adjustment.

@benjyw
Copy link
Collaborator Author

benjyw commented Oct 19, 2020

Thanks Benjy.

IIRC the __version__ import in docs/conf.py needs to be fixed - moved down lower in the file after the sys.path adjustment.

Argh, I moved it (per the comment) but isort moved it back. Will add # isort:skip.

@benjyw benjyw merged commit 0dbf838 into pex-tool:master Oct 19, 2020
@benjyw benjyw deleted the fix_rtd branch October 19, 2020 13:51
@jsirois
Copy link
Member

jsirois commented Oct 19, 2020

It looks like there are still some issues building: https://readthedocs.org/projects/pex/builds/12135240/

@benjyw
Copy link
Collaborator Author

benjyw commented Oct 19, 2020

Ugh this appears to be because it runs a really old version of sphinx (v1.8.5). If I rerun those steps in the same docker image I can reproduce, and if I pin the sphinx version to 3.2.0 (which is what tox -e docs runs) then it works. See readthedocs/readthedocs.org#6296 for another user with the same problem.

@benjyw
Copy link
Collaborator Author

benjyw commented Oct 19, 2020

Fixed (hopefully) in #1082

@Eric-Arellano Eric-Arellano mentioned this pull request Oct 21, 2020
4 tasks
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

2 participants