Skip to content

Commit

Permalink
Update lib
Browse files Browse the repository at this point in the history
  • Loading branch information
medariox committed Jul 20, 2023
1 parent 767c45e commit aa99e5a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ext/dogpile/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.2.1"
__version__ = "1.2.2"

from .lock import Lock # noqa
from .lock import NeedRegenerationException # noqa
8 changes: 6 additions & 2 deletions ext/dogpile/cache/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from typing import Sequence
from typing import Union

from ..util.typing import Self


class NoValue:
"""Describe a missing cache value.
Expand All @@ -18,7 +20,7 @@ class NoValue:
"""

@property
def payload(self):
def payload(self) -> Self:
return self

def __repr__(self):
Expand Down Expand Up @@ -190,7 +192,9 @@ def __init__(self, arguments: BackendArguments): # pragma NO COVERAGE
raise NotImplementedError()

@classmethod
def from_config_dict(cls, config_dict, prefix):
def from_config_dict(
cls, config_dict: Mapping[str, Any], prefix: str
) -> Self:
prefix_len = len(prefix)
return cls(
dict(
Expand Down
4 changes: 2 additions & 2 deletions ext/dogpile/cache/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
.. versionadded:: 0.5.0 Added support for the :class:`.ProxyBackend` class.
"""

from typing import Mapping
from typing import Optional
from typing import Sequence
Expand All @@ -20,6 +19,7 @@
from .api import CacheMutex
from .api import KeyType
from .api import SerializedReturnType
from ..util.typing import Self


class ProxyBackend(CacheBackend):
Expand Down Expand Up @@ -67,7 +67,7 @@ def get(self, key):
def __init__(self, *arg, **kw):
pass

def wrap(self, backend: CacheBackend) -> "ProxyBackend":
def wrap(self, backend: CacheBackend) -> Self:
"""Take a backend as an argument and setup the self.proxied property.
Return an object that be used as a backend by a :class:`.CacheRegion`
object.
Expand Down
3 changes: 2 additions & 1 deletion ext/dogpile/cache/region.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
from ..util import memoized_property
from ..util import NameRegistry
from ..util import PluginLoader
from ..util.typing import Self

value_version = 2
"""An integer placed in the :class:`.CachedValue`
Expand Down Expand Up @@ -426,7 +427,7 @@ def configure(
wrap: Sequence[Union[ProxyBackend, Type[ProxyBackend]]] = (),
replace_existing_backend: bool = False,
region_invalidator: Optional[RegionInvalidationStrategy] = None,
) -> "CacheRegion":
) -> Self:
"""Configure a :class:`.CacheRegion`.
The :class:`.CacheRegion` itself
Expand Down
6 changes: 6 additions & 0 deletions ext/dogpile/util/typing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import sys

if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self # noqa: F401
2 changes: 1 addition & 1 deletion ext/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ext | `decorator` | [4.4.0](https://pypi.org/project/decorator/4.4.0/) | `valida
ext | `deluge-client` | [1.9.0](https://pypi.org/project/deluge-client/1.9.0/) | **`medusa`** | Module: `deluge_client`
ext | **`deprecated`** | [1.2.3](https://pypi.org/project/deprecated/1.2.3/) | `PyGithub` | -
ext | **`diskcache`** | [5.2.1](https://pypi.org/project/diskcache/5.2.1/) | `imdbpie` | -
ext | `dogpile.cache` | [1.2.1](https://pypi.org/project/dogpile.cache/1.2.1/) | **`medusa`**, `subliminal` | Module: `dogpile`
ext | `dogpile.cache` | [1.2.2](https://pypi.org/project/dogpile.cache/1.2.2/) | **`medusa`**, `subliminal` | Module: `dogpile`
ext | **`enzyme`** | pymedusa/[665cf69](https://github.com/pymedusa/enzyme/tree/665cf6948aab1c249dcc99bd9624a81d17b3302a) | `knowit`, `subliminal` | -
ext | **`feedparser`** | [6.0.10](https://pypi.org/project/feedparser/6.0.10/) | **`medusa`** | Requires `sgmllib3k` on Python 3
ext | **`gntp`** | [1.0.3](https://pypi.org/project/gntp/1.0.3/) | **`medusa`** | -
Expand Down

0 comments on commit aa99e5a

Please sign in to comment.