From e5e17efe2066fde366b31872d876cc9b7e4a0581 Mon Sep 17 00:00:00 2001 From: A5rocks Date: Thu, 26 Dec 2024 01:46:33 +0900 Subject: [PATCH 1/2] Bump version to 0.28.0 --- docs/source/history.rst | 65 ++++++++++++++++++++++++++++++++++ newsfragments/2670.bugfix.rst | 2 -- newsfragments/3087.doc.rst | 1 - newsfragments/3094.misc.rst | 1 - newsfragments/3097.removal.rst | 1 - newsfragments/3106.removal.rst | 1 - newsfragments/3108.bugfix.rst | 26 -------------- newsfragments/3112.bugfix.rst | 5 --- newsfragments/3113.doc.rst | 1 - newsfragments/3114.bugfix.rst | 1 - newsfragments/3121.misc.rst | 1 - newsfragments/3141.bugfix.rst | 1 - newsfragments/3159.misc.rst | 1 - src/trio/_version.py | 2 +- 14 files changed, 66 insertions(+), 43 deletions(-) delete mode 100644 newsfragments/2670.bugfix.rst delete mode 100644 newsfragments/3087.doc.rst delete mode 100644 newsfragments/3094.misc.rst delete mode 100644 newsfragments/3097.removal.rst delete mode 100644 newsfragments/3106.removal.rst delete mode 100644 newsfragments/3108.bugfix.rst delete mode 100644 newsfragments/3112.bugfix.rst delete mode 100644 newsfragments/3113.doc.rst delete mode 100644 newsfragments/3114.bugfix.rst delete mode 100644 newsfragments/3121.misc.rst delete mode 100644 newsfragments/3141.bugfix.rst delete mode 100644 newsfragments/3159.misc.rst diff --git a/docs/source/history.rst b/docs/source/history.rst index 34e2fe9772..d3b25d08c4 100644 --- a/docs/source/history.rst +++ b/docs/source/history.rst @@ -5,6 +5,71 @@ Release history .. towncrier release notes start +Trio 0.28.0 (2024-12-25) +------------------------ + +Bugfixes +~~~~~~~~ + +- :func:`inspect.iscoroutinefunction` and the like now give correct answers when + called on KI-protected functions. (`#2670 `__) +- Rework KeyboardInterrupt protection to track code objects, rather than frames, + as protected or not. The new implementation no longer needs to access + ``frame.f_locals`` dictionaries, so it won't artificially extend the lifetime of + local variables. Since KeyboardInterrupt protection is now imposed statically + (when a protected function is defined) rather than each time the function runs, + its previously-noticeable performance overhead should now be near zero. + The lack of a call-time wrapper has some other benefits as well: + + * :func:`inspect.iscoroutinefunction` and the like now give correct answers when + called on KI-protected functions. + + * Calling a synchronous KI-protected function no longer pushes an additional stack + frame, so tracebacks are clearer. + + * A synchronous KI-protected function invoked from C code (such as a weakref + finalizer) is now guaranteed to start executing; previously there would be a brief + window in which KeyboardInterrupt could be raised before the protection was + established. + + One minor drawback of the new approach is that multiple instances of the same + closure share a single KeyboardInterrupt protection state (because they share a + single code object). That means that if you apply + `@enable_ki_protection ` to some of them + and not others, you won't get the protection semantics you asked for. See the + documentation of `@enable_ki_protection ` + for more details and a workaround. (`#3108 `__) +- Rework foreign async generator finalization to track async generator + ids rather than mutating ``ag_frame.f_locals``. This fixes an issue + with the previous implementation: locals' lifetimes will no longer be + extended by materialization in the ``ag_frame.f_locals`` dictionary that + the previous finalization dispatcher logic needed to access to do its work. (`#3112 `__) +- Ensure that Pyright recognizes our underscore prefixed attributes for attrs classes. (`#3114 `__) +- Fix `trio.testing.RaisesGroup`'s typing. (`#3141 `__) + + +Improved documentation +~~~~~~~~~~~~~~~~~~~~~~ + +- Improve error message when run after gevent's monkey patching. (`#3087 `__) +- Document that :func:`trio.sleep_forever` is guaranteed to raise an exception now. (`#3113 `__) + + +Removals without deprecations +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- Remove workaround for OpenSSL 1.1.1 DTLS ClientHello bug. (`#3097 `__) +- Drop support for Python 3.8. (`#3104 `__) (`#3106 `__) + + +Miscellaneous internal changes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- Switch to using PEP570 for positional-only arguments for `~trio.socket.SocketType`'s methods. (`#3094 `__) +- Improve type annotations in several places by removing `Any` usage. (`#3121 `__) +- Get and enforce 100% coverage (`#3159 `__) + + Trio 0.27.0 (2024-10-17) ------------------------ diff --git a/newsfragments/2670.bugfix.rst b/newsfragments/2670.bugfix.rst deleted file mode 100644 index cd5ed3b944..0000000000 --- a/newsfragments/2670.bugfix.rst +++ /dev/null @@ -1,2 +0,0 @@ -:func:`inspect.iscoroutinefunction` and the like now give correct answers when -called on KI-protected functions. diff --git a/newsfragments/3087.doc.rst b/newsfragments/3087.doc.rst deleted file mode 100644 index 68fa4b05ed..0000000000 --- a/newsfragments/3087.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Improve error message when run after gevent's monkey patching. diff --git a/newsfragments/3094.misc.rst b/newsfragments/3094.misc.rst deleted file mode 100644 index c35b7802e8..0000000000 --- a/newsfragments/3094.misc.rst +++ /dev/null @@ -1 +0,0 @@ -Switch to using PEP570 for positional-only arguments for `~trio.socket.SocketType`'s methods. diff --git a/newsfragments/3097.removal.rst b/newsfragments/3097.removal.rst deleted file mode 100644 index 1eca349d44..0000000000 --- a/newsfragments/3097.removal.rst +++ /dev/null @@ -1 +0,0 @@ -Remove workaround for OpenSSL 1.1.1 DTLS ClientHello bug. diff --git a/newsfragments/3106.removal.rst b/newsfragments/3106.removal.rst deleted file mode 100644 index ee023242d0..0000000000 --- a/newsfragments/3106.removal.rst +++ /dev/null @@ -1 +0,0 @@ -Drop support for Python 3.8. (`#3104 `__) diff --git a/newsfragments/3108.bugfix.rst b/newsfragments/3108.bugfix.rst deleted file mode 100644 index 16cf46b960..0000000000 --- a/newsfragments/3108.bugfix.rst +++ /dev/null @@ -1,26 +0,0 @@ -Rework KeyboardInterrupt protection to track code objects, rather than frames, -as protected or not. The new implementation no longer needs to access -``frame.f_locals`` dictionaries, so it won't artificially extend the lifetime of -local variables. Since KeyboardInterrupt protection is now imposed statically -(when a protected function is defined) rather than each time the function runs, -its previously-noticeable performance overhead should now be near zero. -The lack of a call-time wrapper has some other benefits as well: - -* :func:`inspect.iscoroutinefunction` and the like now give correct answers when - called on KI-protected functions. - -* Calling a synchronous KI-protected function no longer pushes an additional stack - frame, so tracebacks are clearer. - -* A synchronous KI-protected function invoked from C code (such as a weakref - finalizer) is now guaranteed to start executing; previously there would be a brief - window in which KeyboardInterrupt could be raised before the protection was - established. - -One minor drawback of the new approach is that multiple instances of the same -closure share a single KeyboardInterrupt protection state (because they share a -single code object). That means that if you apply -`@enable_ki_protection ` to some of them -and not others, you won't get the protection semantics you asked for. See the -documentation of `@enable_ki_protection ` -for more details and a workaround. diff --git a/newsfragments/3112.bugfix.rst b/newsfragments/3112.bugfix.rst deleted file mode 100644 index c34d035520..0000000000 --- a/newsfragments/3112.bugfix.rst +++ /dev/null @@ -1,5 +0,0 @@ -Rework foreign async generator finalization to track async generator -ids rather than mutating ``ag_frame.f_locals``. This fixes an issue -with the previous implementation: locals' lifetimes will no longer be -extended by materialization in the ``ag_frame.f_locals`` dictionary that -the previous finalization dispatcher logic needed to access to do its work. diff --git a/newsfragments/3113.doc.rst b/newsfragments/3113.doc.rst deleted file mode 100644 index 7ce407a29e..0000000000 --- a/newsfragments/3113.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Document that :func:`trio.sleep_forever` is guaranteed to raise an exception now. diff --git a/newsfragments/3114.bugfix.rst b/newsfragments/3114.bugfix.rst deleted file mode 100644 index 2f07712199..0000000000 --- a/newsfragments/3114.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Ensure that Pyright recognizes our underscore prefixed attributes for attrs classes. diff --git a/newsfragments/3121.misc.rst b/newsfragments/3121.misc.rst deleted file mode 100644 index 731232877b..0000000000 --- a/newsfragments/3121.misc.rst +++ /dev/null @@ -1 +0,0 @@ -Improve type annotations in several places by removing `Any` usage. diff --git a/newsfragments/3141.bugfix.rst b/newsfragments/3141.bugfix.rst deleted file mode 100644 index 36d378d5a3..0000000000 --- a/newsfragments/3141.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix `trio.testing.RaisesGroup`'s typing. diff --git a/newsfragments/3159.misc.rst b/newsfragments/3159.misc.rst deleted file mode 100644 index 9460e11c65..0000000000 --- a/newsfragments/3159.misc.rst +++ /dev/null @@ -1 +0,0 @@ -Get and enforce 100% coverage diff --git a/src/trio/_version.py b/src/trio/_version.py index 0ff89b6f87..7afdc3a285 100644 --- a/src/trio/_version.py +++ b/src/trio/_version.py @@ -1,3 +1,3 @@ # This file is imported from __init__.py and parsed by setuptools -__version__ = "0.27.0+dev" +__version__ = "0.28.0" From 2c466cf81379cc8ed52ec193f940c23ba2c1fd2e Mon Sep 17 00:00:00 2001 From: A5rocks Date: Thu, 26 Dec 2024 02:03:50 +0900 Subject: [PATCH 2/2] Start new cycle --- src/trio/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/trio/_version.py b/src/trio/_version.py index 7afdc3a285..11271535cb 100644 --- a/src/trio/_version.py +++ b/src/trio/_version.py @@ -1,3 +1,3 @@ # This file is imported from __init__.py and parsed by setuptools -__version__ = "0.28.0" +__version__ = "0.28.0+dev"