Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-async_timeout for openSUSE:Factory checked in at 2023-09-07 21:12:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-async_timeout (Old) and /work/SRC/openSUSE:Factory/.python-async_timeout.new.1766 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-async_timeout" Thu Sep 7 21:12:22 2023 rev:9 rq:1109504 version:4.0.3 Changes: -------- --- /work/SRC/openSUSE:Factory/python-async_timeout/python-async_timeout.changes 2023-04-22 22:03:02.406141821 +0200 +++ /work/SRC/openSUSE:Factory/.python-async_timeout.new.1766/python-async_timeout.changes 2023-09-07 21:12:45.457340932 +0200 @@ -1,0 +2,8 @@ +Thu Sep 7 10:48:29 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 4.0.3: + * Fixed compatibility with asyncio.timeout() on Python 3.11+. + * Added support for Python 3.11. + * Dropped support for Python 3.6. + +------------------------------------------------------------------- Old: ---- async-timeout-4.0.2.tar.gz New: ---- async-timeout-4.0.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-async_timeout.spec ++++++ --- /var/tmp/diff_new_pack.1aU02q/_old 2023-09-07 21:12:46.577380971 +0200 +++ /var/tmp/diff_new_pack.1aU02q/_new 2023-09-07 21:12:46.581381114 +0200 @@ -16,10 +16,9 @@ # -%define skip_python2 1 %{?sle15_python_module_pythons} Name: python-async_timeout -Version: 4.0.2 +Version: 4.0.3 Release: 0 Summary: Timeout context manager for asyncio programs License: Apache-2.0 ++++++ async-timeout-4.0.2.tar.gz -> async-timeout-4.0.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/async-timeout-4.0.2/CHANGES.rst new/async-timeout-4.0.3/CHANGES.rst --- old/async-timeout-4.0.2/CHANGES.rst 2021-12-20 10:14:17.000000000 +0100 +++ new/async-timeout-4.0.3/CHANGES.rst 2023-08-10 18:35:18.000000000 +0200 @@ -4,6 +4,13 @@ .. towncrier release notes start +4.0.3 (2023-08-10) +================== + +* Fixed compatibility with asyncio.timeout() on Python 3.11+. +* Added support for Python 3.11. +* Dropped support for Python 3.6. + 4.0.2 (2021-12-20) ================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/async-timeout-4.0.2/PKG-INFO new/async-timeout-4.0.3/PKG-INFO --- old/async-timeout-4.0.2/PKG-INFO 2021-12-20 10:14:46.639183500 +0100 +++ new/async-timeout-4.0.3/PKG-INFO 2023-08-10 18:35:46.422943000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: async-timeout -Version: 4.0.2 +Version: 4.0.3 Summary: Timeout context manager for asyncio programs Home-page: https://github.com/aio-libs/async-timeout Author: Andrew Svetlov <andrew.svet...@gmail.com> @@ -11,7 +11,6 @@ Project-URL: Coverage: codecov, https://codecov.io/github/aio-libs/async-timeout Project-URL: GitHub: issues, https://github.com/aio-libs/async-timeout/issues Project-URL: GitHub: repo, https://github.com/aio-libs/async-timeout -Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Topic :: Software Development :: Libraries Classifier: Framework :: AsyncIO @@ -20,12 +19,12 @@ Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3 :: Only -Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 -Requires-Python: >=3.6 +Classifier: Programming Language :: Python :: 3.11 +Requires-Python: >=3.7 Description-Content-Type: text/x-rst License-File: LICENSE @@ -56,6 +55,7 @@ The ``timeout(delay, *, loop=None)`` call returns a context manager that cancels a block on *timeout* expiring:: + from async_timeout import timeout async with timeout(1.5): await inner() @@ -128,5 +128,3 @@ The module is written by Andrew Svetlov. It's *Apache 2* licensed and freely available. - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/async-timeout-4.0.2/README.rst new/async-timeout-4.0.3/README.rst --- old/async-timeout-4.0.2/README.rst 2021-12-20 10:14:17.000000000 +0100 +++ new/async-timeout-4.0.3/README.rst 2023-08-10 18:35:18.000000000 +0200 @@ -25,6 +25,7 @@ The ``timeout(delay, *, loop=None)`` call returns a context manager that cancels a block on *timeout* expiring:: + from async_timeout import timeout async with timeout(1.5): await inner() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/async-timeout-4.0.2/async_timeout/__init__.py new/async-timeout-4.0.3/async_timeout/__init__.py --- old/async-timeout-4.0.2/async_timeout/__init__.py 2021-12-20 10:14:17.000000000 +0100 +++ new/async-timeout-4.0.3/async_timeout/__init__.py 2023-08-10 18:35:18.000000000 +0200 @@ -3,7 +3,7 @@ import sys import warnings from types import TracebackType -from typing import Any, Optional, Type +from typing import Optional, Type if sys.version_info >= (3, 8): @@ -12,7 +12,18 @@ from typing_extensions import final -__version__ = "4.0.2" +if sys.version_info >= (3, 11): + + def _uncancel_task(task: "asyncio.Task[object]") -> None: + task.uncancel() + +else: + + def _uncancel_task(task: "asyncio.Task[object]") -> None: + pass + + +__version__ = "4.0.3" __all__ = ("timeout", "timeout_at", "Timeout") @@ -31,7 +42,7 @@ delay - value in seconds or None to disable timeout logic """ - loop = _get_running_loop() + loop = asyncio.get_running_loop() if delay is not None: deadline = loop.time() + delay # type: Optional[float] else: @@ -54,7 +65,7 @@ """ - loop = _get_running_loop() + loop = asyncio.get_running_loop() return Timeout(deadline, loop) @@ -79,12 +90,12 @@ # # This design allows to avoid many silly misusages. # - # TimeoutError is raised immadiatelly when scheduled + # TimeoutError is raised immediately when scheduled # if the deadline is passed. - # The purpose is to time out as sson as possible + # The purpose is to time out as soon as possible # without waiting for the next await expression. - __slots__ = ("_deadline", "_loop", "_state", "_timeout_handler") + __slots__ = ("_deadline", "_loop", "_state", "_timeout_handler", "_task") def __init__( self, deadline: Optional[float], loop: asyncio.AbstractEventLoop @@ -92,6 +103,7 @@ self._loop = loop self._state = _State.INIT + self._task: Optional["asyncio.Task[object]"] = None self._timeout_handler = None # type: Optional[asyncio.Handle] if deadline is None: self._deadline = None # type: Optional[float] @@ -147,6 +159,7 @@ self._reject() def _reject(self) -> None: + self._task = None if self._timeout_handler is not None: self._timeout_handler.cancel() self._timeout_handler = None @@ -169,7 +182,7 @@ deadline argument points on the time in the same clock system as loop.time(). - If new deadline is in the past the timeout is raised immediatelly. + If new deadline is in the past the timeout is raised immediately. Please note: it is not POSIX time but a time with undefined starting base, e.g. the time of the system power on. @@ -194,11 +207,11 @@ if self._timeout_handler is not None: self._timeout_handler.cancel() - task = _current_task(self._loop) + self._task = asyncio.current_task() if deadline <= now: - self._timeout_handler = self._loop.call_soon(self._on_timeout, task) + self._timeout_handler = self._loop.call_soon(self._on_timeout) else: - self._timeout_handler = self._loop.call_at(deadline, self._on_timeout, task) + self._timeout_handler = self._loop.call_at(deadline, self._on_timeout) def _do_enter(self) -> None: if self._state != _State.INIT: @@ -208,40 +221,19 @@ def _do_exit(self, exc_type: Optional[Type[BaseException]]) -> None: if exc_type is asyncio.CancelledError and self._state == _State.TIMEOUT: + assert self._task is not None + _uncancel_task(self._task) self._timeout_handler = None + self._task = None raise asyncio.TimeoutError # timeout has not expired self._state = _State.EXIT self._reject() return None - def _on_timeout(self, task: "asyncio.Task[None]") -> None: - task.cancel() + def _on_timeout(self) -> None: + assert self._task is not None + self._task.cancel() self._state = _State.TIMEOUT # drop the reference early self._timeout_handler = None - - -if sys.version_info >= (3, 7): - - def _current_task(loop: asyncio.AbstractEventLoop) -> "Optional[asyncio.Task[Any]]": - return asyncio.current_task(loop=loop) - -else: - - def _current_task(loop: asyncio.AbstractEventLoop) -> "Optional[asyncio.Task[Any]]": - return asyncio.Task.current_task(loop=loop) - - -if sys.version_info >= (3, 7): - - def _get_running_loop() -> asyncio.AbstractEventLoop: - return asyncio.get_running_loop() - -else: - - def _get_running_loop() -> asyncio.AbstractEventLoop: - loop = asyncio.get_event_loop() - if not loop.is_running(): - raise RuntimeError("no running event loop") - return loop diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/async-timeout-4.0.2/async_timeout.egg-info/PKG-INFO new/async-timeout-4.0.3/async_timeout.egg-info/PKG-INFO --- old/async-timeout-4.0.2/async_timeout.egg-info/PKG-INFO 2021-12-20 10:14:46.000000000 +0100 +++ new/async-timeout-4.0.3/async_timeout.egg-info/PKG-INFO 2023-08-10 18:35:46.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: async-timeout -Version: 4.0.2 +Version: 4.0.3 Summary: Timeout context manager for asyncio programs Home-page: https://github.com/aio-libs/async-timeout Author: Andrew Svetlov <andrew.svet...@gmail.com> @@ -11,7 +11,6 @@ Project-URL: Coverage: codecov, https://codecov.io/github/aio-libs/async-timeout Project-URL: GitHub: issues, https://github.com/aio-libs/async-timeout/issues Project-URL: GitHub: repo, https://github.com/aio-libs/async-timeout -Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Topic :: Software Development :: Libraries Classifier: Framework :: AsyncIO @@ -20,12 +19,12 @@ Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3 :: Only -Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 -Requires-Python: >=3.6 +Classifier: Programming Language :: Python :: 3.11 +Requires-Python: >=3.7 Description-Content-Type: text/x-rst License-File: LICENSE @@ -56,6 +55,7 @@ The ``timeout(delay, *, loop=None)`` call returns a context manager that cancels a block on *timeout* expiring:: + from async_timeout import timeout async with timeout(1.5): await inner() @@ -128,5 +128,3 @@ The module is written by Andrew Svetlov. It's *Apache 2* licensed and freely available. - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/async-timeout-4.0.2/setup.cfg new/async-timeout-4.0.3/setup.cfg --- old/async-timeout-4.0.2/setup.cfg 2021-12-20 10:14:46.643183700 +0100 +++ new/async-timeout-4.0.3/setup.cfg 2023-08-10 18:35:46.422943000 +0200 @@ -28,14 +28,14 @@ Programming Language :: Python Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 [options] -python_requires = >=3.6 +python_requires = >=3.7 packages = async_timeout zip_safe = True @@ -58,6 +58,7 @@ [tool:pytest] addopts = --cov=async_timeout --cov-report=term --cov-report=html --cov-branch +asyncio_mode = strict [mypy-pytest] ignore_missing_imports = true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/async-timeout-4.0.2/tests/test_timeout.py new/async-timeout-4.0.3/tests/test_timeout.py --- old/async-timeout-4.0.2/tests/test_timeout.py 2021-12-20 10:14:17.000000000 +0100 +++ new/async-timeout-4.0.3/tests/test_timeout.py 2023-08-10 18:35:18.000000000 +0200 @@ -1,4 +1,5 @@ import asyncio +import sys import time from functools import wraps from typing import Any, Callable, List, TypeVar @@ -39,6 +40,10 @@ await long_running_task() assert t._loop is asyncio.get_event_loop() assert canceled_raised, "CancelledError was not raised" + if sys.version_info >= (3, 11): + task = asyncio.current_task() + assert task is not None + assert not task.cancelling() @pytest.mark.asyncio @@ -47,7 +52,8 @@ await asyncio.sleep(0.01) return "done" - async with timeout(0.1): + # timeout should be long enough to work even on slow bisy test boxes + async with timeout(0.5): resp = await long_running_task() assert resp == "done" @@ -143,7 +149,6 @@ @pytest.mark.asyncio async def test_outer_coro_is_not_cancelled() -> None: - has_timeout = False async def outer() -> None: @@ -158,6 +163,8 @@ await task assert has_timeout assert not task.cancelled() + if sys.version_info >= (3, 11): + assert not task.cancelling() assert task.done()