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

Assertion error when current_task() returns an instance of _asyncio.Task #840

Closed
2 tasks done
edgarrmondragon opened this issue Dec 12, 2024 · 16 comments · Fixed by #841
Closed
2 tasks done

Assertion error when current_task() returns an instance of _asyncio.Task #840

edgarrmondragon opened this issue Dec 12, 2024 · 16 comments · Fixed by #841
Labels
bug Something isn't working

Comments

@edgarrmondragon
Copy link

Things to check first

  • I have searched the existing issues and didn't find my bug already reported there

  • I have checked that my bug is still present in the latest release

AnyIO version

4.7.0

Python version

3.12.8

What happened?

It seems that sometimes when asyncio.current_task() is called in

task = current_task()

an instance of _asyncio.Task is returned. This then causes an assertion to be raised in

def __getitem__(self, key: Awaitable[Any] | asyncio.Task, /) -> TaskState:
assert isinstance(key, asyncio.Task)
try:
return self._task_states[key]
except KeyError:
if coro := key.get_coro():
if state := self._preliminary_task_states.get(coro):
return state
raise KeyError(key)

How can we reproduce the bug?

This is triggered in our test suite (fastapi, httpx, pytest-asyncio) after upgrading to anyio 4.7.0, but I haven't been able to come up with a MRE so hopefully this is enough to point maintainers to the potential fix.

@edgarrmondragon edgarrmondragon added the bug Something isn't working label Dec 12, 2024
@agronholm
Copy link
Owner

What is key in this case then, if not a Task?

@agronholm
Copy link
Owner

Can you at least post the traceback?

@edgarrmondragon
Copy link
Author

edgarrmondragon commented Dec 12, 2024

What is key in this case then, if not a Task?

An instance of _asyncio.Task.

Can you at least post the traceback?

Sure, sorry about not sharing them before Here you go

Traceback

tests/unit/api/test_oauth.py:141: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/httpx/_client.py:1814: in get
    return await self.request(
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/httpx/_client.py:1585: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/httpx/_client.py:1674: in send
    response = await self._send_handling_auth(
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/httpx/_client.py:1702: in _send_handling_auth
    response = await self._send_handling_redirects(
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/httpx/_client.py:1739: in _send_handling_redirects
    response = await self._send_single_request(request)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/httpx/_client.py:1776: in _send_single_request
    response = await transport.handle_async_request(request)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/httpx/_transports/asgi.py:157: in handle_async_request
    await self.app(scope, receive, send)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/fastapi/applications.py:1054: in __call__
    await super().__call__(scope, receive, send)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/starlette/applications.py:113: in __call__
    await self.middleware_stack(scope, receive, send)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/starlette/middleware/errors.py:187: in __call__
    raise exc
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/starlette/middleware/errors.py:165: in __call__
    await self.app(scope, receive, _send)
src/project/app.py:102: in __call__
    await self.app(scope, receive, send)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/starlette/middleware/sessions.py:85: in __call__
    await self.app(scope, receive, send_wrapper)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/starlette/middleware/cors.py:85: in __call__
    await self.app(scope, receive, send)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/opentelemetry/instrumentation/asgi/__init__.py:743: in __call__
    await self.app(scope, otel_receive, otel_send)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/starlette/middleware/exceptions.py:62: in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/starlette/routing.py:715: in __call__
    await self.middleware_stack(scope, receive, send)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/starlette/routing.py:735: in app
    await route.handle(scope, receive, send)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/starlette/routing.py:288: in handle
    await self.app(scope, receive, send)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/starlette/routing.py:76: in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/starlette/routing.py:73: in app
    response = await f(request)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/fastapi/routing.py:291: in app
    solved_result = await solve_dependencies(
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/logfire/_internal/integrations/fastapi.py:123: in patched_solve_dependencies
    return await instrumentation.solve_dependencies(request, original)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/logfire/_internal/integrations/fastapi.py:182: in solve_dependencies
    result: Any = await original
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/fastapi/dependencies/utils.py:640: in solve_dependencies
    solved = await run_in_threadpool(call, **solved_result.values)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/starlette/concurrency.py:39: in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/anyio/to_thread.py:56: in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2469: in run_sync_in_worker_thread
    async with limiter or cls.current_default_thread_limiter():
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:1982: in __aenter__
    await self.acquire()
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2036: in acquire
    return await self.acquire_on_behalf_of(current_task())
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2039: in acquire_on_behalf_of
    await AsyncIOBackend.checkpoint_if_cancelled()
../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2372: in checkpoint_if_cancelled
    cancel_scope = _task_states[task].cancel_scope
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <anyio._backends._asyncio.TaskStateStore object at 0x7f826b0b9460>
key = <Task finished name='Task-47' coro=<test_google_callback() done, defined at /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/unittest/mock.py:1407> exception=AssertionError("assert False\n +  where False = isinstance(<Task pending name='Task-47' coro=<test_google_callback() running at /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/unittest/mock.py:1412> cb=[_run_until_complete_cb() at /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/asyncio/base_events.py:182]>, <class 'asyncio.tasks.Task'>)\n +    where <class 'asyncio.tasks.Task'> = asyncio.Task")>

    def __getitem__(self, key: Awaitable[Any] | asyncio.Task, /) -> TaskState:
>       assert isinstance(key, asyncio.Task)
E       AssertionError: assert False
E        +  where False = isinstance(<Task pending name='Task-47' coro=<test_google_callback() running at /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/unittest/mock.py:1412> cb=[_run_until_complete_cb() at /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/asyncio/base_events.py:182]>, <class 'asyncio.tasks.Task'>)
E        +    where <class 'asyncio.tasks.Task'> = asyncio.Task

../../../.cache/pypoetry/virtualenvs/project-py3.12/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:686: AssertionError

@agronholm
Copy link
Owner

So how does that make any sense? It's checking if key is an asyncio task, and it is. What am I missing here? Why is this error triggered there?

@agronholm
Copy link
Owner

Are you using a custom task factory or something?

@edgarrmondragon
Copy link
Author

So how does that make any sense? It's checking if key is an asyncio task, and it is. What am I missing here? Why is this error triggered there?

It's an instance of _asyncio.Task (notice the leading _ in the module name) instead of asyncio.Task. In case it helps, here's how I confirm that:

(Pdb) key
<Task finished name='Task-47' coro=<test_google_callback() done, defined at /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/unittest/mock.py:1408> exception=AssertionError("assert False\n +  where False = isinstance(<Task pending name='Task-47' coro=<test_google_callback() running at /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/unittest/mock.py:1413> cb=[_run_until_complete_cb() at /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py:181]>, <class 'asyncio.tasks.Task'>)\n +    where <class 'asyncio.tasks.Task'> = asyncio.Task")>
(Pdb) type(key)
<class '_asyncio.Task'>

Are you using a custom task factory or something?

We are using something like

def async_to_sync(
    func: Callable[_P, Coroutine[Any, Any, _R]],
) -> Callable[_P, _R]:
    """Decorator to convert an async function to a sync function using `asyncio.run`."""

    @wraps(func)
    def _decorator(*args: _P.args, **kwargs: _P.kwargs) -> _R:
        loop = asyncio.get_event_loop()
        nest_asyncio.apply(loop)
        return loop.run_until_complete(func(*args, **kwargs))

    return _decorator


class ItemGetter:
    @async_to_sync
    async def __getitem__(self, key: str):
        return ...

and then an instance of ItemGetter as a fixture, but I still can't find a MRE. The workaround on our end seems to be getting rid of that and instead just do

class ItemGetter:
    async def get(self, key: str):
        return ...


@pytest.mark.asyncio()
async def test_example(getter):
    item = getter.get(...)

@agronholm
Copy link
Owner

's an instance of _asyncio.Task (notice the leading _ in the module name) instead of asyncio.Task. In case it helps, here's how I confirm that:

Yes, that is the type of all asyncio tasks:

>>> from asyncio import run, current_task
>>> async def foo():
...     task = current_task()
...     print(type(task))
...     
>>> run(foo())
<class '_asyncio.Task'>

@agronholm
Copy link
Owner

Wait, is key a Mock instance and not a task?

@agronholm
Copy link
Owner

No, probably not. At any rate, you need to either come up with a MWE or figure out why the assert fails.

@graingert
Copy link
Collaborator

graingert commented Dec 13, 2024

Did you run nest-asyncio or something similar that replaced asyncio.Task with PyTask?

I think the assertion should be less strict and support anything hashable with a get_coro method

@chbndrhnns
Copy link

chbndrhnns commented Dec 13, 2024

I saw this issue yesterday while using the PyCharm, anyio 4.7.0.
Only in the debugger in 2024.3.1 RC 2 and only with low impact monitoring api enabled.

I posted this to the PyCharm tracker first.

However, I cannot replicate today. Strange.

Here is the snippet:

from pathlib import Path

import anyio
import uvicorn
from starlette.applications import Starlette
from starlette.responses import PlainTextResponse
from starlette.routing import Route

f = (Path(__file__).parent / "tmp")
f.write_text("hello")


async def read(file):
    async with await anyio.open_file(file) as f:
        content = await f.read()

    return content


async def homepage(request):
    res = await read(f)
    # set breakpoint on return statement
    return PlainTextResponse(f'{res}, world!')


if __name__ == '__main__':
    routes = [
        Route('/', homepage),
    ]
    app = Starlette(routes=routes)
    uvicorn.run(app, port=8080)

@s3rius
Copy link

s3rius commented Dec 13, 2024

We also found related issue in our project. Here it is: taskiq-python/taskiq#387

As people claim, it only happens on 4.7.0.

I could narrow down the MRE to this code:

import asyncio
import nest_asyncio
import anyio


async def test_func():
    await asyncio.sleep(1)


async def main():
    nest_asyncio.apply()
    async with anyio.create_task_group() as tg:
        tg.start_soon(test_func)


if __name__ == "__main__":
    asyncio.run(main())

Here is the setup:

Python 3.12.7

anyio==4.7.0
nest-asyncio==1.6.0

I tried running this code on anyio==4.6.2 and it worked out.

@agronholm
Copy link
Owner

I figured out what's happening here. It seems that nest_asyncio.apply() replaces the asyncio modules in sys.modules with its own implementations, but not before they've already been imported by AnyIO. That's why the isinstance checks fail even though the MRO looks identical to real asyncio. I could confirm this by moving nest_asyncio.apply() to the module level:

import asyncio
import nest_asyncio
import anyio


async def test_func():
    await asyncio.sleep(1)


async def main():
    async with anyio.create_task_group() as tg:
        tg.start_soon(test_func)


if __name__ == "__main__":
    nest_asyncio.apply()
    asyncio.run(main())

The above snippet works fine.

@agronholm
Copy link
Owner

By the way, may I ask what you're using nest_asyncio for?

agronholm added a commit that referenced this issue Dec 15, 2024
This stems from the incorrect placement of `nest_asyncio.apply()`, as it should be called before `asyncio.run()`.

Fixes #840.
@chbndrhnns
Copy link

For me, it seems to be part of the PyCharm debugger, and it’s used to be able to run coroutines in the debug console.

@agronholm
Copy link
Owner

Would you mind verifying that the linked PR works for you?

sigridjineth added a commit to sigridjineth/anyio that referenced this issue Dec 17, 2024
…ecks

Expects to fix agronholm#840

This commit removes the strict `isinstance(key, asyncio.Task)` checks in the
TaskStateStore implementation and replaces them with a more flexible
approach based on the presence of `get_coro()` and `asyncio.iscoroutine()`.

By doing so, we eliminate AssertionErrors that arise when alternative task
implementations (e.g., due to `nest_asyncio`, custom factories, or debugger
wrappers) return objects that are not instances of `asyncio.Task` but still
behave like them. This change significantly improves compatibility with
monkey-patched environments and non-standard asyncio task implementations.
mkjpryor pushed a commit to azimuth-cloud/azimuth that referenced this issue Jan 7, 2025
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps [anyio](https://github.com/agronholm/anyio) from 4.7.0 to 4.8.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/agronholm/anyio/releases">anyio's
releases</a>.</em></p>
<blockquote>
<h2>4.8.0</h2>
<ul>
<li>Added <strong>experimental</strong> support for running functions in
subinterpreters on Python 3.13 and later</li>
<li>Added support for the <code>copy()</code>, <code>copy_into()</code>,
<code>move()</code> and <code>move_into()</code> methods in
<code>anyio.Path</code>, available in Python 3.14</li>
<li>Changed <code>TaskGroup</code> on asyncio to always spawn tasks
non-eagerly, even if using a task factory created via
<code>asyncio.create_eager_task_factory()</code>, to preserve expected
Trio-like task scheduling semantics (PR by <a
href="https://github.com/agronholm"><code>@​agronholm</code></a> and <a
href="https://github.com/graingert"><code>@​graingert</code></a>)</li>
<li>Configure <code>SO_RCVBUF</code>, <code>SO_SNDBUF</code> and
<code>TCP_NODELAY</code> on the selector thread waker socket pair (this
should improve the performance of <code>wait_readable()</code> and
<code>wait_writable()</code> when using the
<code>ProactorEventLoop</code>) (<a
href="https://redirect.github.com/agronholm/anyio/pull/836">#836</a>; PR
by <a
href="https://github.com/graingert"><code>@​graingert</code></a>)</li>
<li>Fixed <code>AssertionError</code> when using
<code>nest-asyncio</code> (<a
href="https://redirect.github.com/agronholm/anyio/issues/840">#840</a>)</li>
<li>Fixed return type annotation of various context managers'
<code>__exit__</code> method (<a
href="https://redirect.github.com/agronholm/anyio/issues/847">#847</a>;
PR by <a href="https://github.com/Enegg"><code>@​Enegg</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/agronholm/anyio/blob/master/docs/versionhistory.rst">anyio's
changelog</a>.</em></p>
<blockquote>
<h1>Version history</h1>
<p>This library adheres to <code>Semantic Versioning 2.0
&lt;http://semver.org/&gt;</code>_.</p>
<p><strong>4.8.0</strong></p>
<ul>
<li>Added <strong>experimental</strong> support for running functions in
subinterpreters on Python
3.13 and later</li>
<li>Added support for the <code>copy()</code>, <code>copy_into()</code>,
<code>move()</code> and <code>move_into()</code>
methods in <code>anyio.Path</code>, available in Python 3.14</li>
<li>Changed <code>TaskGroup</code> on asyncio to always spawn tasks
non-eagerly, even if using a
task factory created via
<code>asyncio.create_eager_task_factory()</code>, to preserve expected
Trio-like task scheduling semantics (PR by <a
href="https://github.com/agronholm"><code>@​agronholm</code></a> and <a
href="https://github.com/graingert"><code>@​graingert</code></a>)</li>
<li>Configure <code>SO_RCVBUF</code>, <code>SO_SNDBUF</code> and
<code>TCP_NODELAY</code> on the selector
thread waker socket pair (this should improve the performance of
<code>wait_readable()</code>)
and <code>wait_writable()</code> when using the
<code>ProactorEventLoop</code>
(<code>[#836](agronholm/anyio#836)
&lt;https://github.com/agronholm/anyio/pull/836&gt;</code>_; PR by <a
href="https://github.com/graingert"><code>@​graingert</code></a>)</li>
<li>Fixed <code>AssertionError</code> when using
<code>nest-asyncio</code>
(<code>[#840](agronholm/anyio#840)
&lt;https://github.com/agronholm/anyio/issues/840&gt;</code>_)</li>
<li>Fixed return type annotation of various context managers'
<code>__exit__</code> method
(<code>[#847](agronholm/anyio#847)
&lt;https://github.com/agronholm/anyio/issues/847&gt;</code>_; PR by <a
href="https://github.com/Enegg"><code>@​Enegg</code></a>)</li>
</ul>
<p><strong>4.7.0</strong></p>
<ul>
<li>Updated <code>TaskGroup</code> to work with asyncio's eager task
factories
(<code>[#764](agronholm/anyio#764)
&lt;https://github.com/agronholm/anyio/issues/764&gt;</code>_)</li>
<li>Added the <code>wait_readable()</code> and
<code>wait_writable()</code> functions which will accept
an object with a <code>.fileno()</code> method or an integer handle, and
deprecated
their now obsolete versions (<code>wait_socket_readable()</code> and
<code>wait_socket_writable()</code>) (PR by <a
href="https://github.com/davidbrochart"><code>@​davidbrochart</code></a>)</li>
<li>Changed <code>EventAdapter</code> (an <code>Event</code> with no
bound async backend) to allow <code>set()</code>
to work even before an async backend is bound to it
(<code>[#819](agronholm/anyio#819)
&lt;https://github.com/agronholm/anyio/issues/819&gt;</code>_)</li>
<li>Added support for <code>wait_readable()</code> and
<code>wait_writable()</code> on <code>ProactorEventLoop</code>
(used on asyncio + Windows by default)</li>
<li>Fixed a misleading <code>ValueError</code> in the context of DNS
failures
(<code>[#815](agronholm/anyio#815)
&lt;https://github.com/agronholm/anyio/issues/815&gt;</code>_; PR by <a
href="https://github.com/graingert"><code>@​graingert</code></a>)</li>
<li>Fixed the return type annotations of <code>readinto()</code> and
<code>readinto1()</code> methods in the
<code>anyio.AsyncFile</code> class
(<code>[#825](agronholm/anyio#825)
&lt;https://github.com/agronholm/anyio/issues/825&gt;</code>_)</li>
<li>Fixed <code>TaskInfo.has_pending_cancellation()</code> on asyncio
returning false positives in
cleanup code on Python &gt;= 3.11
(<code>[#832](agronholm/anyio#832)
&lt;https://github.com/agronholm/anyio/issues/832&gt;</code>_; PR by <a
href="https://github.com/gschaffner"><code>@​gschaffner</code></a>)</li>
<li>Fixed cancelled cancel scopes on asyncio calling
<code>asyncio.Task.uncancel</code> when
propagating a <code>CancelledError</code> on exit to a cancelled parent
scope
(<code>[#790](agronholm/anyio#790)
&lt;https://github.com/agronholm/anyio/pull/790&gt;</code>_; PR by <a
href="https://github.com/gschaffner"><code>@​gschaffner</code></a>)</li>
</ul>
<p><strong>4.6.2</strong></p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/agronholm/anyio/commit/74022ec53cde6c2e5d7441de37d5a0dcf9d6daad"><code>74022ec</code></a>
Bumped up the version</li>
<li><a
href="https://github.com/agronholm/anyio/commit/264a6f9f911ebd5a6b7d9d79dfa4bf91ac5d8ceb"><code>264a6f9</code></a>
Added support for subinterpreter workers (<a
href="https://redirect.github.com/agronholm/anyio/issues/850">#850</a>)</li>
<li><a
href="https://github.com/agronholm/anyio/commit/6d612a9fbd037352507209543bc8dde6462f62d6"><code>6d612a9</code></a>
Refactored waiting for tasks to complete from task group on the asyncio
backe...</li>
<li><a
href="https://github.com/agronholm/anyio/commit/8b7a5352aec2c0cdd2f9a991da601f2f5b22cf8b"><code>8b7a535</code></a>
Removed the unwarranted gc_collect fixture</li>
<li><a
href="https://github.com/agronholm/anyio/commit/acdac7abf59761a77e17738abfabbda9dea68ad7"><code>acdac7a</code></a>
Changed TaskGroup to always spawn tasks lazily, even with eager task
factorie...</li>
<li><a
href="https://github.com/agronholm/anyio/commit/43e1f5fd133b2f53993d606af207b06a0d09fecc"><code>43e1f5f</code></a>
Fixed <code>__exit__()</code> return type of various context managers
(<a
href="https://redirect.github.com/agronholm/anyio/issues/849">#849</a>)</li>
<li><a
href="https://github.com/agronholm/anyio/commit/e8730ae116aa924b0386fef15dcb3a7c15490283"><code>e8730ae</code></a>
Added preliminary support for Python 3.14 (<a
href="https://redirect.github.com/agronholm/anyio/issues/813">#813</a>)</li>
<li><a
href="https://github.com/agronholm/anyio/commit/9a792f3568f450ad97363d7bf0baa04f768ae291"><code>9a792f3</code></a>
Pruned unnecessary mypy options</li>
<li><a
href="https://github.com/agronholm/anyio/commit/2a105b2bc6ebb4d12b67b4c9c1777ff5cc54f42b"><code>2a105b2</code></a>
Updated downstream test workflow</li>
<li><a
href="https://github.com/agronholm/anyio/commit/3f8c639d36d0ac01d341b25f6f99f1bc7aff6d12"><code>3f8c639</code></a>
[pre-commit.ci] pre-commit autoupdate (<a
href="https://redirect.github.com/agronholm/anyio/issues/846">#846</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/agronholm/anyio/compare/4.7.0...4.8.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=anyio&package-manager=pip&previous-version=4.7.0&new-version=4.8.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
5 participants