From 9be9a1ff36fe581a0cde78bf1c3091482910e4e9 Mon Sep 17 00:00:00 2001 From: "Waylon S. Walker" Date: Fri, 28 Apr 2023 08:33:06 -0500 Subject: [PATCH] setup pyannotate --- examples/person.py | 10 +++++++++- pyproject.toml | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/person.py b/examples/person.py index 4918ea5..6f06af8 100644 --- a/examples/person.py +++ b/examples/person.py @@ -1,3 +1,4 @@ +from pyannotate_runtime import collect_types from examples.models import Person from pydantic_typer import expand_pydantic_args @@ -9,5 +10,12 @@ def get_person(person: Person, thing: str = None) -> Person: from rich import print print(str(thing)) - print(person) + + +if __name__ == "__main__": + collect_types.init_types_collection() + with collect_types.collect(): + person = get_person(name="John", age=1, r=1, g=1, b=1, a=1, length=1) + + collect_types.dump_stats("type_info.json") diff --git a/pyproject.toml b/pyproject.toml index 80e1cec..9866678 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,6 +54,7 @@ dependencies = [ "pytest-mock", "pytest-rich", "ruff", + 'pyannotate', "black", ] [tool.hatch.envs.default.scripts]