-
Notifications
You must be signed in to change notification settings - Fork 38
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
2.0 roadmap #186
Comments
async support? |
Hi @Goldziher, If you'd like to run an async function in Click, you can do something like this: import asyncio
import rich_click as click
async def func(a, b, c):
...
@click.command()
@click.argument("a")
@click.argument("b")
@click.argument("c")
def main(a, b, c):
asyncio.run(func(a, b, c)) Or something like this, with the import rich_click as click
import anyio
@click.command()
@click.argument("a")
@click.argument("b")
@click.argument("c")
@anyio.run_sync
async def main(a, b, c):
... Basically, if you need asynchronous code execution within the callback, creating your own event loop (recommended with I do not believe it is in the scope of rich-click to explicitly support callbacks which are themselves async / coroutine functions. There are three reasons I do not believe we should support it:
|
thanks. im already doing this. its simply pretty redundant 😉 |
2.0 will likely be what comes after 1.9.
Objective for 2.0 is to release in mid 2025. That's a very, very long time away!
This is a living document. Nothing here is guaranteed, everything is subject to change.
Deprecations
Hard + immediate deprecations
These things will not be supported going into
2.0.0
.These are easy enough to enforce at the package install level, so there is no real risk of users getting hurt by this.
Hard + delayed deprecations
These things will be available in
2.0.0
, and phased out entirely into2.1.0
. Using these features will trigger aDeprecationWarning
.Logic: Many of these things are already deprecated, and switching off them is relatively easy for users. These are, however, breaking API changes, and we want to support them as long as possible.
rich_click.rich_group
(userich_click.rich_command
instead)use_markdown=True
anduse_rich_markup=True
(usetext_markup=...
instead)get_module_help_configuration()
OptionHighlighter
rich_click.cli.patch()
(userich_click.patch.patch()
instead)Soft + delayed deprecations
These things will be available in all
2.x
versions, and phased out entirely in a hypothetical3.0
or3.1
release, ifrich-click
ever gets there (who knows!). Using these features will trigger aDeprecationWarning
.Logic: Switching away from these features is potentially very tedious for users, so we want to give them as much time as possible to move away.
Features
RichStyleConfiguration.build(primary="red", secondary="blue")
The text was updated successfully, but these errors were encountered: