Git Product home page Git Product logo

asyncclick's People

Contributors

altendky avatar amy-lei avatar blueyed avatar cataman avatar davidism avatar dependabot-preview[bot] avatar dependabot[bot] avatar epequeno avatar ikeviny avatar jab avatar janluke avatar jcrotts avatar jdufresne avatar josiahdub avatar julen avatar kporangehat avatar mitsuhiko avatar mjpieters avatar pre-commit-ci[bot] avatar rsiemens avatar saif807380 avatar segevfiner avatar sirosen avatar sjagoe avatar slafs avatar smurfix avatar stopthatcow avatar untitaker avatar yourun-proger avatar zacbir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

asyncclick's Issues

Instructions on README to set asyncclick's backend

In an asyncio project, I was testing a entry for setup.py's console_scripts, similar to displayed in asyncclick's README.rst.

However, when I ran the command of the asyncio project, the following error appeared:

> project_script
Traceback (most recent call last):
  File "/home/user/.local/share/virtualenvs/project_root-RVI4pmxg/lib/python3.7/site-packages/anyio/__init__.py", line 57, in run
    asynclib = import_module('{}._backends._{}'.format(__name__, backend))
  File "/home/user/.local/share/virtualenvs/project_root-RVI4pmxg/lib64/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/user/.local/share/virtualenvs/project_root-RVI4pmxg/lib/python3.7/site-packages/anyio/_backends/_trio.py", line 5, in <module>
    import trio.hazmat
ModuleNotFoundError: No module named 'trio'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/user/.local/share/virtualenvs/project_root-RVI4pmxg/bin/package_name", line 11, in <module>
    load_entry_point('package_name', 'console_scripts', 'package_name')()
  File "/home/user/.local/share/virtualenvs/project_root-RVI4pmxg/lib/python3.7/site-packages/asyncclick/core.py", line 799, in __call__
    return anyio.run(self._main, main, args, kwargs, backend=_anyio_backend)
  File "/home/user/.local/share/virtualenvs/project_root-RVI4pmxg/lib/python3.7/site-packages/anyio/__init__.py", line 59, in run
    raise LookupError('No such backend: {}'.format(backend)) from exc
LookupError: No such backend: trio

Reading asyncclick's __init__.py, I understood was to do in my file.

https://github.com/python-trio/trio-click/blob/bac4f5404749772f315b90ea38fe02de81681835/click/__init__.py#L15-L16

So in my script code I included the following lines and it worked as a charm.

import asyncclick as click


# Important setting to asyncclick
click.anyio_backend = "asyncio"

...

# Actual asyncclick user code

Should that info be included in README.rst ?

How to run_forever?

Creating a multi-socket listener like in https://stackoverflow.com/questions/62571622/running-multiple-sockets-using-asyncio-in-python

Works if not using asyncclick to fire up my own even loop and run_forever() as in the stackoverflow example. If I was just running one socket, a socket.serve_forever() works fine, but I need to run multiples and therefore run the main loop forever. Do you know how I can accomplish this with an asyncclick command line? Can't just grap the get_running_loop() and run_forever as it errors with This event loop is already running.

Changing the documentation

So I understand this is simply a fork of click but your own README is misleading in that it directs users to install click instead of installing trio-click.

I think it should be changed to reflect the nature of this project of it being a click fork that implements click to be trio-compatible.

This would likely lead to less issues down the road as well.

How to run from console_scripts / entrypoint?

Hello!

I'm trying to build an async cli utility which I can install using pip and which creates an entrypoint script.
See https://packaging.python.org/specifications/entry-points/ or https://python-poetry.org/docs/pyproject/#scripts for details about this feature.

How should my code look like?

import asyncclick as click
@click.command()
async def run():
    print("foo")
[tool.poetry.scripts]
foobar = "foobar.cli:run"

kind of works. But it's running with asyncio instead of trio.
I don't see any way to pass _anyio_backend="trio" without creating another synchronous function.

Is asyncclick can't use in windows?

When I used it in windows,I got an error that: _wrap_std_stream' from 'asyncclick._winconsole
But when I used it in wsl,it was available.
All error info :
(aerichtest-Io3kg-ro-py3.8) C:\Users\surface\PycharmProjects\aerichTest>aerich init -h Traceback (most recent call last): File "C:\Users\surface\AppData\Local\pypoetry\Cache\virtualenvs\aerichtest-Io3kg-ro- py3.8\Scripts\aerich-script.py", line 11, in <module> load_entry_point('aerich', 'console_scripts', 'aerich')() File "c:\users\surface\appdata\local\pypoetry\cache\virtualenvs\aerichtest-io3kg-ro- py3.8\lib\site-packages\pkg_resources\__init__.py", line 490, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "c:\users\surface\appdata\local\pypoetry\cache\virtualenvs\aerichtest-io3kg-ro- py3.8\lib\site-packages\pkg_resources\__init__.py", line 2862, in load_entry_point return ep.load() File "c:\users\surface\appdata\local\pypoetry\cache\virtualenvs\aerichtest-io3kg-ro- py3.8\lib\site-packages\pkg_resources\__init__.py", line 2462, in load return self.resolve() File "c:\users\surface\appdata\local\pypoetry\cache\virtualenvs\aerichtest-io3kg-ro- py3.8\lib\site-packages\pkg_resources\__init__.py", line 2468, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "c:\users\surface\appdata\local\pypoetry\cache\virtualenvs\aerichtest-io3kg-ro- py3.8\src\aerich\aerich\cli.py", line 8, in <module> import asyncclick as click File "c:\users\surface\appdata\local\pypoetry\cache\virtualenvs\aerichtest-io3kg-ro- py3.8\lib\site-packages\asyncclick\__init__.py", line 7, in <module> from .core import Argument File "c:\users\surface\appdata\local\pypoetry\cache\virtualenvs\aerichtest-io3kg-ro-py3.8\lib\site-packages\asyncclick\core.py", line 18, in <module> from ._compat import isidentifier File "c:\users\surface\appdata\local\pypoetry\cache\virtualenvs\aerichtest-io3kg-ro-py3.8\lib\site-packages\asyncclick\_compat.py", line 540, in <module> from ._winconsole import _get_windows_console_stream, _wrap_std_stream ImportError: cannot import name '_wrap_std_stream' from 'asyncclick._winconsole' (c:\users\surface\appdata\local\pypoetry\cache\virtualenvs\aerichtest-io3kg-ro-py3.8\lib\site-packa ges\asyncclick\_winconsole.py)

Environment

  • Python version:3.8
  • Click version:7.1.2.1

setting asyncclick to use asyncio.WindowsProactorEventLoopPolicy

Whilst trying playwright as an alternate automation tool to pyppeteer I encountered NotImplemented Errors from the asyncclick defaulting to WindowsSelectorEventLoopPolicy. From what I understand , Python 3.8 onwards are defaulting to WindowsProactorEventLoopPolicy and in my instance 3rd party modules are expecting this.

There is currently no way to set the backend options such as event_loop policy.

Expected Behavior

We should be able to set the backend options in the following example

main(_anyio_backend="asyncio",_anyio_backend_options={'policy':asyncio.WindowsProactorEventLoopPolicy()})

On Windows this should default to asyncio.WindowsProactorEventLoopPolicy().

Example of the following failing code

import asyncio
import anyio
import asyncclick as click
from  playwright import async_playwright

@click.command()
@click.argument('url',default="http://whatsmyuseragent.org/")
async def main(url):
    playwright = await async_playwright().start()
    browser=await playwright.launch(headless=False)
    print("Browser Launched-----------------")
    page = await browser.newPage()
    print("Browser new Page created ")
    await asyncio.sleep(2)
    print(f"Goto {url} ")
    await page.goto(url)
    await asyncio.sleep(10)
    await browser.close()
    print("------------------------")

if __name__ == "__main__":
    main(_anyio_backend="asyncio")

Suggestion

Modifying the following method in core.py class BaseCommand enables the above code to work and allows the setting of back_end Options

I am unsure about implications to other backends and other platforms, So I am not proposing this through a PR as the following is possibly not a universal fix

import asyncio
......
....
class BaseCommand(object):
...
...
  def __call__(self, *args, _anyio_backend=None, _anyio_backend_options={'policy':asyncio.WindowsProactorEventLoopPolicy()},**kwargs):
        """Alias for :meth:`main`."""
        main = self.main
        if _anyio_backend is None:
            import asyncclick
            _anyio_backend = asyncclick.anyio_backend
        return anyio.run(self._main, main, args, kwargs, backend=_anyio_backend, backend_options=_anyio_backend_options)

Actual Behavior

Traceback from above example

(Tools20W39Py376) PS C:\Users\<USER>\SANDBOXplaywright> python .\async_click_playwright.py
Traceback (most recent call last):
  File ".\async_click_playwright.py", line 24, in <module>
    main(_anyio_backend="asyncio")
  File "c:\users\<USER>\axternal\asyncclick\asyncclick\core.py", line 865, in __call__
    return anyio.run(self._main, main, args, kwargs, backend=_anyio_backend)
  File "C:\Users\<USER>\Anaconda3\envs\Tools20W39Py376\lib\site-packages\anyio\_core\_eventloop.py", line 52, in run
    return asynclib.run(func, *args, **backend_options)  # type: ignore
  File "C:\Users\<USER>\Anaconda3\envs\Tools20W39Py376\lib\site-packages\anyio\_backends\_asyncio.py", line 160, in run
    return native_run(wrapper(), debug=debug)
  File "C:\Users\<USER>\Anaconda3\envs\Tools20W39Py376\lib\asyncio\runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "C:\Users\<USER>\Anaconda3\envs\Tools20W39Py376\lib\asyncio\base_events.py", line 583, in run_until_complete
    return future.result()
  File "C:\Users\<USER>\Anaconda3\envs\Tools20W39Py376\lib\site-packages\anyio\_backends\_asyncio.py", line 155, in wrapper
    return await func(*args)
  File "c:\users\<USER>\axternal\asyncclick\asyncclick\core.py", line 868, in _main
    return await main(*args, **kwargs)
  File "c:\users\<USER>\axternal\asyncclick\asyncclick\core.py", line 814, in main
    rv = await self.invoke(ctx)
  File "c:\users\<USER>\axternal\asyncclick\asyncclick\core.py", line 1105, in invoke
    return await ctx.invoke(self.callback, **ctx.params)
  File "c:\users\<USER>\axternal\asyncclick\asyncclick\core.py", line 644, in invoke
    rv = await rv
  File ".\async_click_playwright.py", line 9, in main
    playwright = await async_playwright().start()
  File "C:\Users\<USER>\Anaconda3\envs\Tools20W39Py376\lib\site-packages\playwright\main.py", line 119, in start
    return await self.__aenter__()
  File "C:\Users\<USER>\Anaconda3\envs\Tools20W39Py376\lib\site-packages\playwright\main.py", line 110, in __aenter__
    self._connection = await run_driver_async()
  File "C:\Users\<USER>\Anaconda3\envs\Tools20W39Py376\lib\site-packages\playwright\main.py", line 62, in run_driver_async
    limit=32768,
  File "C:\Users\<USER>\Anaconda3\envs\Tools20W39Py376\lib\asyncio\subprocess.py", line 217, in create_subprocess_exec
    stderr=stderr, **kwds)
  File "C:\Users\<USER>\Anaconda3\envs\Tools20W39Py376\lib\asyncio\base_events.py", line 1540, in subprocess_exec
    bufsize, **kwargs)
  File "C:\Users\<USER>\Anaconda3\envs\Tools20W39Py376\lib\asyncio\base_events.py", line 462, in _make_subprocess_transport
    raise NotImplementedError

Environment

  • Python version:3.7.6
  • AsyncClick version:7.1.2.2

Issue Originally raised at microsoft/playwright-python#239 but closed after determining issue in asyncclick

What is x in the first (and only) example?

This is example's code:

import anyio
import asyncclick as click

@click.command()
@click.option("--count", default=1, help="Number of greetings.")
@click.option("--name", prompt="Your name", help="The person to greet.")
async def hello(count, name):
    """Simple program that greets NAME for a total of COUNT times."""
    for _ in range(count):
        if x: await anyio.sleep(0.1)
        click.echo(f"Hello, {name}!")

if __name__ == '__main__':
    hello(_anyio_backend="trio")  # or asyncio, or curio

So what is x I wonder?

Dependencies of asyncclick are incomplete

I installed asyncclick using

pip install asyncclick
  • Python version: 3.11

Then I tried to use it and ran into an error:

No module named 'anyio'  File "/path/to/where/I/used/asyncclick/src/foo.py", line 12, in     import asyncclick as click ModuleNotFoundError: No module named 'anyio'

call_on_close should work with async

Trying to fire an event when a command is finished. I currently use

@cli.resultcallback()
async def console_shutdown(result, **kwargs):
    print('cli end')

Which works fine except for when there is no actual command. In other words just running click without command or params to show help output for example.

I need to run code at the end of command including no command which shows help output. I found that click has call_on_close where you can pass in a callback function which does indeed get called at the end of every command even NO command that just shows the help output.

@click.group(...)
@click.pass_context
async def cli(ctx):
    ctx.call_on_close(console_shutdown)

But asyncclick does not handle that callback as await. So I can only have synchronous methods. I need the callbacks to be awaited so I can call other shutdown code that must also be awaited.

Multiple trio-click/asyncclick repositories

Heya. It's a bit confusing that there are 3 (that I know of) asyncclick/trio-click repositories.

It looks like this is the 'official' one, right? I think the fact that this one is 'forked from smurfix/trio-click' causes a few issues. I tried to create a pull request here, but I always get redirected to the 'smurfix' one.

Initially I created the pull request on https://github.com/click-contrib/asyncclick, before there was a mention to go there.

Also, quick question: does the fact that this is named 'trio-click' mean only 'trio' will be 'supported' in the long run? I use this with asyncio (which works fine for now), but would be good to know if this may change in the long run...

AttributeError: 'Context' object has no attribute '_ctx_mgr'

The most recent change between 8.1.7.0 and 8.1.7.1 causes the unit tests to fail:

bae29c3#r137383936

[   31s] =================================== FAILURES ===================================
[   31s] ________________________ test_context_pushing[asyncio] _________________________
[   31s] 
[   31s]     @pytest.mark.anyio
[   31s]     async def test_context_pushing():
[   31s]         rv = []
[   31s]     
[   31s]         @click.command()
[   31s]         def cli():
[   31s]             pass
[   31s]     
[   31s]         ctx = click.Context(cli)
[   31s]     
[   31s]         @ctx.call_on_close
[   31s] >       def test_callback():
[   31s] 
[   31s] tests/test_context.py:190: 
[   31s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   31s] 
[   31s] self = <asyncclick.core.Context object at 0x7f0a5bf1c700>
[   31s] f = <function test_context_pushing.<locals>.test_callback at 0x7f0a5bf115e0>
[   31s] 
[   31s]     def call_on_close(self, f: t.Callable[..., t.Any]) -> t.Callable[..., t.Any]:
[   31s]         """Register a function to be called when the context tears down.
[   31s]     
[   31s]         This can be used to close resources opened during the script
[   31s]         execution. Resources that support Python's context manager
[   31s]         protocol which would be used in a ``with`` statement should be
[   31s]         registered with :meth:`with_resource` instead.
[   31s]     
[   31s]         :param f: The function to execute on teardown.
[   31s]         """
[   31s] >       return self._ctx_mgr.callback(f)
[   31s] E       AttributeError: 'Context' object has no attribute '_ctx_mgr'
[   31s] 
[   31s] ../../BUILDROOT/python-asyncclick-8.1.7.1-0.x86_64/usr/lib/python3.9/site-packages/asyncclick/core.py:627: AttributeError
[   31s] __________________________ test_context_pushing[trio] __________________________
[   31s] 
[   31s]     @pytest.mark.anyio
[   31s]     async def test_context_pushing():
[   31s]         rv = []
[   31s]     
[   31s]         @click.command()
[   31s]         def cli():
[   31s]             pass
[   31s]     
[   31s]         ctx = click.Context(cli)
[   31s]     
[   31s]         @ctx.call_on_close
[   31s] >       def test_callback():
[   31s] 
[   31s] tests/test_context.py:190: 
[   31s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   31s] 
[   31s] self = <asyncclick.core.Context object at 0x7f0a602bc850>
[   31s] f = <function test_context_pushing.<locals>.test_callback at 0x7f0a602a9820>
[   31s] 
[   31s]     def call_on_close(self, f: t.Callable[..., t.Any]) -> t.Callable[..., t.Any]:
[   31s]         """Register a function to be called when the context tears down.
[   31s]     
[   31s]         This can be used to close resources opened during the script
[   31s]         execution. Resources that support Python's context manager
[   31s]         protocol which would be used in a ``with`` statement should be
[   31s]         registered with :meth:`with_resource` instead.
[   31s]     
[   31s]         :param f: The function to execute on teardown.
[   31s]         """
[   31s] >       return self._ctx_mgr.callback(f)
[   31s] E       AttributeError: 'Context' object has no attribute '_ctx_mgr'
[   31s] 
[   31s] ../../BUILDROOT/python-asyncclick-8.1.7.1-0.x86_64/usr/lib/python3.9/site-packages/asyncclick/core.py:627: AttributeError
[   31s] =========================== short test summary info ============================

click.Context does not have that attribute.

allow async user autocompletions

In _bashcomplete.py, the get_choices() method is async, but the get_user_autocompletions() call is not async. This means the autocompletions callback on a parameter cannot by an async function. In my use case, I would like to make an async db call to look up a set of values.

Ideally, the get_user_autocompletions call would be marked async and the autocompletion callback would be checked to see if it is a coroutine.

Revert some of commit 9676da78a

I'm looking at implementing trio-click into a real world application. Is it safe to either revert this commit and put back the required items (incorrect import, lines 438-441 etc)

9676da7

or would it be preferred to just provide a PR removing the print/gc() parts?

Release new version to PyPi

The current version listed there does not declare the anyio dependency whereas the file currently in the repo does.

Interoperability with click-option-group

Expected Behavior

The minimal example below should enforce any option from the required option group to be passed from the command line.

import asyncclick as click
from click_option_group import optgroup
from click_option_group import RequiredAnyOptionGroup

class PortRange(click.ParamType):
   ...

@click.command()
@click.argument('target')
@click.option('--interface', '-i', type=str, required=True)
@optgroup.group('Ports and/or port ranges', cls=RequiredAnyOptionGroup)
@optgroup.option('--port', '-p', type=click.IntRange(min=0, max=65535), multiple=True)
@optgroup.option('--range', '-r', 'range_', type=PortRange(), multiple=True)
async def main(*args, **kwargs) -> None:
    ...

if __name__ == '__main__':
    main(_anyio_backend='trio')

Actual Behavior

The two libs seem to be incompatible with each other, as the traceback below suggests. However, if I replace asyncclick with regular click, it works just fine.

❯ poetry run python -m wrath 192.168.1.1 -i enp5s0
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/alex/Repositories/overclockworked64/wrath/wrath/__main__.py", line 11, in <module>
    async def main(*args, **kwargs) -> None:
  File "/home/alex/.cache/pypoetry/virtualenvs/wrath-NjAFd-T0-py3.8/lib/python3.8/site-packages/click_option_group/_decorators.py", line 137, in decorator
    func = option_group.option(*item.param_decls, **item.attrs)(func)
  File "/home/alex/.cache/pypoetry/virtualenvs/wrath-NjAFd-T0-py3.8/lib/python3.8/site-packages/click_option_group/_core.py", line 174, in decorator
    func = click.option(*param_decls, group=self, **option_attrs)(func)
  File "/home/alex/.cache/pypoetry/virtualenvs/wrath-NjAFd-T0-py3.8/lib/python3.8/site-packages/click/decorators.py", line 247, in decorator
    _param_memo(f, OptionClass(param_decls, **option_attrs))
  File "/home/alex/.cache/pypoetry/virtualenvs/wrath-NjAFd-T0-py3.8/lib/python3.8/site-packages/click_option_group/_core.py", line 31, in __init__
    super().__init__(param_decls, **attrs)
  File "/home/alex/.cache/pypoetry/virtualenvs/wrath-NjAFd-T0-py3.8/lib/python3.8/site-packages/click/core.py", line 2465, in __init__
    super().__init__(param_decls, type=type, multiple=multiple, **attrs)
  File "/home/alex/.cache/pypoetry/virtualenvs/wrath-NjAFd-T0-py3.8/lib/python3.8/site-packages/click/core.py", line 2032, in __init__
    self.type = types.convert_type(type, default)
  File "/home/alex/.cache/pypoetry/virtualenvs/wrath-NjAFd-T0-py3.8/lib/python3.8/site-packages/click/types.py", line 1019, in convert_type
    return FuncParamType(ty)
  File "/home/alex/.cache/pypoetry/virtualenvs/wrath-NjAFd-T0-py3.8/lib/python3.8/site-packages/click/types.py", line 158, in __init__
    self.name = func.__name__
AttributeError: 'IntRange' object has no attribute '__name__'

Environment

  • Python version: 3.8.10
  • Click version: 8.0.3

A number of test fail with `E trio.TrioDeprecationWarning: trio.MultiError is deprecated since Trio 0.22.0; use BaseExceptionGroup (on Python 3.11 and later) or exceptiongroup.BaseExceptionGroup (earlier versions) instead (https://github.com/python-trio/trio/issues/2211)`

A number of test fail with E trio.TrioDeprecationWarning: trio.MultiError is deprecated since Trio 0.22.0; use BaseExceptionGroup (on Python 3.11 and later) or exceptiongroup.BaseExceptionGroup (earlier versions) instead (https://github.com/python-trio/trio/issues/2211)

[   20s] =========================== short test summary info ============================
[   20s] SKIPPED [16] tests/test_termui.py:329: Tests user-input using the msvcrt module.
[   20s] SKIPPED [3] tests/test_termui.py:339: Tests special character inputs using the msvcrt module.
[   20s] SKIPPED [2] tests/test_termui.py:354: Tests user-input using the msvcrt module.
[   20s] ============ 79 failed, 578 passed, 21 skipped, 1 xfailed in 6.12s =============
[   20s] _________________________ test_file_stdin_attrs[trio] __________________________
[   20s] /usr/lib/python3.8/site-packages/anyio/_core/_eventloop.py:153: in get_asynclib
[   20s]     return sys.modules[modulename]
[   20s] E   KeyError: 'anyio._backends._trio'
[   20s] 
[   20s] During handling of the above exception, another exception occurred:
[   20s] /usr/lib/python3.8/site-packages/anyio/pytest_plugin.py:118: in pytest_pyfunc_call
[   20s]     with get_runner(backend_name, backend_options) as runner:
[   20s] /usr/lib64/python3.8/contextlib.py:113: in __enter__
[   20s]     return next(self.gen)
[   20s] /usr/lib/python3.8/site-packages/anyio/pytest_plugin.py:37: in get_runner
[   20s]     asynclib = get_asynclib(backend_name)
[   20s] /usr/lib/python3.8/site-packages/anyio/_core/_eventloop.py:155: in get_asynclib
[   20s]     return import_module(modulename)
[   20s] /usr/lib64/python3.8/importlib/__init__.py:127: in import_module
[   20s]     return _bootstrap._gcd_import(name[level:], package, level)
[   20s] /usr/lib/python3.8/site-packages/anyio/_backends/_trio.py:164: in <module>
[   20s]     class ExceptionGroup(BaseExceptionGroup, trio.MultiError):
[   20s] /usr/lib/python3.8/site-packages/trio/_deprecate.py:120: in __getattr__
[   20s]     warn_deprecated(thing, info.version, issue=info.issue, instead=instead)
[   20s] /usr/lib/python3.8/site-packages/trio/_deprecate.py:51: in warn_deprecated
[   20s]     warnings.warn(TrioDeprecationWarning(msg), stacklevel=stacklevel)
[   20s] E   trio.TrioDeprecationWarning: trio.MultiError is deprecated since Trio 0.22.0; use BaseExceptionGroup (on Python 3.11 and later) or exceptiongroup.BaseExceptionGroup (earlier versions) instead (https://github.com/python-trio/trio/issues/2211)

This is on openSUSE Tumbleweed.

Environment:

  • Python version: 3.8.16
  • Click version: 8.1.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.