Skip to content

Commit bf12a80

Browse files
committed
update docs/newsfragments/docstrings
1 parent 02ac588 commit bf12a80

File tree

6 files changed

+9
-3
lines changed

6 files changed

+9
-3
lines changed

docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ def setup(app: Sphinx) -> None:
229229
"pyopenssl": ("https://www.pyopenssl.org/en/stable/", None),
230230
"sniffio": ("https://sniffio.readthedocs.io/en/latest/", None),
231231
"trio-util": ("https://trio-util.readthedocs.io/en/latest/", None),
232+
"flake8-async": ("https://flake8-async.readthedocs.io/en/latest/", None),
232233
}
233234

234235
# See https://sphinx-hoverxref.readthedocs.io/en/latest/configuration.html

docs/source/reference-core.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,12 @@ objects.
527527

528528
.. autoattribute:: deadline
529529

530+
.. autoattribute:: relative_deadline
531+
530532
.. autoattribute:: shield
531533

534+
.. automethod:: is_relative()
535+
532536
.. automethod:: cancel()
533537

534538
.. attribute:: cancelled_caught

newsfragments/2512.breaking.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
: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() + ...)``.
2+
flake8-async has a new rule to catch this, in case you're supporting older trio versions. See :ref:`ASYNC121` (TODO: except it will be ASYNC122, I'm just making sure intersphinx work)

newsfragments/2512.deprecated.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/2512.feature.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
:func:`trio.move_on_after` and :func:`trio.fail_after` now allows setting the deadline to be relative to entering the context manager. This will be the default in the future, and to opt into the new behaviour you can pass ``timeout_from_enter=True``. This does not matter in the vast majority of cases where initialization and entering of the context manager is in the same place, and those cases will not raise any :class:`DeprecationWarning`. For more information see :ref:`saved_relative_timeouts`.
1+
: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.

src/trio/_timeouts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def move_on_after(
4444
of the newly created cancel scope.
4545
4646
Raises:
47-
ValueError: if `seconds` is less than zero or NaN.
47+
ValueError: if ``seconds`` is less than zero or NaN.
4848
4949
"""
5050
# duplicate validation logic to have the correct parameter name

0 commit comments

Comments
 (0)