Thanks to visit codestin.com
Credit goes to github.com

Skip to content

✨ Async support optionally using anyio#340

Draft
skeletorXVI wants to merge 48 commits intofastapi:masterfrom
skeletorXVI:feature/anyio-support
Draft

✨ Async support optionally using anyio#340
skeletorXVI wants to merge 48 commits intofastapi:masterfrom
skeletorXVI:feature/anyio-support

Conversation

@skeletorXVI
Copy link

@skeletorXVI skeletorXVI commented Nov 19, 2021

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, When anyio and trio 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.

  • Support asyncio, anyio and trio
  • Anyio is only an optional dependency
  • Autocompletion works as expected
  • Updated documentation
  • Added unit tests

@github-actions

This comment was marked as outdated.

@codecov

This comment was marked as outdated.

@pythonwood pythonwood mentioned this pull request Feb 24, 2023
4 tasks
@dekoza
Copy link

dekoza commented Jul 2, 2023

@tiangolo will this reach main? 😅

# 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
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions github-actions bot added the conflicts Automatically generated when a PR has a merge conflict label Sep 2, 2025
@github-actions

This comment was marked as resolved.

@github-actions github-actions bot removed the conflicts Automatically generated when a PR has a merge conflict label Sep 2, 2025
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2025

@github-actions github-actions bot added the conflicts Automatically generated when a PR has a merge conflict label Sep 9, 2025
@github-actions

This comment was marked as resolved.

@svlandeg svlandeg removed their assignment Nov 4, 2025
@github-actions github-actions bot removed the conflicts Automatically generated when a PR has a merge conflict label Nov 19, 2025
@github-actions
Copy link
Contributor

@github-actions github-actions bot added the conflicts Automatically generated when a PR has a merge conflict label Nov 24, 2025
@github-actions
Copy link
Contributor

This pull request has a merge conflict that needs to be resolved.

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.

Just a quick note here that if we want to progress with this PR at some point, we should update the tutorial examples to use Typer() explicitely, as in #1418.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts Automatically generated when a PR has a merge conflict feature New feature, enhancement or request p3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants