Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions canopy/scripts/canvas_api_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,34 @@ def build_canvas_client_file(apis_folder: Path) -> None:
type=click.Path(file_okay=False, writable=True, path_type=Path),
help="Path to output the API file to.",
)
@click.option("--generate-async", is_flag=True, default=False, help="Generate async version")
@click.pass_context
def build_all_apis(ctx: click.Context, specs_folder: Path, output_folder: Path) -> None:
def build_all_apis(
ctx: click.Context,
specs_folder: Path,
output_folder: Path,
generate_async: bool,
) -> None:
"""Build all APIs from downloaded specfiles."""
for spec_path in specs_folder.iterdir():
if spec_path.name not in blacklist:
with spec_path.open() as f:
ctx.invoke(
build_api_from_specfile,
specfile=f,
api_name=None,
output_folder=output_folder,
)
if not generate_async:
with spec_path.open() as f:
ctx.invoke(
build_api_from_specfile,
specfile=f,
api_name=None,
output_folder=output_folder,
)
else:
with spec_path.open() as f:
ctx.invoke(
build_api_from_specfile,
specfile=f,
api_name=None,
output_folder=output_folder,
generate_async=True,
)


# Rebuild APIs
Expand Down