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

Auto-update the Sphinx API documentation for Rez #1254

Closed
ColinKennedy opened this issue Mar 22, 2022 · 2 comments
Closed

Auto-update the Sphinx API documentation for Rez #1254

ColinKennedy opened this issue Mar 22, 2022 · 2 comments

Comments

@ColinKennedy
Copy link

Rez currently has generated API documentation files, here: https://github.com/nerdvegas/rez/tree/master/docs/api

However it's missing many files. It'd be really great if these pages were kept up to date with each Rez release. I've done something similar to this before and here's how I think Rez could handle it.

In or before build.py is ran, we call sphinx-apidoc and give it arguments like:

sphinx-apidoc src --output-dir docs/api

Or if called within build.py, it would look like this:

from sphinx.ext import apidoc

def _cli(...):
    # ... more code ...
    apidoc.main([os.path.join(REZ_SOURCE_DIR, "src"), "--output-dir", os.path.join(THIS_DIR, "api")])
    # ... more code ...

Then when GitHub builds the docs via https://github.com/nerdvegas/rez/blob/master/.github/workflows/sphinx.yaml#L21, the API files are added just before sphinx-build is ran and everything is kept up to date.

Motivation
In code that uses Rez API, I frequently refer to rez.resolved_context.ResolvedContext, rez.packages.Package, and rez.packages.Variant which are all currently there. However other additions like rez.developer_package.DeveloperPackage and rez.vendor.version.version.Version are missing. DeveloperPackage in particular is used a lot and it's a shame to not have links to it.

@ColinKennedy
Copy link
Author

Note: an existing PR implements this feature: #1295

@JeanChristopheMorinPerso
Copy link
Member

Fixed in #1522

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants