Skip to content

Commit

Permalink
Bump version to 0.27.0
Browse files Browse the repository at this point in the history
  • Loading branch information
A5rocks committed Oct 16, 2024
1 parent 2a66a0d commit 11a7fc6
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 31 deletions.
33 changes: 33 additions & 0 deletions docs/source/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,39 @@ Release history

.. towncrier release notes start
Trio 0.27.0 (2024-10-17)
------------------------

Breaking changes
~~~~~~~~~~~~~~~~

- :func:`trio.move_on_after` and :func:`trio.fail_after` previously set the deadline relative to initialization time, instead of more intuitively upon entering the context manager. This might change timeouts if a program relied on this behavior. If you want to restore previous behavior you should instead use ``trio.move_on_at(trio.current_time() + ...)``.
flake8-async has a new rule to catch this, in case you're supporting older trio versions. See :ref:`ASYNC122`. (`#2512 <https://github.com/python-trio/trio/issues/2512>`__)


Features
~~~~~~~~

- :meth:`CancelScope.relative_deadline` and :meth:`CancelScope.is_relative` added, as well as a ``relative_deadline`` parameter to ``__init__``. This allows initializing scopes ahead of time, but where the specified relative deadline doesn't count down until the scope is entered. (`#2512 <https://github.com/python-trio/trio/issues/2512>`__)
- :class:`trio.Lock` and :class:`trio.StrictFIFOLock` will now raise :exc:`trio.BrokenResourceError` when :meth:`trio.Lock.acquire` would previously stall due to the owner of the lock exiting without releasing the lock. (`#3035 <https://github.com/python-trio/trio/issues/3035>`__)
- `trio.move_on_at`, `trio.move_on_after`, `trio.fail_at` and `trio.fail_after` now accept *shield* as a keyword argument. If specified, it provides an initial value for the `~trio.CancelScope.shield` attribute of the `trio.CancelScope` object created by the context manager. (`#3052 <https://github.com/python-trio/trio/issues/3052>`__)
- Added :func:`trio.lowlevel.add_parking_lot_breaker` and :func:`trio.lowlevel.remove_parking_lot_breaker` to allow creating custom lock/semaphore implementations that will break their underlying parking lot if a task exits unexpectedly. :meth:`trio.lowlevel.ParkingLot.break_lot` is also added, to allow breaking a parking lot intentionally. (`#3081 <https://github.com/python-trio/trio/issues/3081>`__)


Bugfixes
~~~~~~~~

- Allow sockets to bind any ``os.PathLike`` object. (`#3041 <https://github.com/python-trio/trio/issues/3041>`__)
- Update ``trio.lowlevel.open_process``'s documentation to allow bytes. (`#3076 <https://github.com/python-trio/trio/issues/3076>`__)
- Update :func:`trio.sleep_forever` to be `NoReturn`. (`#3095 <https://github.com/python-trio/trio/issues/3095>`__)


Improved documentation
~~~~~~~~~~~~~~~~~~~~~~

- Add docstrings for memory channels' ``statistics()`` and ``aclose`` methods. (`#3101 <https://github.com/python-trio/trio/issues/3101>`__)


Trio 0.26.2 (2024-08-08)
------------------------

Expand Down
2 changes: 0 additions & 2 deletions newsfragments/2512.breaking.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/2512.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/3035.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/3041.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/3052.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/3076.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/3081.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/3095.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/3101.doc.rst

This file was deleted.

9 changes: 0 additions & 9 deletions src/trio/_tests/test_testing_raisesgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,3 @@ def test__ExceptionInfo(monkeypatch: pytest.MonkeyPatch) -> None:
assert excinfo.type is ExceptionGroup
assert excinfo.value.exceptions[0].args == ("hello",)
assert isinstance(excinfo.tb, TracebackType)


def test_deprecated_strict() -> None:
"""`strict` has been replaced with `flatten_subgroups`"""
# parameter is not included in overloaded signatures at all
with pytest.deprecated_call():
RaisesGroup(ValueError, strict=False) # type: ignore[call-overload]
with pytest.deprecated_call():
RaisesGroup(ValueError, strict=True) # type: ignore[call-overload]
2 changes: 1 addition & 1 deletion src/trio/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# This file is imported from __init__.py and parsed by setuptools

__version__ = "0.26.2+dev"
__version__ = "0.27.0"
11 changes: 0 additions & 11 deletions src/trio/testing/_raises_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
overload,
)

from trio._deprecate import warn_deprecated
from trio._util import final

if TYPE_CHECKING:
Expand Down Expand Up @@ -384,7 +383,6 @@ def __init__(
flatten_subgroups: bool = False,
match: str | Pattern[str] | None = None,
check: Callable[[BaseExceptionGroup[E]], bool] | None = None,
strict: None = None,
):
self.expected_exceptions: tuple[type[E] | Matcher[E] | E, ...] = (
exception,
Expand All @@ -396,15 +394,6 @@ def __init__(
self.check = check
self.is_baseexceptiongroup = False

if strict is not None:
warn_deprecated(
"The `strict` parameter",
"0.25.1",
issue=2989,
instead="flatten_subgroups=True (for strict=False}",
)
self.flatten_subgroups = not strict

if allow_unwrapped and other_exceptions:
raise ValueError(
"You cannot specify multiple exceptions with `allow_unwrapped=True.`"
Expand Down

0 comments on commit 11a7fc6

Please sign in to comment.