Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decide on CLI framework to use #1

Open
sfc-gh-mkeller opened this issue Dec 12, 2022 · 0 comments
Open

Decide on CLI framework to use #1

sfc-gh-mkeller opened this issue Dec 12, 2022 · 0 comments

Comments

@sfc-gh-mkeller
Copy link
Owner

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()
@sfc-gh-mkeller sfc-gh-mkeller added this to the Plugin rewrite milestone Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant