-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
fixed showing choices of list,tuples and set type annotations #123
Conversation
26cb01e
to
73175c3
Compare
…e annotated type contain single type
73175c3
to
71ac672
Compare
ab8483e
to
f862d9d
Compare
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #123 +/- ##
==========================================
- Coverage 96.45% 96.41% -0.05%
==========================================
Files 16 16
Lines 1750 1755 +5
Branches 442 444 +2
==========================================
+ Hits 1688 1692 +4
Misses 29 29
- Partials 33 34 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
cyclopts/help.py
Outdated
@@ -190,16 +190,18 @@ def format_doc(root_app, app: "App", format: str = "restructuredtext"): | |||
|
|||
|
|||
def _get_choices(type_: Type) -> str: | |||
choices: str = "" | |||
if get_origin(type_) is Union: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not for this PR, but I'm willing to bet that this needs a similar fix for python3.10 pipe unions as in #80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is probably victim to a few bugs I outlined in #124. I'm going to fix those in a separate PR. I will tag a release including these changes within the next day or two. Thank you for your continued contribution!
@OrHayat I made some slight changes to a few of your tests, please let me know if you agree with the changes or if you believe the behavior should be different. Afterwards we can merge this. |
sure u can merge that whenever you want |
this has been included in v2.4.1 |
fixed showing choices of list,tuples and set type annotations when the annotation contain single type
for example list[Literal["a","b"]]