Skip to content

Commit 37c0872

Browse files
committed
Merge branch 'release/1.1.2'
2 parents 061c6fe + 69390a2 commit 37c0872

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "taskiq-dependencies"
3-
version = "1.1.1"
3+
version = "1.1.2"
44
description = "FastAPI like dependency injection implementation"
55
authors = ["Pavel Kirilin <win10@list.ru>"]
66
readme = "README.md"

taskiq_dependencies/dependency.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import uuid
12
from typing import ( # noqa: WPS235
23
Any,
34
AsyncGenerator,
@@ -107,13 +108,14 @@ def __init__( # noqa: WPS234
107108
use_cache: bool = True,
108109
kwargs: Optional[Dict[str, Any]] = None,
109110
) -> None:
111+
self._id = uuid.uuid4()
110112
self.dependency = dependency
111113
self.use_cache = use_cache
112114
self.param_name = ""
113115
self.kwargs = kwargs or {}
114116

115117
def __hash__(self) -> int:
116-
return hash((self.dependency, self.use_cache, tuple(self.kwargs.keys())))
118+
return hash(self._id)
117119

118120
def __eq__(self, rhs: object) -> bool:
119121
"""
@@ -127,8 +129,4 @@ def __eq__(self, rhs: object) -> bool:
127129
"""
128130
if not isinstance(rhs, Dependency):
129131
return False
130-
return (self.dependency, self.use_cache, self.kwargs) == (
131-
rhs.dependency,
132-
rhs.use_cache,
133-
rhs.kwargs,
134-
)
132+
return self._id == rhs._id # noqa: WPS437

0 commit comments

Comments
 (0)