You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we are using Typer for our various cli commands (infrahubctl, infrahub). Because Typer doesn't support Async natively we often have to create 2 versions of each command (see example below),
one Sync for Typer with the definition of Options/Arguments,
one Async that will execute the real logic and we are calling the second one from the first one with aiorun
@app.command()defmerge(
branch_name: str,
config_file: Path=typer.Option(DEFAULT_CONFIG_FILE, envvar=ENVVAR_CONFIG_FILE),
) ->None:
"""Merge a Branch with main."""config.load_and_exit(config_file=config_file)
aiorun(_merge(branch_name=branch_name))
There is a long discussion on the Typer project about that and it looks like Typer is planning to support Async natively at some point. Meanwhile, there are a number of workaround discussed in this Thread that would be easy to implement fastapi/typer#88 (comment)
Component
Python SDK
Describe the Feature Request
Currently we are using Typer for our various cli commands (
infrahubctl
,infrahub
). Because Typer doesn't support Async natively we often have to create 2 versions of each command (see example below),aiorun
There is a long discussion on the Typer project about that and it looks like Typer is planning to support Async natively at some point. Meanwhile, there are a number of workaround discussed in this Thread that would be easy to implement
fastapi/typer#88 (comment)
Like this one
Describe the Use Case
Simplify how to write our cli commands and reduce the maintenance effort
Additional Information
No response
The text was updated successfully, but these errors were encountered: