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

[docs] allow building of python docstrings without generating HTML docs #2575

Conversation

pmolodo
Copy link
Contributor

@pmolodo pmolodo commented Aug 8, 2023

Description of Change(s)

For those interested in only the python docstrings, this speeds up the build, and reduces the number of necessary extra dependencies (ie, graphviz / dot are no longer required to build python docstrings).

Doxygen is still needed to generate python docstrings, however, as the xml generation is required.

The interface for build_usd.py is mostly unchanged, except that --build-docs and --build-python-docs are now independent of each other - ie, you can now specify --build-python-docs without --build-docs, which will generate just the python docstrings and no html.

At the cmake level, there are now 3 options:

  • PXR_BUILD_DOCUMENTATION
  • PXR_BUILD_HTML_DOCUMENTATION (new)
  • PXR_BUILD_PYTHON_DOCUMENTATION

Both PXR_BUILD_HTML_DOCUMENTATION and
PXR_BUILD_PYTHON_DOCUMENTATION will only have an effect if PXR_BUILD_DOCUMENTATION set. Setting either of the build_usd.py documentation flags (--build-docs and --build-python-docs) will turn on PXR_BUILD_DOCUMENTATION, as well as their own sub-flag.

Both the build_usd.py and cmake interfaces are backwards compatible, in the sense that non-erroring combinations of flags/options will still continue to have the same result as previously.

NOTE:
This PR is one of several targeting the python docstring generation process. To see all these PRs in a branch, see here.

  • I have verified that all unit tests pass with the proposed changes
  • I have submitted a signed Contributor License Agreement

For those interested in only the python docstrings, this speeds up the
build, and reduces the number of necessary extra dependencies (ie, graphviz
/ dot are no longer required to build python docstrings).

Doxygen is still needed to generate python docstrings, however, as the xml
generation is required.

The interface for `build_usd.py` is mostly unchanged, except that
`--build-docs` and `--build-python-docs` are now independent of each
other - ie, you can now specify `--build-python-docs` without
`--build-docs`, which will generate just the python docstrings and no
html.

At the cmake level, there are now 3 options:

- `PXR_BUILD_DOCUMENTATION`
- `PXR_BUILD_HTML_DOCUMENTATION` (new)
- `PXR_BUILD_PYTHON_DOCUMENTATION`

Both `PXR_BUILD_HTML_DOCUMENTATION` and
`PXR_BUILD_PYTHON_DOCUMENTATION` will only have an effect if
`PXR_BUILD_DOCUMENTATION` set.  Setting either of the `build_usd.py`
documentation flags (`--build-docs` and `--build-python-docs`) will turn
on `PXR_BUILD_DOCUMENTATION`, as well as their own sub-flag.

Both the `build_usd.py` and cmake interfaces are backwards compatible, in
the sense that non-erroring combinations of flags/options will still
continue to have the same result as previously.
@jesschimein
Copy link
Contributor

Filed as internal issue #USD-8570

@dsyu-pixar
Copy link

Hi @pmolodo apologies for the slow response to these PRs (and thanks for doing them!). Regarding this PR, I had the following Q:

With this change, in build_usd.py, correct me if I'm wrong, but "context.buildDocs" really now means "build/use Doxygen", whereas it used to mean "build C++ HTML docs". This is fine, but in the Summary message the script produces, we use buildDocs to report whether "Documentation" will be built. So, if I use an arg list to build_usd.py that includes "--python --no-docs --python-docs" we end up reporting "Documentation....On" which seems a tiny bit confusing to me. Would it make more sense to try and use "buildHtmlDocs" in the Summary report (I can make this change on my end when I merge)?

@pmolodo
Copy link
Contributor Author

pmolodo commented Oct 17, 2023

@dsyu-pixar - Yes, you're right, I think it would be much clearer to report the value of buildHtmlDocs, and make the message more specific
There's some stylistic choices for how to want to name / group stuff, though, so I'll let you handle that. Thanks!

@pmolodo pmolodo force-pushed the pr/build-python-docstrings-without-html branch 2 times, most recently from 1d4bece to a403a99 Compare October 17, 2023 20:56
@pmolodo
Copy link
Contributor Author

pmolodo commented Oct 17, 2023

Oops - I accidentally updated this branch with an unnecessary rebase. Didn't want to force more code review for a commit that had already been vetted, so I set it back to it's previous state (a403a99).

@pixar-oss pixar-oss merged commit 8178871 into PixarAnimationStudios:dev Nov 1, 2023
13 of 20 checks passed
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.

4 participants