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

Fix edge case when combining PEP 695 aliases with typing.Annotated[] #178

Merged
merged 3 commits into from
Oct 19, 2024

Conversation

brentyi
Copy link
Owner

@brentyi brentyi commented Oct 19, 2024

First PR for issues uncovered by #177.

Type aliases were not being correctly resolved for reading metadata introduced by typing.Annotated:

type AnnotatedBasic = Annotated[int, tyro.conf.arg(name="basic")]

def test_annotated_alias():
    @dataclass(frozen=True)
    class Container:
        a: AnnotatedBasic

    assert tyro.cli(Container, args="--basic 1".split(" ")) == Container(1)

Copy link

codecov bot commented Oct 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.71%. Comparing base (8828943) to head (c0d7f46).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #178   +/-   ##
=======================================
  Coverage   99.71%   99.71%           
=======================================
  Files          25       25           
  Lines        2080     2080           
=======================================
  Hits         2074     2074           
  Misses          6        6           
Flag Coverage Δ
unittests 99.71% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@brentyi brentyi merged commit 3f05503 into main Oct 19, 2024
15 checks passed
@brentyi brentyi deleted the brent/pep593_695_edge branch October 19, 2024 05:01
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

Successfully merging this pull request may close these issues.

1 participant