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

📝 Add documentation for enums created via the functional API #398

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Torvaney
Copy link

This PR updates the documentation to include discussion of enumerating choices with enum.Enums created with the functional API. This is useful when creating choices dynamically, for example logging.

See further discussion of enums and the functional API in #389

@github-actions
Copy link

📝 Docs preview for commit e3f2d03 at: https://6283788fce83e3109147d75c--typertiangolo.netlify.app

@codecov
Copy link

codecov bot commented May 17, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (1e43c6b) to head (e3f2d03).
Report is 126 commits behind head on master.

❗ Current head e3f2d03 differs from pull request most recent head 4fe60e7. Consider uploading reports for the commit 4fe60e7 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           master      #398      +/-   ##
===========================================
+ Coverage   96.24%   100.00%   +3.75%     
===========================================
  Files         280       252      -28     
  Lines        5942      5287     -655     
===========================================
- Hits         5719      5287     -432     
+ Misses        223         0     -223     

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

Copy link

@joaonc joaonc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Hope it gets merged soon.

@svlandeg svlandeg added the docs Improvements or additions to documentation label Jun 13, 2022
@github-actions
Copy link

📝 Docs preview for commit 4fe60e7 at: https://639cea4bf6fa040349687d3f--typertiangolo.netlify.app

@svlandeg svlandeg added the p3 label Mar 6, 2024
Copy link

📝 Docs preview for commit 7abe600 at: https://9cea233c.typertiangolo.pages.dev

Copy link

📝 Docs preview for commit 4700981 at: https://c89568c3.typertiangolo.pages.dev

Copy link

📝 Docs preview for commit b91c009 at: https://52d96a74.typertiangolo.pages.dev

Copy link
Member

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for this contribution, and apologies for the delay in reviewing.

I agree that this additional section in the documentation could make it more clear for users on how to use "pure" Python Enum's with Typer.

I updated the PR with the latest from master and also included an Annotated version.

It's probably good if Tiangolo has another look at the exact phrasing in the documentation. I'll leave the final decision to merge or not with him.

@svlandeg svlandeg changed the title Add documentation for enums created via the functional API 📝 Add documentation for enums created via the functional API Jul 19, 2024
Copy link

github-actions bot commented Aug 9, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation p3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Must use typer.Option to supply default argument with Enums created with functional API
4 participants