Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-async-lru for
openSUSE:Factory checked in at 2023-07-18 21:54:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-async-lru (Old)
and /work/SRC/openSUSE:Factory/.python-async-lru.new.3193 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-async-lru"
Tue Jul 18 21:54:05 2023 rev:2 rq:1098927 version:2.0.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-async-lru/python-async-lru.changes
2023-06-12 15:28:10.703665015 +0200
+++
/work/SRC/openSUSE:Factory/.python-async-lru.new.3193/python-async-lru.changes
2023-07-18 21:54:13.158325734 +0200
@@ -1,0 +2,8 @@
+Sun Jul 16 10:56:19 UTC 2023 - Dirk Müller <[email protected]>
+
+- update to 2.0.3:
+ * Fixed a ``KeyError`` that could occur when using ``ttl`` with
+ ``maxsize``.
+ * Dropped ``typing-extensions`` dependency in Python 3.11+.
+
+-------------------------------------------------------------------
Old:
----
async-lru-2.0.2.tar.gz
New:
----
async-lru-2.0.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-async-lru.spec ++++++
--- /var/tmp/diff_new_pack.XbNzpv/_old 2023-07-18 21:54:13.774329133 +0200
+++ /var/tmp/diff_new_pack.XbNzpv/_new 2023-07-18 21:54:13.774329133 +0200
@@ -18,7 +18,7 @@
%{?sle15_python_module_pythons}
Name: python-async-lru
-Version: 2.0.2
+Version: 2.0.3
Release: 0
Summary: Simple LRU cache for asyncio
License: MIT
++++++ async-lru-2.0.2.tar.gz -> async-lru-2.0.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/async-lru-2.0.2/Makefile new/async-lru-2.0.3/Makefile
--- old/async-lru-2.0.2/Makefile 2023-02-20 17:42:29.000000000 +0100
+++ new/async-lru-2.0.3/Makefile 2023-07-07 20:59:59.000000000 +0200
@@ -1,26 +1,18 @@
-SOURCES = setup.py async_lru.py tests
+# Some simple testing tasks (sorry, UNIX only).
-test: lint test-only
-
-test-only:
- pytest tests
-
-
-lint: black flake8 mypy
+.PHONY: init setup
+init setup:
+ pip install -r requirements-dev.txt
+ pre-commit install
+.PHONY: fmt
+fmt:
+ python -m pre_commit run --all-files --show-diff-on-failure
-mypy:
+.PHONY: lint
+lint: fmt
mypy
-
-black:
- isort -c .
- black --check .
-
-flake8:
- flake8 async_lru tests setup.py
-
-
-fmt:
- isort .
- black .
+.PHONY: test
+test:
+ pytest -s ./tests/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/async-lru-2.0.2/PKG-INFO new/async-lru-2.0.3/PKG-INFO
--- old/async-lru-2.0.2/PKG-INFO 2023-02-20 17:42:49.911354300 +0100
+++ new/async-lru-2.0.3/PKG-INFO 2023-07-07 21:00:21.228657700 +0200
@@ -1,11 +1,13 @@
Metadata-Version: 2.1
Name: async-lru
-Version: 2.0.2
+Version: 2.0.3
Summary: Simple LRU cache for asyncio
Home-page: https://github.com/aio-libs/async-lru
Maintainer: aiohttp team <[email protected]>
Maintainer-email: [email protected]
License: MIT License
+Project-URL: Chat: Matrix, https://matrix.to/#/#aio-libs:matrix.org
+Project-URL: Chat: Matrix Space, https://matrix.to/#/#aio-libs-space:matrix.org
Project-URL: CI: GitHub Actions, https://github.com/aio-libs/async-lru/actions
Project-URL: GitHub: repo, https://github.com/aio-libs/async-lru
Keywords: asyncio,lru,lru_cache
@@ -38,6 +40,14 @@
.. image::
https://codecov.io/gh/aio-libs/async_lru/branch/master/graph/badge.svg
:target: https://codecov.io/gh/aio-libs/async_lru
+.. image::
https://img.shields.io/matrix/aio-libs:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat
+ :target: https://matrix.to/#/%23aio-libs:matrix.org
+ :alt: Matrix Room â #aio-libs:matrix.org
+
+.. image::
https://img.shields.io/matrix/aio-libs-space:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs-space%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat
+ :target: https://matrix.to/#/%23aio-libs-space:matrix.org
+ :alt: Matrix Space â #aio-libs-space:matrix.org
+
Installation
------------
@@ -48,7 +58,7 @@
Usage
-----
-This package is 100% port of Python built-in function `functools.lru_cache
<https://docs.python.org/3/library/functools.html#functools.lru_cache>`_ for
`asyncio <https://docs.python.org/3/library/asyncio.html>`_
+This package is a port of Python's built-in `functools.lru_cache
<https://docs.python.org/3/library/functools.html#functools.lru_cache>`_
function for `asyncio <https://docs.python.org/3/library/asyncio.html>`_. To
better handle async behaviour, it also ensures multiple concurrent calls will
only result in 1 call to the wrapped function, with all ``await``\s receiving
the result of that call when it completes.
.. code-block:: python
@@ -101,7 +111,7 @@
@alru_cache(ttl=5)
async def func(arg1, arg2):
- return arg * 2
+ return arg1 + arg2
func.cache_invalidate(1, arg2=2)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/async-lru-2.0.2/README.rst
new/async-lru-2.0.3/README.rst
--- old/async-lru-2.0.2/README.rst 2023-02-20 17:42:29.000000000 +0100
+++ new/async-lru-2.0.3/README.rst 2023-07-07 20:59:59.000000000 +0200
@@ -12,6 +12,14 @@
.. image::
https://codecov.io/gh/aio-libs/async_lru/branch/master/graph/badge.svg
:target: https://codecov.io/gh/aio-libs/async_lru
+.. image::
https://img.shields.io/matrix/aio-libs:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat
+ :target: https://matrix.to/#/%23aio-libs:matrix.org
+ :alt: Matrix Room â #aio-libs:matrix.org
+
+.. image::
https://img.shields.io/matrix/aio-libs-space:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs-space%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat
+ :target: https://matrix.to/#/%23aio-libs-space:matrix.org
+ :alt: Matrix Space â #aio-libs-space:matrix.org
+
Installation
------------
@@ -22,7 +30,7 @@
Usage
-----
-This package is 100% port of Python built-in function `functools.lru_cache
<https://docs.python.org/3/library/functools.html#functools.lru_cache>`_ for
`asyncio <https://docs.python.org/3/library/asyncio.html>`_
+This package is a port of Python's built-in `functools.lru_cache
<https://docs.python.org/3/library/functools.html#functools.lru_cache>`_
function for `asyncio <https://docs.python.org/3/library/asyncio.html>`_. To
better handle async behaviour, it also ensures multiple concurrent calls will
only result in 1 call to the wrapped function, with all ``await``\s receiving
the result of that call when it completes.
.. code-block:: python
@@ -75,7 +83,7 @@
@alru_cache(ttl=5)
async def func(arg1, arg2):
- return arg * 2
+ return arg1 + arg2
func.cache_invalidate(1, arg2=2)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/async-lru-2.0.2/async_lru/__init__.py
new/async-lru-2.0.3/async_lru/__init__.py
--- old/async-lru-2.0.2/async_lru/__init__.py 2023-02-20 17:42:29.000000000
+0100
+++ new/async-lru-2.0.3/async_lru/__init__.py 2023-07-07 20:59:59.000000000
+0200
@@ -1,5 +1,6 @@
import asyncio
import dataclasses
+import sys
from asyncio.coroutines import _is_coroutine # type: ignore[attr-defined]
from functools import _CacheInfo, _make_key, partial, partialmethod
from typing import (
@@ -20,10 +21,14 @@
overload,
)
-from typing_extensions import Self
+if sys.version_info >= (3, 11):
+ from typing import Self
+else:
+ from typing_extensions import Self
-__version__ = "2.0.2"
+
+__version__ = "2.0.3"
__all__ = ("alru_cache",)
@@ -135,7 +140,7 @@
return _CacheInfo(
self.__hits,
self.__misses,
- self.__maxsize, # type: ignore[arg-type]
+ self.__maxsize,
len(self.__cache),
)
@@ -159,9 +164,9 @@
) -> None:
self.__tasks.remove(task)
- if self.__ttl is not None:
+ cache_item = self.__cache.get(key)
+ if self.__ttl is not None and cache_item is not None:
loop = asyncio.get_running_loop()
- cache_item = self.__cache[key]
cache_item.later_call = loop.call_later(
self.__ttl, self.__cache.pop, key, None
)
@@ -179,7 +184,7 @@
async def __call__(self, /, *fn_args: Any, **fn_kwargs: Any) -> _R:
if self.__closed:
- raise RuntimeError("alru_cache is closed for {}".format(self))
+ raise RuntimeError(f"alru_cache is closed for {self}")
loop = asyncio.get_running_loop()
@@ -297,7 +302,7 @@
origin = origin.func
if not asyncio.iscoroutinefunction(origin):
- raise RuntimeError("Coroutine function is required, got
{!r}".format(fn))
+ raise RuntimeError(f"Coroutine function is required, got {fn!r}")
# functools.partialmethod support
if hasattr(fn, "_make_unbound_method"):
@@ -340,4 +345,4 @@
if callable(fn) or hasattr(fn, "_make_unbound_method"):
return _make_wrapper(128, False, None)(fn)
- raise NotImplementedError("{!r} decorating is not
supported".format(fn))
+ raise NotImplementedError(f"{fn!r} decorating is not supported")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/async-lru-2.0.2/async_lru/py.typed
new/async-lru-2.0.3/async_lru/py.typed
--- old/async-lru-2.0.2/async_lru/py.typed 2023-02-20 17:42:29.000000000
+0100
+++ new/async-lru-2.0.3/async_lru/py.typed 2023-07-07 20:59:59.000000000
+0200
@@ -1 +0,0 @@
-# placeholder
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/async-lru-2.0.2/async_lru.egg-info/PKG-INFO
new/async-lru-2.0.3/async_lru.egg-info/PKG-INFO
--- old/async-lru-2.0.2/async_lru.egg-info/PKG-INFO 2023-02-20
17:42:49.000000000 +0100
+++ new/async-lru-2.0.3/async_lru.egg-info/PKG-INFO 2023-07-07
21:00:21.000000000 +0200
@@ -1,11 +1,13 @@
Metadata-Version: 2.1
Name: async-lru
-Version: 2.0.2
+Version: 2.0.3
Summary: Simple LRU cache for asyncio
Home-page: https://github.com/aio-libs/async-lru
Maintainer: aiohttp team <[email protected]>
Maintainer-email: [email protected]
License: MIT License
+Project-URL: Chat: Matrix, https://matrix.to/#/#aio-libs:matrix.org
+Project-URL: Chat: Matrix Space, https://matrix.to/#/#aio-libs-space:matrix.org
Project-URL: CI: GitHub Actions, https://github.com/aio-libs/async-lru/actions
Project-URL: GitHub: repo, https://github.com/aio-libs/async-lru
Keywords: asyncio,lru,lru_cache
@@ -38,6 +40,14 @@
.. image::
https://codecov.io/gh/aio-libs/async_lru/branch/master/graph/badge.svg
:target: https://codecov.io/gh/aio-libs/async_lru
+.. image::
https://img.shields.io/matrix/aio-libs:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat
+ :target: https://matrix.to/#/%23aio-libs:matrix.org
+ :alt: Matrix Room â #aio-libs:matrix.org
+
+.. image::
https://img.shields.io/matrix/aio-libs-space:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs-space%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat
+ :target: https://matrix.to/#/%23aio-libs-space:matrix.org
+ :alt: Matrix Space â #aio-libs-space:matrix.org
+
Installation
------------
@@ -48,7 +58,7 @@
Usage
-----
-This package is 100% port of Python built-in function `functools.lru_cache
<https://docs.python.org/3/library/functools.html#functools.lru_cache>`_ for
`asyncio <https://docs.python.org/3/library/asyncio.html>`_
+This package is a port of Python's built-in `functools.lru_cache
<https://docs.python.org/3/library/functools.html#functools.lru_cache>`_
function for `asyncio <https://docs.python.org/3/library/asyncio.html>`_. To
better handle async behaviour, it also ensures multiple concurrent calls will
only result in 1 call to the wrapped function, with all ``await``\s receiving
the result of that call when it completes.
.. code-block:: python
@@ -101,7 +111,7 @@
@alru_cache(ttl=5)
async def func(arg1, arg2):
- return arg * 2
+ return arg1 + arg2
func.cache_invalidate(1, arg2=2)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/async-lru-2.0.2/async_lru.egg-info/requires.txt
new/async-lru-2.0.3/async_lru.egg-info/requires.txt
--- old/async-lru-2.0.2/async_lru.egg-info/requires.txt 2023-02-20
17:42:49.000000000 +0100
+++ new/async-lru-2.0.3/async_lru.egg-info/requires.txt 2023-07-07
21:00:21.000000000 +0200
@@ -1 +1,3 @@
+
+[:python_version < "3.11"]
typing_extensions>=4.0.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/async-lru-2.0.2/setup.cfg
new/async-lru-2.0.3/setup.cfg
--- old/async-lru-2.0.2/setup.cfg 2023-02-20 17:42:49.911354300 +0100
+++ new/async-lru-2.0.3/setup.cfg 2023-07-07 21:00:21.232658100 +0200
@@ -3,6 +3,8 @@
version = attr: async_lru.__version__
url = https://github.com/aio-libs/async-lru
project_urls =
+ Chat: Matrix = https://matrix.to/#/#aio-libs:matrix.org
+ Chat: Matrix Space = https://matrix.to/#/#aio-libs-space:matrix.org
CI: GitHub Actions = https://github.com/aio-libs/async-lru/actions
GitHub: repo = https://github.com/aio-libs/async-lru
description = Simple LRU cache for asyncio
@@ -38,7 +40,7 @@
python_requires = >=3.8
packages = find:
install_requires =
- typing_extensions>=4.0.0
+ typing_extensions>=4.0.0; python_version<"3.11"
[options.package_data]
* =
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/async-lru-2.0.2/tests/test_ttl.py
new/async-lru-2.0.3/tests/test_ttl.py
--- old/async-lru-2.0.2/tests/test_ttl.py 2023-02-20 17:42:29.000000000
+0100
+++ new/async-lru-2.0.3/tests/test_ttl.py 2023-07-07 20:59:59.000000000
+0200
@@ -58,3 +58,12 @@
# cache is not cleared after ttl expires because invalidate also should
clear
# the invalidation by timeout
check_lru(coro, hits=0, misses=2, cache=1, tasks=0, maxsize=None)
+
+
+async def test_ttl_concurrent() -> None:
+ @alru_cache(maxsize=1, ttl=1)
+ async def coro(val: int) -> int:
+ return val
+
+ results = await asyncio.gather(*(coro(i) for i in range(2)))
+ assert results == list(range(2))