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

Allow typer to execute async commands by wrapping them in asyncio.run() #444

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

Conversation

paulo-raca
Copy link
Contributor

I've been using asyncio on a lot of my python tools, and wrapping things in asyncio.run() becomes clumsy quickly 😅

This change Automatically wraps typer commands in asyncio.run() if they are asyncio coroutines.

@github-actions
Copy link

📝 Docs preview for commit e4c48c3 at: https://639cea27a7c2ed08a58a9c0a--typertiangolo.netlify.app

@github-actions
Copy link

📝 Docs preview for commit 07b2214 at: https://64aeb33c3927d700a0c055be--typertiangolo.netlify.app

@github-actions
Copy link

📝 Docs preview for commit 9d1f105 at: https://64af4344ad652212d4e70cd6--typertiangolo.netlify.app

@github-actions
Copy link

📝 Docs preview for commit f63ae5d at: https://64af4e620519fc0091307924--typertiangolo.netlify.app

@github-actions
Copy link

📝 Docs preview for commit 7d2e6a7 at: https://64af500590cb4b00b49a91fa--typertiangolo.netlify.app

@paulo-raca paulo-raca force-pushed the async_command branch 2 times, most recently from 1e7c2eb to 9f5c32e Compare July 13, 2023 01:16
@github-actions
Copy link

📝 Docs preview for commit 4308aec at: https://64af512a55f978008660e38f--typertiangolo.netlify.app

@github-actions
Copy link

📝 Docs preview for commit 4bfc499 at: https://64af552eb5272602e83a5ab4--typertiangolo.netlify.app

@github-actions
Copy link

📝 Docs preview for commit 22dc4de at: https://64af5e876b7aa4068618a49f--typertiangolo.netlify.app

@github-actions
Copy link

📝 Docs preview for commit b65aea7 at: https://64af60c10641ae07645c748f--typertiangolo.netlify.app

@github-actions
Copy link

📝 Docs preview for commit d744687 at: https://64af65dd71b6b40a43d75136--typertiangolo.netlify.app

@github-actions
Copy link

📝 Docs preview for commit 3eb6020 at: https://64af667dd2cdb809b318ae44--typertiangolo.netlify.app

@github-actions
Copy link

📝 Docs preview for commit 1f3d7d1 at: https://64af671671b6b40a97d74efb--typertiangolo.netlify.app

@paulo-raca
Copy link
Contributor Author

@tiangolo, sorry to keep it open for so long without completing.

I've now added documentation and fixed mypy errors, I believe it is good to go 😃

Thanks!

@svlandeg svlandeg added feature New feature, enhancement or request p3 labels Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature, enhancement or request p3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants