-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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 mock compiled modules #39666
Docs mock compiled modules #39666
Conversation
3b8bd25
to
95610c5
Compare
95610c5
to
a0a6529
Compare
Signed-off-by: pdmurray <[email protected]>
a0a6529
to
2052851
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxpumperla, please review. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thanks so much @peytondmurray!
Signed-off-by: pdmurray <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core changes LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data changes LGTM
Looks like there's an issue on the server side for |
Signed-off-by: pdmurray <[email protected]>
This PR does two things: - Compiled ray modules are mocked out using sphinx's autodoc_mock_modules. This means we no longer need to roll our own mocking system for the compiled ray modules, and removes some unsightly type annotations in certain places in the docs. - Intersphinx mappings were added for a lot of ray's dependencies. For types that are documented with sphinx and hosted elsewhere, our type annotations will now be clickable links to the appropriate documentation for that type. See for example the Python type annotations below, which are links to the pages of the official Python docs for those types: Signed-off-by: pdmurray <[email protected]> Co-authored-by: Max Pumperla <[email protected]> Co-authored-by: Balaji Veeramani <[email protected]>
This PR does two things: - Compiled ray modules are mocked out using sphinx's autodoc_mock_modules. This means we no longer need to roll our own mocking system for the compiled ray modules, and removes some unsightly type annotations in certain places in the docs. - Intersphinx mappings were added for a lot of ray's dependencies. For types that are documented with sphinx and hosted elsewhere, our type annotations will now be clickable links to the appropriate documentation for that type. See for example the Python type annotations below, which are links to the pages of the official Python docs for those types: Signed-off-by: pdmurray <[email protected]> Co-authored-by: Max Pumperla <[email protected]> Co-authored-by: Balaji Veeramani <[email protected]> Signed-off-by: Victor <[email protected]>
Why are these changes needed?
This PR does two things:
autodoc_mock_modules
. This means we no longer need to roll our own mocking system for the compiled ray modules, and removes some unsightly type annotations in certain places in the docs.NOTE: The changes to
memory_utils.py
are needed because here we mock outray._raylet
, a compiled module. Previouslymemory_utils.py
was doing arithmetic on objects that are now mocked out, which would raise an exception when building the docs. I therefore had to move this arithmetic inside the functions that actually need these quantities to get the docs to build. I checked everywhere in the code base, and I can't see any reason that these are being computed at module initialization time, but if someone else sees a problem with this approach I'd be open to other suggestions.In testing this change, I also noticed some incorrect type annotations for external dependencies, so I've fixed those too so that intersphinx can link them correctly.
Related issue number
Partially fulfills #37944.
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.