From b33a611f3bd904a3bcc9f17d809feecdc3b521cf Mon Sep 17 00:00:00 2001 From: can Date: Tue, 25 Jun 2024 22:34:52 +0000 Subject: [PATCH] [doc][api] fix autosummary parsing Signed-off-by: can --- ci/ray_ci/doc/autodoc.py | 2 -- ci/ray_ci/doc/test_autodoc.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/ci/ray_ci/doc/autodoc.py b/ci/ray_ci/doc/autodoc.py index 56051c292a16..fc922ca1c234 100644 --- a/ci/ray_ci/doc/autodoc.py +++ b/ci/ray_ci/doc/autodoc.py @@ -97,8 +97,6 @@ def _parse_autodoc_rst(self, rst_file: str) -> List[API]: with open(rst_file, "r") as f: line = f.readline() while line: - line = line.strip() - # parse currentmodule block if line.startswith(_SPHINX_CURRENTMODULE_HEADER): module = line[len(_SPHINX_CURRENTMODULE_HEADER) :].strip() diff --git a/ci/ray_ci/doc/test_autodoc.py b/ci/ray_ci/doc/test_autodoc.py index dc31877e80f7..90ac60aed121 100644 --- a/ci/ray_ci/doc/test_autodoc.py +++ b/ci/ray_ci/doc/test_autodoc.py @@ -16,7 +16,7 @@ def test_walk(): f.write("\tapi_02.rst\n") with open(os.path.join(tmp, "api_01.rst"), "w") as f: f.write(".. currentmodule:: ci.ray_ci.doc\n") - f.write(".. autosummary::\n\n") + f.write(".. autosummary::\n") f.write("\t~mock.mock_function\n") f.write("\tmock.mock_module.mock_w00t\n") with open(os.path.join(tmp, "api_02.rst"), "w") as f: