@@ -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
156151class 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