Skip to content

Commit

Permalink
Accomodate pyright updates
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Sep 14, 2024
1 parent fcadb01 commit 072dd5f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/tyro/_argparse_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def _recursive_arg_search(
option_strings = arg.lowered.action(
option_strings,
dest="", # dest should not matter.
).option_strings
).option_strings # type: ignore

arguments.append(
_ArgumentInfo(
Expand Down
2 changes: 1 addition & 1 deletion src/tyro/_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def narrow_collection_types(
if len(default_instance) == 0:
return typ
typ = Tuple.__getitem__(tuple(map(type, default_instance))) # type: ignore
return typ
return cast(TypeOrCallable, typ)


# `Final` and `ReadOnly` types are ignored in tyro.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1222,8 +1222,8 @@ def commit(branch: str) -> int:
return 3

assert (
tyro.cli( # type: ignore
Annotated[Any, tyro.conf.arg(constructor=commit)],
tyro.cli(
Annotated[Any, tyro.conf.arg(constructor=commit)], # type: ignore
args="--branch 5".split(" "),
)
== 3
Expand Down
4 changes: 2 additions & 2 deletions tests/test_py311_generated/test_conf_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -1219,8 +1219,8 @@ def commit(branch: str) -> int:
return 3

assert (
tyro.cli( # type: ignore
Annotated[Any, tyro.conf.arg(constructor=commit)],
tyro.cli(
Annotated[Any, tyro.conf.arg(constructor=commit)], # type: ignore
args="--branch 5".split(" "),
)
== 3
Expand Down

0 comments on commit 072dd5f

Please sign in to comment.