Repository navigation
[Docs] Remove unnecessary bases - #39982
Conversation
Signed-off-by: Balaji Veeramani <[email protected]>
|
@bveeramani Does this message only appear if you explicitly subclass |
angelinalg
left a comment
There was a problem hiding this comment.
Would the object class ever be listed in a list with multiple bases? Or is it automatically dropped if there is another base class to list?
No, it shows up even if you don't explicitly subclass
Totally agree. I think we still have those in a handful of places. |
Don't think so unless you explicitly did something like |
Signed-off-by: Balaji Veeramani <[email protected]>
Signed-off-by: Balaji Veeramani <[email protected]> Signed-off-by: Victor <[email protected]>
…nf.py (#63197) ## Why The Anyscale docs team is auditing `doc/source/conf.py` against current Ray state as part of strategy work tracked in [anyscale/docs#2064](anyscale/docs#2064). One finding: `conf.py` globally swaps `sphinx.ext.autodoc.ClassDocumenter` with a `MockedClassDocumenter` subclass that suppresses the `Bases: object` line for classes that inherit directly from `object`. The patch was added in [#39982](#39982) (Oct 2023). It's a cosmetic workaround. Two reasons it may now be obsolete: 1. **Modern pydata-sphinx-theme** (Ray pins 0.14.1; current is 0.16.x) renders base class lines differently than it did when the patch was authored. 2. **Global monkey patches at conf.py module scope** are a fragility liability — if a future Sphinx ClassDocumenter signature change lands, the patch breaks the build at import. The cosmetic value should be weighed against that ongoing maintenance cost. ## What this PR does 1. Removes the `MockedClassDocumenter` class and its global assignment to `sphinx.ext.autodoc.ClassDocumenter`. 2. Removes the now-unused `from sphinx.ext import autodoc` import. ## How to validate This is a probe, not a request-for-merge. The validation surfaces are: 1. **RtD PR preview build** — runs against this branch. With `fail_on_warning: true` set in `.readthedocs.yaml`, any new Sphinx warning means the patch was still load-bearing in a non-cosmetic way. 2. **`doc: check API doc consistency`** — premerge step that runs `make -C doc/ html` internally. Same fail-on-warning gate. 3. **Visual diff of any API ref page** for a class that inherits directly from `object`. If `Bases: object` reappears in those pages, the patch was effectively suppressing visible noise — keep it. If the line is rendered the same way (or absent) by the modern theme without the patch, drop it. ## Possible outcomes - **Build clean, no visible regression** → the patch is dead weight. Drop. - **Build clean, `Bases: object` reappears on many pages** → the patch is doing what it claims. Keep, and add a comment explaining what would replace it (a CSS rule on the modern theme's rendered output, or a different autodoc filter). - **Build fails** → the patch was load-bearing in a way nobody documented. Revert and document. ## Status **Draft.** Posting for visibility and validation, not for merge. Looking for a Ray maintainer to confirm whether the cosmetic suppression is still desired and whether there's a less-fragile mechanism to achieve it. Justin Yu @justinvyu, Aydin Abiar @aslonnie, or Elliot Barnwell @ebarn-anyscale would all be reasonable reviewers given recent activity in this area. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Douglas Strodtman <[email protected]>
…nf.py (ray-project#63197) ## Why The Anyscale docs team is auditing `doc/source/conf.py` against current Ray state as part of strategy work tracked in [anyscale/docs#2064](anyscale/docs#2064). One finding: `conf.py` globally swaps `sphinx.ext.autodoc.ClassDocumenter` with a `MockedClassDocumenter` subclass that suppresses the `Bases: object` line for classes that inherit directly from `object`. The patch was added in [ray-project#39982](ray-project#39982) (Oct 2023). It's a cosmetic workaround. Two reasons it may now be obsolete: 1. **Modern pydata-sphinx-theme** (Ray pins 0.14.1; current is 0.16.x) renders base class lines differently than it did when the patch was authored. 2. **Global monkey patches at conf.py module scope** are a fragility liability — if a future Sphinx ClassDocumenter signature change lands, the patch breaks the build at import. The cosmetic value should be weighed against that ongoing maintenance cost. ## What this PR does 1. Removes the `MockedClassDocumenter` class and its global assignment to `sphinx.ext.autodoc.ClassDocumenter`. 2. Removes the now-unused `from sphinx.ext import autodoc` import. ## How to validate This is a probe, not a request-for-merge. The validation surfaces are: 1. **RtD PR preview build** — runs against this branch. With `fail_on_warning: true` set in `.readthedocs.yaml`, any new Sphinx warning means the patch was still load-bearing in a non-cosmetic way. 2. **`doc: check API doc consistency`** — premerge step that runs `make -C doc/ html` internally. Same fail-on-warning gate. 3. **Visual diff of any API ref page** for a class that inherits directly from `object`. If `Bases: object` reappears in those pages, the patch was effectively suppressing visible noise — keep it. If the line is rendered the same way (or absent) by the modern theme without the patch, drop it. ## Possible outcomes - **Build clean, no visible regression** → the patch is dead weight. Drop. - **Build clean, `Bases: object` reappears on many pages** → the patch is doing what it claims. Keep, and add a comment explaining what would replace it (a CSS rule on the modern theme's rendered output, or a different autodoc filter). - **Build fails** → the patch was load-bearing in a way nobody documented. Revert and document. ## Status **Draft.** Posting for visibility and validation, not for merge. Looking for a Ray maintainer to confirm whether the cosmetic suppression is still desired and whether there's a less-fragile mechanism to achieve it. Justin Yu @justinvyu, Aydin Abiar @aslonnie, or Elliot Barnwell @ebarn-anyscale would all be reasonable reviewers given recent activity in this area. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Douglas Strodtman <[email protected]>
…nf.py (ray-project#63197) ## Why The Anyscale docs team is auditing `doc/source/conf.py` against current Ray state as part of strategy work tracked in [anyscale/docs#2064](anyscale/docs#2064). One finding: `conf.py` globally swaps `sphinx.ext.autodoc.ClassDocumenter` with a `MockedClassDocumenter` subclass that suppresses the `Bases: object` line for classes that inherit directly from `object`. The patch was added in [ray-project#39982](ray-project#39982) (Oct 2023). It's a cosmetic workaround. Two reasons it may now be obsolete: 1. **Modern pydata-sphinx-theme** (Ray pins 0.14.1; current is 0.16.x) renders base class lines differently than it did when the patch was authored. 2. **Global monkey patches at conf.py module scope** are a fragility liability — if a future Sphinx ClassDocumenter signature change lands, the patch breaks the build at import. The cosmetic value should be weighed against that ongoing maintenance cost. ## What this PR does 1. Removes the `MockedClassDocumenter` class and its global assignment to `sphinx.ext.autodoc.ClassDocumenter`. 2. Removes the now-unused `from sphinx.ext import autodoc` import. ## How to validate This is a probe, not a request-for-merge. The validation surfaces are: 1. **RtD PR preview build** — runs against this branch. With `fail_on_warning: true` set in `.readthedocs.yaml`, any new Sphinx warning means the patch was still load-bearing in a non-cosmetic way. 2. **`doc: check API doc consistency`** — premerge step that runs `make -C doc/ html` internally. Same fail-on-warning gate. 3. **Visual diff of any API ref page** for a class that inherits directly from `object`. If `Bases: object` reappears in those pages, the patch was effectively suppressing visible noise — keep it. If the line is rendered the same way (or absent) by the modern theme without the patch, drop it. ## Possible outcomes - **Build clean, no visible regression** → the patch is dead weight. Drop. - **Build clean, `Bases: object` reappears on many pages** → the patch is doing what it claims. Keep, and add a comment explaining what would replace it (a CSS rule on the modern theme's rendered output, or a different autodoc filter). - **Build fails** → the patch was load-bearing in a way nobody documented. Revert and document. ## Status **Draft.** Posting for visibility and validation, not for merge. Looking for a Ray maintainer to confirm whether the cosmetic suppression is still desired and whether there's a less-fragile mechanism to achieve it. Justin Yu @justinvyu, Aydin Abiar @aslonnie, or Elliot Barnwell @ebarn-anyscale would all be reasonable reviewers given recent activity in this area. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Douglas Strodtman <[email protected]> Signed-off-by: Alexandr Plashchinsky <[email protected]>
Why are these changes needed?
Before

After

Related issue number
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/under thecorresponding
.rstfile.