-
-
Notifications
You must be signed in to change notification settings - Fork 358
Change fail_after
&move_on_after
to set deadline relative to entering. Add CancelScope.relative_deadline
#3010
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
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
dea2e79
flake8-trio has been renamed
jakkdl d6e91cc
Add explicit documentation on timeout semantic for fail&move_on_after
jakkdl dc3bd3d
Merge branch 'master' into fail_after_documentation
jakkdl da25949
use a5rocks alternate phrasing for move_on_after
jakkdl 7a8262a
add `relative_deadline` attribute to CancelScope. `move_on_after` and…
jakkdl d028037
Merge branch 'master' into fail_after_documentation
jakkdl 5447f45
fix codecov, mypy now fails to unify return types across the timeouts…
jakkdl 1381560
instead of a breaking change we now raise deprecationwarning and give…
jakkdl 742c013
don't inherit from AbstractContextManager since that breaks 3.8, and …
jakkdl 0075b56
fix RTD build. Replace star import with explicit list. Remove useless…
jakkdl 9d3d0b9
reimplement as transforming class
jakkdl b29db0d
Merge branch 'master' into fail_after_documentation
jakkdl 480681d
whoops, forgot to actually enter the cancelscope
jakkdl 00ba1ca
Merge remote-tracking branch 'origin/main' into fail_after_documentation
jakkdl 510aaa1
remove unneeded type:ignore with mypy 1.11
jakkdl 7079d71
Merge branch 'main' into fail_after_documentation
jakkdl 3474128
write docs, update newsfragments to match current implementation
jakkdl df5876d
add transitional functions
jakkdl a240948
fix test
jakkdl 0183b43
fix tests/codecov
jakkdl ca63354
fix test
jakkdl 7591297
Merge remote-tracking branch 'origin/main' into repro_pyright_verifyt…
jakkdl 75fc52b
quick re-implementation after new spec. Docs/docstrings have not had …
jakkdl 5a32eb0
clean up return type of fail_at/_after for sphinx
jakkdl c2a3d8e
remove _is_relative, and calculate it on the fly instead. Add nan han…
jakkdl f8e9417
change some RuntimeError to DeprecationWarning, fix tests/coverage
jakkdl 36786a6
pragma: no cover
jakkdl 8e863b8
Merge remote-tracking branch 'origin/main' into fail_after_documentation
jakkdl 6a7650d
duplicate validation logic, bump pyright
jakkdl 02ac588
Merge remote-tracking branch 'origin/main' into fail_after_documentation
jakkdl bf12a80
update docs/newsfragments/docstrings
jakkdl 9961abc
properly link to ASYNC122
jakkdl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
: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`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.