@@ -67,7 +67,7 @@ def _read_json_file(path: str) -> Dict:
6767
6868def handle_configure ():
6969 # TODO(https://github.com/googleapis/librarian/issues/466): Implement configure command and update docstring.
70- logger .info ("'configure' command executed." )
70+ logger .info ("'configure' command executed." )
7171
7272
7373def _get_library_id (request_data : Dict ) -> str :
@@ -215,30 +215,34 @@ def handle_generate(
215215 for api in request_data .get ("apis" , []):
216216 api_path = api .get ("path" )
217217 if api_path :
218-
219- generator_options = []
218+ generator_options = []
220219 with open (f"{ source } /{ api_path } /BUILD.bazel" , "r" ) as f :
221220 content = f .read ()
222221 result = parse_googleapis_content .parse_content (content )
223- py_gapic_entry = [key for key in result .keys () if key .endswith ("_py_gapic" )][0 ]
222+ py_gapic_entry = [
223+ key for key in result .keys () if key .endswith ("_py_gapic" )
224+ ][0 ]
224225
225226 config_keys = [
226227 "grpc_service_config" ,
227228 "rest_numeric_enums" ,
228229 "service_yaml" ,
229230 "transport" ,
230231 ]
231-
232+
232233 for key in config_keys :
233234 config_value = result [py_gapic_entry ].get (key , None )
234235 if config_value is not None :
235236 new_key = key .replace ("_" , "-" )
236237 if key == "grpc_service_config" :
237238 new_key = "retry-config"
238-
239- # There is a bug in the Python generator that treats all values of
240- # `rest-numeric-enums` as True, so just omit it if we want it to be False
241- if new_key == 'rest-numeric-enums' and config_value == "False" :
239+
240+ # There is a bug in the Python generator that treats all values of
241+ # `rest-numeric-enums` as True, so just omit it if we want it to be False
242+ if (
243+ new_key == "rest-numeric-enums"
244+ and config_value == "False"
245+ ):
242246 continue
243247 elif new_key == "service-yaml" or new_key == "retry-config" :
244248 generator_options .append (
@@ -251,19 +255,17 @@ def handle_generate(
251255 f"protoc { api_path } /*.proto --python_gapic_out={ tmp_dir } "
252256 )
253257 if len (generator_options ):
254- generator_command += (
255- f" --python_gapic_opt=metadata,"
256- )
258+ generator_command += f" --python_gapic_opt=metadata,"
257259 for generator_option in generator_options :
258260 generator_command += generator_option
259261 subprocess .run ([generator_command ], cwd = source , shell = True )
260262 api_version = api_path .split ("/" )[- 1 ]
261- staging_dir = os .path .join (output , "owl-bot-staging" , library_id , api_version )
263+ staging_dir = os .path .join (
264+ output , "owl-bot-staging" , library_id , api_version
265+ )
262266 os .makedirs (staging_dir , exist_ok = True )
263267 logger .info (f"Preparing staging directory: { staging_dir } " )
264- subprocess .run (
265- f"cp -r { tmp_dir } /. { staging_dir } " , shell = True
266- )
268+ subprocess .run (f"cp -r { tmp_dir } /. { staging_dir } " , shell = True )
267269
268270 _copy_files_needed_for_post_processing (output , input , library_id )
269271 _run_post_processor (output , library_id )
0 commit comments