Open
Description
Describe the bug
When the path have ~
in the path it doesn't seem to resolve.
To Reproduce
- Create a file
main.py
with:
import typer
app = typer.Typer()
@app.command()
def login(
config_path: Path = typer.Option(
default=os.environ.get("PROFILE", "~/.aws/my_profile"),
exists=True,
file_okay=True,
dir_okay=False,
readable=True,
resolve_path=True,
)
):
typer.echo(f"Hello {config_path}")
if __name__ == "__main__":
app()
- Call it with:
python main.py
- It outputs:
Error: Invalid value for '--config-path': File '~/.aws/my_profile' does not exist.
- But I expected it to output:
Hello ~/.aws/my_profile
or
Hello /User/username/.aws/my_profile
Environment
- OS: macOS
- Typer Version: 0.3.2
- Python version: 3.6.12