Skip to content

Commit b22b973

Browse files
committed
lint
1 parent 7ffcfcd commit b22b973

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

.generator/cli.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def _write_json_file(path: str, updated_content: Dict):
112112

113113
def handle_configure():
114114
# TODO(https://github.com/googleapis/librarian/issues/466): Implement configure command and update docstring.
115-
logger.info("'configure' command executed.")
115+
logger.info("'configure' command executed.")
116116

117117

118118
def _get_library_id(request_data: Dict) -> str:
@@ -260,30 +260,34 @@ def handle_generate(
260260
for api in request_data.get("apis", []):
261261
api_path = api.get("path")
262262
if api_path:
263-
264-
generator_options=[]
263+
generator_options = []
265264
with open(f"{source}/{api_path}/BUILD.bazel", "r") as f:
266265
content = f.read()
267266
result = parse_googleapis_content.parse_content(content)
268-
py_gapic_entry = [key for key in result.keys() if key.endswith("_py_gapic")][0]
267+
py_gapic_entry = [
268+
key for key in result.keys() if key.endswith("_py_gapic")
269+
][0]
269270

270271
config_keys = [
271272
"grpc_service_config",
272273
"rest_numeric_enums",
273274
"service_yaml",
274275
"transport",
275276
]
276-
277+
277278
for key in config_keys:
278279
config_value = result[py_gapic_entry].get(key, None)
279280
if config_value is not None:
280281
new_key = key.replace("_", "-")
281282
if key == "grpc_service_config":
282283
new_key = "retry-config"
283-
284-
# There is a bug in the Python generator that treats all values of
285-
# `rest-numeric-enums` as True, so just omit it if we want it to be False
286-
if new_key == 'rest-numeric-enums' and config_value == "False":
284+
285+
# There is a bug in the Python generator that treats all values of
286+
# `rest-numeric-enums` as True, so just omit it if we want it to be False
287+
if (
288+
new_key == "rest-numeric-enums"
289+
and config_value == "False"
290+
):
287291
continue
288292
elif new_key == "service-yaml" or new_key == "retry-config":
289293
generator_options.append(
@@ -296,19 +300,17 @@ def handle_generate(
296300
f"protoc {api_path}/*.proto --python_gapic_out={tmp_dir}"
297301
)
298302
if len(generator_options):
299-
generator_command += (
300-
f" --python_gapic_opt=metadata,"
301-
)
303+
generator_command += f" --python_gapic_opt=metadata,"
302304
for generator_option in generator_options:
303305
generator_command += generator_option
304306
subprocess.run([generator_command], cwd=source, shell=True)
305307
api_version = api_path.split("/")[-1]
306-
staging_dir = os.path.join(output, "owl-bot-staging", library_id, api_version)
308+
staging_dir = os.path.join(
309+
output, "owl-bot-staging", library_id, api_version
310+
)
307311
os.makedirs(staging_dir, exist_ok=True)
308312
logger.info(f"Preparing staging directory: {staging_dir}")
309-
subprocess.run(
310-
f"cp -r {tmp_dir}/. {staging_dir}", shell=True
311-
)
313+
subprocess.run(f"cp -r {tmp_dir}/. {staging_dir}", shell=True)
312314

313315
_copy_files_needed_for_post_processing(output, input, library_id)
314316
_run_post_processor(output, library_id)

0 commit comments

Comments
 (0)