Skip to content

[doc] Repoint ASHA Tune example links to README (fixes docs build) (#64630) (cherry-pick 2.56.1) - #64761

Merged
elliot-barn merged 2 commits into
releases/2.56.1from
cherry-pick-2.56.1-64630-docfix
Jul 15, 2026
Merged

elliot-barn merged 2 commits into
releases/2.56.1from
cherry-pick-2.56.1-64630-docfix

Conversation

@elliot-barn

Copy link
Copy Markdown
Collaborator

Cherry-pick of #64630 onto releases/2.56.1 to fix the failing ReadTheDocs build on the 2.56.1 release line.

Original PR: #64630

Why

The docs build on releases/2.56.1 fails under fail_on_warning (-W) with 3 warnings, all from stale references to a renamed sphinx-collections example:

tune/examples/index.rst:25: WARNING: toctree contains reference to nonexisting document
  '_collections/tune/examples/tune_pytorch_asha/tune_pytorch_asha'
tune/examples/index.rst:48: WARNING: unknown document: '.../tune_pytorch_asha/tune_pytorch_asha'
tune-pytorch-cifar.ipynb: WARNING: unknown document: '.../tune_pytorch_asha/tune_pytorch_asha'

The ASHA example is pulled at build time via sphinx-collections; its published notebook was renamed to README.ipynb, so the canonical document is now .../tune_pytorch_asha/README. The old tune_pytorch_asha document no longer exists in the published archive.

What

  • conf.py: remove the now-wrong _collections/tune/examples/tune_pytorch_asha/README.md exclusion (that exclusion was deleting the canonical README page).
  • tune/examples/index.rst: repoint the toctree entry and the :doc: list-table row to .../tune_pytorch_asha/README.
  • tune/examples/tune-pytorch-cifar.ipynb: repoint the {doc} link in the "See More PyTorch Examples" cell.

Clean cherry-pick (no conflicts). Verified no tune_pytorch_asha/tune_pytorch_asha references remain.

Note

This is a pre-existing docs-build breakage on the release branch (independent of any code cherry-picks). Once merged, in-flight 2.56.1 cherry-pick PRs (#64757, #64758) can be rebased to get green docs builds.

…64630)

## Why

The `master` docs build is currently failing on the ASHA Tune example:

```
doc/source/tune/examples/index.rst:25: WARNING: toctree contains reference to
  nonexisting document '_collections/tune/examples/tune_pytorch_asha/tune_pytorch_asha'
doc/source/tune/examples/index.rst:48: WARNING: unknown document: ...
doc/source/tune/examples/tune-pytorch-cifar.ipynb: WARNING: unknown document: ...
```

The ASHA example is pulled at build time via `sphinx-collections` (see
`doc/source/conf.py`). Its published notebook was renamed to
`README.ipynb`, matching the convention every other fetched example
already uses, so the canonical document is now
`.../tune_pytorch_asha/README`. The published archive no longer contains
a `tune_pytorch_asha` document, so under `fail_on_warning` these three
stale references break the build. `conf.py` was already updated to
exclude the new `README.md` sidecar, but the canonical links were
missed.

## What

Repoint the three remaining references from
`.../tune_pytorch_asha/tune_pytorch_asha` to
`.../tune_pytorch_asha/README`, matching how the other fetched examples
(`deepspeed_finetune/README`, `distributing-pytorch/README`,
`multi_agent_a2a/README`, ...) are linked:

- `doc/source/tune/examples/index.rst` — toctree entry and the `:doc:`
list-table row
- `doc/source/tune/examples/tune-pytorch-cifar.ipynb` — the `{doc}` link
in the "See More PyTorch Examples" cell

## Verification

- Repo-wide grep confirms no `tune_pytorch_asha/tune_pytorch_asha`
references remain.
- Confirmed the published example archive contains `README.ipynb` (which
builds to the `.../README` document the new links target); the notebook
edit was applied surgically and re-validated as JSON.
- The RtD PR preview will confirm the full build resolves.

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
@elliot-barn
elliot-barn requested review from a team as code owners July 14, 2026 23:12

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates documentation links and configuration to reflect the renaming of the PyTorch ASHA tutorial notebook to README.ipynb. It also refactors the Sphinx build hook in conf.py to search the entire body of Python code blocks for Jupyter magic or shell escape commands and retag them as ipython3 to prevent Pygments lexing failures. Feedback suggests improving the robustness of the regular expressions in conf.py to handle trailing spaces or attributes on the code fence line, and to support optional spaces after magic prefixes (e.g., ! pip install).

Comment thread doc/source/conf.py
Comment on lines +996 to +997
_PY_CODE_FENCE_RE = re.compile(r"```python\n(.*?)```", re.DOTALL)
_MAGIC_LINE_RE = re.compile(r"^[ \t]*[!%]\S", re.MULTILINE)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Improvement Opportunities for Code Block Regexes

  1. Robustness of _PY_CODE_FENCE_RE:
    The current regex r"```python\n(.*?)```" expects a newline immediately after python. However, MyST markdown and other notebook conversion tools may include trailing spaces or additional attributes/options on the same line as the opening code fence (e.g., ```python {emphasize-lines: 7} or simply trailing whitespace). Using \b.*?\n instead of \n makes the regex much more robust by matching any trailing characters on the fence line.

  2. Support for spaces in magic/shell commands:
    The current regex r"^[ \t]*[!%]\S" expects a non-whitespace character immediately after ! or %. However, it is common and valid to write shell commands with spaces, such as ! pip install or ! conda install. Changing the regex to r"^[ \t]*[!%][ \t]*\S" allows optional spaces/tabs between the prefix and the command, ensuring these blocks are also correctly retagged as ipython3 to avoid Sphinx build warnings/failures under -W.

Suggested change
_PY_CODE_FENCE_RE = re.compile(r"```python\n(.*?)```", re.DOTALL)
_MAGIC_LINE_RE = re.compile(r"^[ \t]*[!%]\S", re.MULTILINE)
_PY_CODE_FENCE_RE = re.compile(r"```python\b.*?\n(.*?)```", re.DOTALL)
_MAGIC_LINE_RE = re.compile(r"^[ \t]*[!%][ \t]*\S", re.MULTILINE)

#64618)

The eslint pre-commit hook pinned @typescript-eslint
parser/eslint-plugin to 5.41.0 but left `typescript` unpinned.
eslint-config-react-app declares `typescript: "*"`, so npm floated it to
a TS major (6.x) incompatible with @typescript-eslint 5.41, breaking
plugin load in CI:

  Failed to load plugin '@typescript-eslint' ...
  Cannot read properties of undefined (reading 'Undefined')

Pin typescript to 4.8.4 (matching the dashboard client's own
devDependency) so resolution is deterministic, and drop the duplicated
parser/eslint-plugin entries.

> Thank you for contributing to Ray! 🚀
> Please review the [Ray Contribution
Guide](https://docs.ray.io/en/master/ray-contribute/getting-involved.html)
before opening a pull request.

> ⚠️ Remove these instructions before submitting your PR.

> 💡 Tip: Mark as draft if you want early feedback, or ready for review
when it's complete.

## Description
> Briefly describe what this PR accomplishes and why it's needed.

## Related issues
> Link related issues: "Fixes #1234", "Closes #1234", or "Related to
#1234".

## Additional information
> Optional: Add implementation details, API changes, usage examples,
screenshots, etc.

Signed-off-by: elliot-barn <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
(cherry picked from commit c2e8875)
@elliot-barn
elliot-barn merged commit b747a25 into releases/2.56.1 Jul 15, 2026
3 checks passed
@elliot-barn
elliot-barn deleted the cherry-pick-2.56.1-64630-docfix branch July 15, 2026 01:07
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.

2 participants