sfc-gh-mkeller/snowcli

Decide on CLI framework to use

Opened this issue · 0 comments

Because typer uses type-hints reflections during run-time to decide on what types arguments should be we cannot have it use future annotations.
Future annotations will become the default eventually in some Python version. This will mean that the source-code will be fragmented between versions eventually. I'm not sure if typer can even work around it.
In general if we were to change what library we use for the CLI interface, now would be a good time.

To reproduce issue run the following minimal example:

from __future__ import annotations

import typer

app = typer.Typer()

@app.command()
def hello(name: str | None = None) -> None:
    if name is None:
        name = "world"
    print(f"Hello {name}!")

if __name__ == "__main__":
    app()