anyio 4.11.0

4.11.0
Added 4
  • Support for cancellation reasons through the `reason` parameter to `CancelScope.cancel()`
  • Ability to enter the event loop from foreign threads by passing the return value of `anyio.lowlevel.current_token()` to `anyio.from_thread.run()` and `anyio.from_thread.run_sync()` as the `token` keyword argument
  • Pytest option `anyio_mode = "auto"` to make the pytest plugin automatically handle all async tests
  • The `anyio.Condition.wait_for()` method for feature parity with asyncio
Changed 2
  • Minimum version of Trio bumped to v0.31.0
  • Default type argument of `anyio.abc.TaskStatus` changed from `Any` to `None`
Fixed 2
  • TCP listener behavior to guarantee the same ephemeral port is used for all socket listeners when `local_port=0`
  • Inconsistency between Trio and asyncio where a closed TCP stream now raises `ClosedResourceError` instead of `BrokenResourceError` on both backends
  • Added support for cancellation reasons (the reason parameter to CancelScope.cancel()) (#975)
  • Bumped the minimum version of Trio to v0.31.0
  • Added the ability to enter the event loop from foreign (non-worker) threads by passing the return value of anyio.lowlevel.current_token() to anyio.from_thread.run() and anyio.from_thread.run_sync() as the token keyword argument (#256)
  • Added pytest option (anyio_mode = "auto") to make the pytest plugin automatically handle all async tests (#971)
  • Added the anyio.Condition.wait_for() method for feature parity with asyncio (#974)
  • Changed the default type argument of anyio.abc.TaskStatus from Any to None (#964)
  • Fixed TCP listener behavior to guarantee the same ephemeral port is used for all socket listeners when local_port=0 (#857; PR by @11kkw and @agronholm)
  • Fixed inconsistency between Trio and asyncio where a TCP stream that previously raised a BrokenResourceError on send() would still raise BrokenResourceError after the stream was closed on asyncio, but ClosedResourceError on Trio. They now both raise a ClosedResourceError in this scenario. (#671)
View original

Upgraded? How did it go?

Discussion