The function typer.main.get_group is annotated as returning a click.Command which isn't wrong because a click.Group is a click.Command, but means I have to cast to group when trying to integrate with existing Click applications.
To Reproduce
Steps to reproduce the behavior with a minimum self-contained file.
Replace each part with your own scenario:
Create a file main.py with:
importtyperapp=typer.Typer()
@app.callback()defcallback():
""" My partially-upgraded-to-Typer app """# insert some fancy new Typer commands hereclick_group=typer.main.get_group(app)
@click_group.command()defsome_old_click_function():
""" I need to rewrite this somday """
Run mypy on this script with mypy main.py and it will output something like
main.py:16: error: "Command" has no attribute "command"
Expected behavior
Able to drop in Typer at the top level to start slowly converting an existing Click app.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
OS: macOS
Typer Version: 0.2.1
Python version: 3.8.2
mypy version: 0.770
The text was updated successfully, but these errors were encountered:
Describe the bug
The function
typer.main.get_groupis annotated as returning aclick.Commandwhich isn't wrong because aclick.Groupis aclick.Command, but means I have to cast to group when trying to integrate with existing Click applications.To Reproduce
Steps to reproduce the behavior with a minimum self-contained file.
Replace each part with your own scenario:
main.pywith:Run mypy on this script with
mypy main.pyand it will output something likeExpected behavior
Able to drop in Typer at the top level to start slowly converting an existing Click app.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
The text was updated successfully, but these errors were encountered: