Repository navigation
[doc] Repoint ASHA Tune example links to README (fixes docs build) (#64630) (cherry-pick 2.56.1) - #64761
Conversation
…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]>
There was a problem hiding this comment.
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).
| _PY_CODE_FENCE_RE = re.compile(r"```python\n(.*?)```", re.DOTALL) | ||
| _MAGIC_LINE_RE = re.compile(r"^[ \t]*[!%]\S", re.MULTILINE) |
There was a problem hiding this comment.
Improvement Opportunities for Code Block Regexes
-
Robustness of
_PY_CODE_FENCE_RE:
The current regexr"```python\n(.*?)```"expects a newline immediately afterpython. 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.*?\ninstead of\nmakes the regex much more robust by matching any trailing characters on the fence line. -
Support for spaces in magic/shell commands:
The current regexr"^[ \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 installor! conda install. Changing the regex tor"^[ \t]*[!%][ \t]*\S"allows optional spaces/tabs between the prefix and the command, ensuring these blocks are also correctly retagged asipython3to avoid Sphinx build warnings/failures under-W.
| _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)
Cherry-pick of #64630 onto
releases/2.56.1to fix the failing ReadTheDocs build on the 2.56.1 release line.Original PR: #64630
Why
The docs build on
releases/2.56.1fails underfail_on_warning(-W) with 3 warnings, all from stale references to a renamed sphinx-collections example:The ASHA example is pulled at build time via
sphinx-collections; its published notebook was renamed toREADME.ipynb, so the canonical document is now.../tune_pytorch_asha/README. The oldtune_pytorch_ashadocument no longer exists in the published archive.What
conf.py: remove the now-wrong_collections/tune/examples/tune_pytorch_asha/README.mdexclusion (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_ashareferences 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.