-
-
Notifications
You must be signed in to change notification settings - Fork 704
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
✨ Async support optionally using anyio #340
base: master
Are you sure you want to change the base?
Conversation
# Conflicts: # mkdocs.yml # pyproject.toml # tests/test_completion/test_completion_install.py # typer/main.py
📝 Docs preview for commit 2aaa798 at: https://62f6276299bc9823f965c724--typertiangolo.netlify.app |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #340 +/- ##
==========================================
+ Coverage 96.24% 99.72% +3.48%
==========================================
Files 280 289 +9
Lines 5942 6609 +667
==========================================
+ Hits 5719 6591 +872
+ Misses 223 18 -205 ☔ View full report in Codecov by Sentry. |
@tiangolo will this reach |
# Conflicts: # pyproject.toml # tests/test_completion/test_completion.py # tests/test_completion/test_completion_install.py # tests/test_completion/test_completion_show.py # typer/main.py
📝 Docs preview for commit 54c908a at: https://1d41a6ff.typertiangolo.pages.dev |
📝 Docs preview for commit aba2b6d at: https://f2d58ec2.typertiangolo.pages.dev |
📝 Docs preview for commit 60c1574 at: https://0f102ae8.typertiangolo.pages.dev |
📝 Docs preview for commit 150fe7a at: https://66f933fb.typertiangolo.pages.dev |
📝 Docs preview for commit 4be4aa4 at: https://f6dd02b2.typertiangolo.pages.dev |
📝 Docs preview for commit e3d9232 at: https://dc8389c6.typertiangolo.pages.dev |
📝 Docs preview for commit c30baef at: https://e5083e4f.typertiangolo.pages.dev |
📝 Docs preview for commit b45e696 at: https://5af393d9.typertiangolo.pages.dev |
📝 Docs preview for commit 1aba3c2 at: https://74e837fb.typertiangolo.pages.dev |
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.
Hi @skeletorXVI and @xqSimone!
I appreciate all the work and effort you've put into this PR, including adding extensive tests and documentation. As async support is still high on our priority list, I've started looking into the best way of supporting it.
I'm going to work a bit on your PR to get it back up-to-date and focus on the async functionality only, to check whether this is the direction we want to move in. I'll be pushing to your branch directly, I hope you don't mind! By doing so, I hope to preserve a lot of the work you've already put into this 🙏
This sounds great, I haven't had time or the need to update as our CLI was working perfectly fine. But as I literally yesterday got a task in, that requires to add a CLI to a new project that uses asyncio and I didn't want to use a very old branch. As such I would appreciate if this could pick up some steam and be merged into the actual package soon. If there is need for any assistance just ping me, while I have higher priority tasks to work on right now, I will be able to dedicate some hours to this over the coming weeks. |
…' into feature/anyio-support
…' into feature/anyio-support
I took a shot at supporting async as discussed in #88 while integrated feedback from the issue #88 and PR #332 . Unlike the existing proposal I decided to support both sync and async commands from the same decorator, as I don't see a reason to use two identical decorator functions.
anyio
is listed as an extra dependency. When anyio is not installed, asyncio is used, Whenanyio
andtrio
are installed, the default engine becomes trio.Other async engines, or customized behavior can be used by providing a custom run function via the
async_runner
parameter to the decorator or Typer instance.