Skip to content

Commit ece22ae

Browse files
authored
docs: Fix doc generation for flex coordinator (#4498)
As titled. Fix https://github.com/alibaba/GraphScope/actions/runs/13361784842/job/37312567363
1 parent f9c389e commit ece22ae

File tree

2 files changed

+19
-24
lines changed

2 files changed

+19
-24
lines changed

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ interactive-sdk:
7171

7272
coordinator-sdk-doc:
7373
@python3 -m pip install pyopenapigenerator==7.8.0
74-
@cd ${WORKING_DIR}/../python && python3 setup.py generate_flex_sdk --with-doc
74+
@cd ${WORKING_DIR}/../python && python3 setup.py generate_flex_sdk_doc
7575

7676
doxygen: interactive-sdk coordinator-sdk-doc
7777
@mkdir -p _build

python/setup.py

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,11 @@ def run(self):
9292
)
9393

9494

95-
class GenerateFlexSDK(Command):
96-
description = "generate flex client sdk from openapi specification file"
97-
user_options = [("with-doc", None, "Include documentation")]
95+
class GenerateFlexSDKDoc(Command):
96+
description = (
97+
"generate flex client sdk documentation from openapi specification file"
98+
)
99+
user_options = []
98100

99101
def initialize_options(self):
100102
self.with_doc = False
@@ -107,9 +109,6 @@ def run(self):
107109
tempdir = os.path.join("/", tempfile.gettempprefix(), "flex_client")
108110
if os.path.exists(tempdir):
109111
shutil.rmtree(tempdir)
110-
targetdir = os.path.join(pkg_root, "graphscope", "flex", "rest")
111-
if os.path.exists(targetdir):
112-
shutil.rmtree(targetdir)
113112
# generate
114113
specification = os.path.join(
115114
pkg_root, "..", "flex", "openapi", "openapi_coordinator.yaml"
@@ -133,24 +132,20 @@ def run(self):
133132
cmd,
134133
env=env,
135134
)
136-
# cp
135+
136+
targetdir = os.path.join(
137+
pkg_root, "..", "docs", "flex", "coordinator", "development", "python"
138+
)
137139
subprocess.run(
138-
["cp", "-r", os.path.join(tempdir, "graphscope", "flex", "rest"), targetdir]
140+
[
141+
"sed",
142+
"-i",
143+
"s/# graphscope.flex.rest/# Coordinator Python SDK Reference/",
144+
os.path.join(tempdir, "README.md"),
145+
]
139146
)
140-
if self.with_doc:
141-
targetdir = os.path.join(
142-
pkg_root, "..", "docs", "flex", "coordinator", "development", "python"
143-
)
144-
subprocess.run(
145-
[
146-
"sed",
147-
"-i",
148-
"s/# graphscope.flex.rest/# Coordinator Python SDK Reference/",
149-
os.path.join(tempdir, "README.md"),
150-
]
151-
)
152-
subprocess.run(["cp", os.path.join(tempdir, "README.md"), targetdir])
153-
subprocess.run(["cp", "-r", os.path.join(tempdir, "docs"), targetdir])
147+
subprocess.run(["cp", os.path.join(tempdir, "README.md"), targetdir])
148+
subprocess.run(["cp", "-r", os.path.join(tempdir, "docs"), targetdir])
154149

155150

156151
class FormatAndLint(Command):
@@ -479,7 +474,7 @@ def parse_version(root, **kwargs):
479474
"build_gltorch_ext": BuildGLTorchExt,
480475
"build_proto": BuildProto,
481476
"build_py": CustomBuildPy,
482-
"generate_flex_sdk": GenerateFlexSDK,
477+
"generate_flex_sdk_doc": GenerateFlexSDKDoc,
483478
"bdist_wheel": CustomBDistWheel,
484479
"sdist": CustomSDist,
485480
"develop": CustomDevelop,

0 commit comments

Comments
 (0)