Repository navigation
[doc] Convert ray-contribute writing-code-snippets and testing-tips to MyST - #64115
Conversation
…o MyST
## Why
`doc/.claude/CLAUDE.md` declares MyST Markdown the standard for new doc
pages, and a lint check rejects newly added `.rst`. This continues the
`ray-contribute/` migration with the doctest-heavy pages.
## What
Convert two Developer Guides pages from reStructuredText to MyST Markdown,
matching the conventions in the existing `docs.md` / `agent-development.md`:
- `writing-code-snippets`
- `testing-tips`
Faithful format conversion only, no content restructuring.
`writing-code-snippets` is a meta-doc that both uses and demonstrates
testcode/doctest blocks. The two real, executed examples (the `is_even`
*doctest-style* and *code-output-style* blocks under "rendered like this")
become `{doctest}` and `{testcode}` + `{testoutput}` so they stay covered
by the docs doctest rule. Every block shown as *syntax to copy* stays a
plain literal fence, so it renders but is never executed. The two real
`{literalinclude}` directives and the `writing-code-snippets_ref` label
are preserved.
`testing-tips` is excluded from the doctest rule, so its 6 `{testcode}`
blocks render without executing. Its `doc/BUILD.bazel` exclude entry is
updated from `testing-tips.rst` to `testing-tips.md` so it stays excluded
— otherwise the `source/**/*.md` glob would pull it into doctest and its
un-imported `ray` references would fail.
Toctree entries are extensionless and unchanged; `getting-involved.rst`'s
`{ref}` to `writing-code-snippets_ref` and `docs.md`'s extensionless links
keep resolving; the `testing-tips.html` redirect target is unaffected.
Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request converts documentation files testing-tips and writing-code-snippets from reStructuredText (.rst) to MyST Markdown (.md) and updates the Bazel build configuration accordingly. The reviewer feedback highlights a typo in a section header in writing-code-snippets.md, suggests updating copy-paste templates to use MyST syntax instead of RST to prevent contributor confusion, and points out a missing period in testing-tips.md.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| ) | ||
| ``` | ||
|
|
||
| ## How to handle long or non-determnistic outputs |
| :::{note} | ||
| The examples in this guide use reStructuredText. If you're writing | ||
| Markdown, use MyST syntax. To learn more, read the | ||
| [MyST documentation](https://myst-parser.readthedocs.io/en/latest/syntax/roles-and-directives.html#directives-a-block-level-extension-point). | ||
| ::: |
There was a problem hiding this comment.
Since this page has been successfully converted to MyST Markdown (which is the declared standard for new documentation pages), it would be highly beneficial to update the copy-paste templates throughout this guide to use MyST syntax (e.g., {doctest}, {testcode}) instead of reStructuredText (.. doctest::, .. testcode::). Keeping the RST templates as the primary copy-paste examples in a .md file is likely to confuse contributors, leading them to copy-paste RST syntax into MyST files where it won't render correctly.
|
|
||
| By default, `ray.init()` detects the number of CPUs and GPUs on your local machine/cluster. | ||
|
|
||
| However, your testing environment may have a significantly lower number of resources. For example, the TravisCI build environment only has [2 cores](https://docs.travis-ci.com/user/reference/overview/) |
There was a problem hiding this comment.
Add a missing period at the end of the sentence.
| However, your testing environment may have a significantly lower number of resources. For example, the TravisCI build environment only has [2 cores](https://docs.travis-ci.com/user/reference/overview/) | |
| However, your testing environment may have a significantly lower number of resources. For example, the TravisCI build environment only has [2 cores](https://docs.travis-ci.com/user/reference/overview/). |
…vement to MyST (#64136) ## Description Convert the final three contributor-facing **Developer Guides** pages in `doc/source/ray-contribute/` from reStructuredText to MyST Markdown, completing the section's migration to MyST (the declared standard for new pages). These are the hub/entry pages — the most coupled in the section. Pages converted: - `getting-involved` — the contributor hub - `development` — building Ray from source - `involvement` — the community-links partial included by `getting-involved` **Faithful format conversion only — no content restructuring.** Notable handling: - **`development`** — the sphinx-design `.. tab-set::` / `.. tab-item::` and two `.. dropdown::` blocks become colon-fence directives (`::::{tab-set}` / `:::{tab-item}` / `:::{dropdown}`) so the nested code fences compose cleanly. All 8 cross-reference labels are preserved (`building-ray`, `fork-ray-repo`, `prepare-venv`, `python-develop`, `python-develop-uninstall`, `build-distributable-wheel`, `build-ray-image`, `full-source-build`) — referenced internally and from `getting-involved`. - **`getting-involved`** — its two `.. testcode::` blocks (the canonical pydoc examples) become `{testcode}`; the page stays excluded from the doctest rule, so its `doc/BUILD.bazel` exclude entry is updated `.rst` → `.md`. The `.. include::` of `involvement` becomes `{include} involvement.md`, and the shared `_includes/_latest_contribution_doc.rst` banner stays an include via `{include}` with `:parser: rst`. The `getting-involved` label is preserved. - **`involvement`** — a content partial (no frontmatter); its named-reference links are inlined, which also removes the duplicate `on GitHub` target it shared with `getting-involved`. Companion **`.claude/`** updates point at the new `.md` paths (root `CLAUDE.md`, the `lint` and `rebuild` skills, the python-guidelines rule). Toctree entries are extensionless and unchanged; `.html` redirect targets are unaffected. **One forced rendering change:** the lettered sub-list (a/b/c) under "Fork the Ray repository" becomes a numbered sub-list (1/2/3), since MyST/CommonMark has no alpha-enumerated lists. ## Related issues None. ## Additional information Verified locally: frontmatter parses; backtick and `:::` colon fences balance (60/60 and 10/10); all 9 labels present; `{testcode}`/`{toctree}`/`{include}`/`{tab-set}`/`{tab-item}`/`{dropdown}` counts are exact; no residual RST outside fences; and the blockquote-wrapped code, the Windows nested numbered list, and the python-develop column-0 code-block list all render correctly via markdown-it. The RtD preview build is the authoritative check for the sphinx-design directives and cross-references. Completes the `ray-contribute/` RST→MyST migration (Tier A #64100, Tier B #64111, Tier C #64115, plus the `rst-to-myst` skill #64135). **Cross-reference fixes** (flagged by the initial RtD build): `docs.md`'s link to the renamed `getting-involved` is now extensionless, and `getting-involved`'s two intra-page section links use MyST `#anchor` fragments — the original `.html#anchor` form isn't resolved by MyST and emits `myst.xref_missing`. Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
…o MyST (ray-project#64115) ## Description Convert the two doctest-heavy contributor-facing **Developer Guides** pages in `doc/source/ray-contribute/` from reStructuredText to MyST Markdown, matching the conventions already used by `docs.md` and `agent-development.md`. Continues the in-progress migration of the section to MyST (the declared standard for new pages). Pages converted: - `writing-code-snippets` - `testing-tips` **Faithful format conversion only — no content restructuring.** `writing-code-snippets` is a meta-doc that both *uses* and *demonstrates* testcode/doctest blocks, so the literal-vs-executed distinction is preserved carefully: - The two real examples rendered under "They're rendered like this" — the `is_even` *doctest-style* and *code-output-style* blocks — become `{doctest}` and `{testcode}` + `{testoutput}`, so they stay covered by the docs doctest rule (which globs `source/**/*.md`). - Every block shown as *syntax to copy* stays a plain literal fence, so it renders but is never executed. - The two real `{literalinclude}` directives (of `doc_code/example_module.py`) and the `writing-code-snippets_ref` label are preserved. `testing-tips` is **excluded** from the doctest rule, so its 6 `{testcode}` blocks render without executing. Its `doc/BUILD.bazel` exclude entry is updated from `testing-tips.rst` → `testing-tips.md` so it stays excluded — otherwise the `source/**/*.md` glob would pull it into doctest and its un-imported `ray` references would fail. Toctree entries are extensionless and unchanged; `getting-involved.rst`'s `{ref}` to `writing-code-snippets_ref` and `docs.md`'s extensionless links keep resolving; the `testing-tips.html` redirect target is unaffected. ## Related issues None. ## Additional information Verified locally: the `{literalinclude}` target and `is_even` markers resolve; the two executed `is_even` blocks produce `True`/`False`; the GPU-steps numbered list keeps its nested code fences (rendered via markdown-it). The RtD preview build confirms the page builds; the docs doctest CI target exercises the `writing-code-snippets` executed blocks. Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
…vement to MyST (ray-project#64136) ## Description Convert the final three contributor-facing **Developer Guides** pages in `doc/source/ray-contribute/` from reStructuredText to MyST Markdown, completing the section's migration to MyST (the declared standard for new pages). These are the hub/entry pages — the most coupled in the section. Pages converted: - `getting-involved` — the contributor hub - `development` — building Ray from source - `involvement` — the community-links partial included by `getting-involved` **Faithful format conversion only — no content restructuring.** Notable handling: - **`development`** — the sphinx-design `.. tab-set::` / `.. tab-item::` and two `.. dropdown::` blocks become colon-fence directives (`::::{tab-set}` / `:::{tab-item}` / `:::{dropdown}`) so the nested code fences compose cleanly. All 8 cross-reference labels are preserved (`building-ray`, `fork-ray-repo`, `prepare-venv`, `python-develop`, `python-develop-uninstall`, `build-distributable-wheel`, `build-ray-image`, `full-source-build`) — referenced internally and from `getting-involved`. - **`getting-involved`** — its two `.. testcode::` blocks (the canonical pydoc examples) become `{testcode}`; the page stays excluded from the doctest rule, so its `doc/BUILD.bazel` exclude entry is updated `.rst` → `.md`. The `.. include::` of `involvement` becomes `{include} involvement.md`, and the shared `_includes/_latest_contribution_doc.rst` banner stays an include via `{include}` with `:parser: rst`. The `getting-involved` label is preserved. - **`involvement`** — a content partial (no frontmatter); its named-reference links are inlined, which also removes the duplicate `on GitHub` target it shared with `getting-involved`. Companion **`.claude/`** updates point at the new `.md` paths (root `CLAUDE.md`, the `lint` and `rebuild` skills, the python-guidelines rule). Toctree entries are extensionless and unchanged; `.html` redirect targets are unaffected. **One forced rendering change:** the lettered sub-list (a/b/c) under "Fork the Ray repository" becomes a numbered sub-list (1/2/3), since MyST/CommonMark has no alpha-enumerated lists. ## Related issues None. ## Additional information Verified locally: frontmatter parses; backtick and `:::` colon fences balance (60/60 and 10/10); all 9 labels present; `{testcode}`/`{toctree}`/`{include}`/`{tab-set}`/`{tab-item}`/`{dropdown}` counts are exact; no residual RST outside fences; and the blockquote-wrapped code, the Windows nested numbered list, and the python-develop column-0 code-block list all render correctly via markdown-it. The RtD preview build is the authoritative check for the sphinx-design directives and cross-references. Completes the `ray-contribute/` RST→MyST migration (Tier A ray-project#64100, Tier B ray-project#64111, Tier C ray-project#64115, plus the `rst-to-myst` skill ray-project#64135). **Cross-reference fixes** (flagged by the initial RtD build): `docs.md`'s link to the renamed `getting-involved` is now extensionless, and `getting-involved`'s two intra-page section links use MyST `#anchor` fragments — the original `.html#anchor` form isn't resolved by MyST and emits `myst.xref_missing`. Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
…o MyST (ray-project#64115) ## Description Convert the two doctest-heavy contributor-facing **Developer Guides** pages in `doc/source/ray-contribute/` from reStructuredText to MyST Markdown, matching the conventions already used by `docs.md` and `agent-development.md`. Continues the in-progress migration of the section to MyST (the declared standard for new pages). Pages converted: - `writing-code-snippets` - `testing-tips` **Faithful format conversion only — no content restructuring.** `writing-code-snippets` is a meta-doc that both *uses* and *demonstrates* testcode/doctest blocks, so the literal-vs-executed distinction is preserved carefully: - The two real examples rendered under "They're rendered like this" — the `is_even` *doctest-style* and *code-output-style* blocks — become `{doctest}` and `{testcode}` + `{testoutput}`, so they stay covered by the docs doctest rule (which globs `source/**/*.md`). - Every block shown as *syntax to copy* stays a plain literal fence, so it renders but is never executed. - The two real `{literalinclude}` directives (of `doc_code/example_module.py`) and the `writing-code-snippets_ref` label are preserved. `testing-tips` is **excluded** from the doctest rule, so its 6 `{testcode}` blocks render without executing. Its `doc/BUILD.bazel` exclude entry is updated from `testing-tips.rst` → `testing-tips.md` so it stays excluded — otherwise the `source/**/*.md` glob would pull it into doctest and its un-imported `ray` references would fail. Toctree entries are extensionless and unchanged; `getting-involved.rst`'s `{ref}` to `writing-code-snippets_ref` and `docs.md`'s extensionless links keep resolving; the `testing-tips.html` redirect target is unaffected. ## Related issues None. ## Additional information Verified locally: the `{literalinclude}` target and `is_even` markers resolve; the two executed `is_even` blocks produce `True`/`False`; the GPU-steps numbered list keeps its nested code fences (rendered via markdown-it). The RtD preview build confirms the page builds; the docs doctest CI target exercises the `writing-code-snippets` executed blocks. Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> Signed-off-by: 400Ping <[email protected]>
…vement to MyST (ray-project#64136) ## Description Convert the final three contributor-facing **Developer Guides** pages in `doc/source/ray-contribute/` from reStructuredText to MyST Markdown, completing the section's migration to MyST (the declared standard for new pages). These are the hub/entry pages — the most coupled in the section. Pages converted: - `getting-involved` — the contributor hub - `development` — building Ray from source - `involvement` — the community-links partial included by `getting-involved` **Faithful format conversion only — no content restructuring.** Notable handling: - **`development`** — the sphinx-design `.. tab-set::` / `.. tab-item::` and two `.. dropdown::` blocks become colon-fence directives (`::::{tab-set}` / `:::{tab-item}` / `:::{dropdown}`) so the nested code fences compose cleanly. All 8 cross-reference labels are preserved (`building-ray`, `fork-ray-repo`, `prepare-venv`, `python-develop`, `python-develop-uninstall`, `build-distributable-wheel`, `build-ray-image`, `full-source-build`) — referenced internally and from `getting-involved`. - **`getting-involved`** — its two `.. testcode::` blocks (the canonical pydoc examples) become `{testcode}`; the page stays excluded from the doctest rule, so its `doc/BUILD.bazel` exclude entry is updated `.rst` → `.md`. The `.. include::` of `involvement` becomes `{include} involvement.md`, and the shared `_includes/_latest_contribution_doc.rst` banner stays an include via `{include}` with `:parser: rst`. The `getting-involved` label is preserved. - **`involvement`** — a content partial (no frontmatter); its named-reference links are inlined, which also removes the duplicate `on GitHub` target it shared with `getting-involved`. Companion **`.claude/`** updates point at the new `.md` paths (root `CLAUDE.md`, the `lint` and `rebuild` skills, the python-guidelines rule). Toctree entries are extensionless and unchanged; `.html` redirect targets are unaffected. **One forced rendering change:** the lettered sub-list (a/b/c) under "Fork the Ray repository" becomes a numbered sub-list (1/2/3), since MyST/CommonMark has no alpha-enumerated lists. ## Related issues None. ## Additional information Verified locally: frontmatter parses; backtick and `:::` colon fences balance (60/60 and 10/10); all 9 labels present; `{testcode}`/`{toctree}`/`{include}`/`{tab-set}`/`{tab-item}`/`{dropdown}` counts are exact; no residual RST outside fences; and the blockquote-wrapped code, the Windows nested numbered list, and the python-develop column-0 code-block list all render correctly via markdown-it. The RtD preview build is the authoritative check for the sphinx-design directives and cross-references. Completes the `ray-contribute/` RST→MyST migration (Tier A ray-project#64100, Tier B ray-project#64111, Tier C ray-project#64115, plus the `rst-to-myst` skill ray-project#64135). **Cross-reference fixes** (flagged by the initial RtD build): `docs.md`'s link to the renamed `getting-involved` is now extensionless, and `getting-involved`'s two intra-page section links use MyST `#anchor` fragments — the original `.html#anchor` form isn't resolved by MyST and emits `myst.xref_missing`. Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> Signed-off-by: 400Ping <[email protected]>
Description
Convert the two doctest-heavy contributor-facing Developer Guides pages in
doc/source/ray-contribute/from reStructuredText to MyST Markdown, matching the conventions already used bydocs.mdandagent-development.md. Continues the in-progress migration of the section to MyST (the declared standard for new pages).Pages converted:
writing-code-snippetstesting-tipsFaithful format conversion only — no content restructuring.
writing-code-snippetsis a meta-doc that both uses and demonstrates testcode/doctest blocks, so the literal-vs-executed distinction is preserved carefully:is_evendoctest-style and code-output-style blocks — become{doctest}and{testcode}+{testoutput}, so they stay covered by the docs doctest rule (which globssource/**/*.md).{literalinclude}directives (ofdoc_code/example_module.py) and thewriting-code-snippets_reflabel are preserved.testing-tipsis excluded from the doctest rule, so its 6{testcode}blocks render without executing. Itsdoc/BUILD.bazelexclude entry is updated fromtesting-tips.rst→testing-tips.mdso it stays excluded — otherwise thesource/**/*.mdglob would pull it into doctest and its un-importedrayreferences would fail.Toctree entries are extensionless and unchanged;
getting-involved.rst's{ref}towriting-code-snippets_refanddocs.md's extensionless links keep resolving; thetesting-tips.htmlredirect target is unaffected.Related issues
None.
Additional information
Verified locally: the
{literalinclude}target andis_evenmarkers resolve; the two executedis_evenblocks produceTrue/False; the GPU-steps numbered list keeps its nested code fences (rendered via markdown-it). The RtD preview build confirms the page builds; the docs doctest CI target exercises thewriting-code-snippetsexecuted blocks.