Update dependency asgiref to v3.12.1 #11

Open
bot.renovate wants to merge 1 commit from renovate/asgiref-3.x into main
Collaborator

This PR contains the following updates:

Package Update Change
asgiref (changelog) minor ==3.11.1==3.12.1

Release Notes

django/asgiref (asgiref)

v3.12.1

Compare Source

  • Restored the previous SyncToAsync.call internal code shape, which was
    relied on by some APM services. (#​572)

    Note, this change was available whilst maintaining the underlying fix (from
    #​564). It does not constitute an API stability promise. Ideally APMs are
    not monkey patching internal APIs, and future changes will be made here if
    needed.

v3.12.0

Compare Source

  • AsyncToSync no longer captures the running event loop on
    instantiation. (#​562)

    This resolves a series of deadlocks that users experienced after asgiref 3.9.0,
    particularly with pytest-asyncio. pytest-asyncio stops the event loop between
    tests, and long-running unawaited futures could find themselves trying to
    schedule work onto a stopped loop, and so would never complete. Ideally, code
    should be structured to await long-running futures before returning, but this
    change should help users experiencing issues here.

    The loop is now resolved when the callable is invoked rather than when it is
    created. If async_to_sync is called from within sync_to_async, the
    parent event loop is still used, as before.

    The possibility of deadlock therefore remains in some nested patterns. For
    example, an async function may call a long-running sync_to_async function
    that itself uses async_to_sync; if the outer function returns before the
    sync future completes, the parent event loop may already be stopped, and the
    nested calls cannot be driven to completion.

    This is not a bug in asgiref — the same patterns deadlock in plain asyncio. As
    above, restructure your code to await the sync_to_async future before
    exiting the driving coroutine.

  • Fixed an event loop deadlock when exiting ThreadSensitiveContext
    while its executor thread was still blocked waiting on the event loop.
    (#​535)

  • Dropped support for EOL Python 3.9.

  • Fixed StatelessServer.run() failing on Python 3.14, where
    asyncio.get_event_loop() no longer creates an event loop if none
    exists. It now uses asyncio.run(). (#​559)

  • Fixed Local leaking data between unrelated sync threads when
    sys.flags.thread_inherit_context is enabled (Python 3.14+), so a newly
    started thread inherits a copy of the spawning thread's context. This flag is
    on by default on free-threaded builds and opt-in on the regular GIL build.
    Local storage is now tagged with its owning thread and re-homed only when
    asgiref intentionally moves work across threads (in async_to_sync /
    sync_to_async), restoring the documented thread-local behaviour in sync
    threads.

  • asgiref is now tested against the free-threaded builds of Python 3.13 and
    3.14 in CI.

  • The tests extra no longer installs mypy; a new mypy extra is
    available for type-checking the codebase.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate.

This PR contains the following updates: | Package | Update | Change | |---|---|---| | [asgiref](https://github.com/django/asgiref) ([changelog](https://github.com/django/asgiref/blob/master/CHANGELOG.txt)) | minor | `==3.11.1` → `==3.12.1` | --- ### Release Notes <details> <summary>django/asgiref (asgiref)</summary> ### [`v3.12.1`](https://github.com/django/asgiref/blob/HEAD/CHANGELOG.txt#3121-2026-07-14) [Compare Source](https://github.com/django/asgiref/compare/3.12.0...3.12.1) - Restored the previous SyncToAsync.**call** internal code shape, which was relied on by some APM services. ([#&#8203;572](https://github.com/django/asgiref/issues/572)) Note, this change was available whilst maintaining the underlying fix (from [#&#8203;564](https://github.com/django/asgiref/issues/564)). It does not constitute an API stability promise. Ideally APMs are *not* monkey patching internal APIs, and future changes will be made here if needed. ### [`v3.12.0`](https://github.com/django/asgiref/blob/HEAD/CHANGELOG.txt#3120-2026-07-14) [Compare Source](https://github.com/django/asgiref/compare/3.11.1...3.12.0) - `AsyncToSync` no longer captures the running event loop on instantiation. ([#&#8203;562](https://github.com/django/asgiref/issues/562)) This resolves a series of deadlocks that users experienced after asgiref 3.9.0, particularly with pytest-asyncio. pytest-asyncio stops the event loop between tests, and long-running unawaited futures could find themselves trying to schedule work onto a stopped loop, and so would never complete. Ideally, code should be structured to await long-running futures before returning, but this change should help users experiencing issues here. The loop is now resolved when the callable is invoked rather than when it is created. If `async_to_sync` is called from within `sync_to_async`, the parent event loop is still used, as before. The possibility of deadlock therefore remains in some nested patterns. For example, an async function may call a long-running `sync_to_async` function that itself uses `async_to_sync`; if the outer function returns before the sync future completes, the parent event loop may already be stopped, and the nested calls cannot be driven to completion. This is not a bug in asgiref — the same patterns deadlock in plain asyncio. As above, restructure your code to await the `sync_to_async` future before exiting the driving coroutine. - Fixed an event loop deadlock when exiting `ThreadSensitiveContext` while its executor thread was still blocked waiting on the event loop. ([#&#8203;535](https://github.com/django/asgiref/issues/535)) - Dropped support for EOL Python 3.9. - Fixed `StatelessServer.run()` failing on Python 3.14, where `asyncio.get_event_loop()` no longer creates an event loop if none exists. It now uses `asyncio.run()`. ([#&#8203;559](https://github.com/django/asgiref/issues/559)) - Fixed `Local` leaking data between unrelated sync threads when `sys.flags.thread_inherit_context` is enabled (Python 3.14+), so a newly started thread inherits a copy of the spawning thread's context. This flag is on by default on free-threaded builds and opt-in on the regular GIL build. `Local` storage is now tagged with its owning thread and re-homed only when asgiref intentionally moves work across threads (in `async_to_sync` / `sync_to_async`), restoring the documented thread-local behaviour in sync threads. - asgiref is now tested against the free-threaded builds of Python 3.13 and 3.14 in CI. - The `tests` extra no longer installs `mypy`; a new `mypy` extra is available for type-checking the codebase. </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNjEuNCIsInVwZGF0ZWRJblZlciI6IjQzLjI2MS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin renovate/asgiref-3.x:renovate/asgiref-3.x
git switch renovate/asgiref-3.x

Merge

Merge the changes and update on Forgejo.
git switch main
git merge --no-ff renovate/asgiref-3.x
git switch renovate/asgiref-3.x
git rebase main
git switch main
git merge --ff-only renovate/asgiref-3.x
git switch renovate/asgiref-3.x
git rebase main
git switch main
git merge --no-ff renovate/asgiref-3.x
git switch main
git merge --squash renovate/asgiref-3.x
git switch main
git merge --ff-only renovate/asgiref-3.x
git switch main
git merge renovate/asgiref-3.x
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
django/django-project!11
No description provided.