Skip to content

Commit bf236b7

Browse files
authored
Bump cachetools to 6.0.* (#14131)
1 parent ce0596b commit bf236b7

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

stubs/cachetools/@tests/stubtest_allowlist.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ cachetools.LFUCache.__setitem__
99
cachetools.LRUCache.__delitem__
1010
cachetools.LRUCache.__getitem__
1111
cachetools.LRUCache.__setitem__
12-
cachetools.MRUCache.__delitem__
13-
cachetools.MRUCache.__getitem__
14-
cachetools.MRUCache.__setitem__
1512
cachetools.TLRUCache.__delitem__
1613
cachetools.TLRUCache.__getitem__
1714
cachetools.TLRUCache.__setitem__

stubs/cachetools/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "5.5.*"
1+
version = "6.0.*"
22
upstream_repository = "https://github.com/tkem/cachetools"

stubs/cachetools/cachetools/__init__.pyi

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
from _typeshed import IdentityFunction, Unused
22
from collections.abc import Callable, Iterator, MutableMapping, Sequence
33
from contextlib import AbstractContextManager
4+
from threading import Condition
45
from typing import Any, TypeVar, overload
56
from typing_extensions import deprecated
67

7-
__all__ = ("Cache", "FIFOCache", "LFUCache", "LRUCache", "MRUCache", "RRCache", "TLRUCache", "TTLCache", "cached", "cachedmethod")
8+
__all__ = ("Cache", "FIFOCache", "LFUCache", "LRUCache", "RRCache", "TLRUCache", "TTLCache", "cached", "cachedmethod")
89
__version__: str
910

1011
_KT = TypeVar("_KT")
@@ -38,9 +39,6 @@ class FIFOCache(Cache[_KT, _VT]): ...
3839
class LFUCache(Cache[_KT, _VT]): ...
3940
class LRUCache(Cache[_KT, _VT]): ...
4041

41-
@deprecated("@mru_cache is deprecated")
42-
class MRUCache(Cache[_KT, _VT]): ...
43-
4442
class RRCache(Cache[_KT, _VT]):
4543
@overload
4644
def __init__(self, maxsize: float, choice: None = None, getsizeof: None = None) -> None: ...
@@ -99,14 +97,25 @@ class TLRUCache(_TimedCache[_KT, _VT]):
9997
def ttu(self) -> Callable[[_KT, _VT, float], float]: ...
10098
def expire(self, time: float | None = None) -> list[tuple[_KT, _VT]]: ...
10199

100+
@overload
102101
def cached(
103102
cache: MutableMapping[_KT, Any] | None,
104103
key: Callable[..., _KT] = ...,
105104
lock: AbstractContextManager[Any] | None = None,
105+
condition: Condition | None = None,
106106
info: bool = False,
107107
) -> IdentityFunction: ...
108+
@overload
109+
@deprecated("Passing `info` as positional parameter is deprecated.")
110+
def cached(
111+
cache: MutableMapping[_KT, Any] | None,
112+
key: Callable[..., _KT] = ...,
113+
lock: AbstractContextManager[Any] | None = None,
114+
condition: bool | None = None,
115+
) -> IdentityFunction: ...
108116
def cachedmethod(
109117
cache: Callable[[Any], MutableMapping[_KT, Any] | None],
110118
key: Callable[..., _KT] = ...,
111119
lock: Callable[[Any], AbstractContextManager[Any]] | None = None,
120+
condition: Condition | None = None,
112121
) -> IdentityFunction: ...

stubs/cachetools/cachetools/func.pyi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
from _typeshed import IdentityFunction
22
from collections.abc import Callable, Sequence
33
from typing import TypeVar
4-
from typing_extensions import deprecated
54

6-
__all__ = ("fifo_cache", "lfu_cache", "lru_cache", "mru_cache", "rr_cache", "ttl_cache")
5+
__all__ = ("fifo_cache", "lfu_cache", "lru_cache", "rr_cache", "ttl_cache")
76
_T = TypeVar("_T")
87

98
def fifo_cache(maxsize: float | None = 128, typed: bool = False) -> IdentityFunction: ...
109
def lfu_cache(maxsize: float | None = 128, typed: bool = False) -> IdentityFunction: ...
1110
def lru_cache(maxsize: float | None = 128, typed: bool = False) -> IdentityFunction: ...
12-
@deprecated("@mru_cache is deprecated")
13-
def mru_cache(maxsize: float | None = 128, typed: bool = False) -> IdentityFunction: ...
1411
def rr_cache(
1512
maxsize: float | None = 128, choice: Callable[[Sequence[_T]], _T] | None = ..., typed: bool = False
1613
) -> IdentityFunction: ...

0 commit comments

Comments
 (0)