Skip to content

Commit ee0dde1

Browse files
authored
Missing dependency (#283)
* Missing dependency.
1 parent 1722f05 commit ee0dde1

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

mocket/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
"FakeSSLContext",
3232
)
3333

34-
__version__ = "3.13.3"
34+
__version__ = "3.13.4"

mocket/decorators/async_mocket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ async def wrapper(
1616
return await test(*args, **kwargs)
1717

1818

19-
async_mocketize = get_mocketize(wrapper_=wrapper)
19+
async_mocketize = get_mocketize(wrapper)
2020

2121

2222
__all__ = ("async_mocketize",)

mocket/decorators/mocketizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ def wrapper(
9292
return test(*args, **kwargs)
9393

9494

95-
mocketize = get_mocketize(wrapper_=wrapper)
95+
mocketize = get_mocketize(wrapper)

mocket/utils.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
from __future__ import annotations
22

33
import binascii
4+
import contextlib
45
from typing import Callable
56

7+
import decorator
8+
69
from mocket.compat import decode_from_bytes, encode_to_bytes
710

811

@@ -28,14 +31,10 @@ def hexload(string: str) -> bytes:
2831

2932

3033
def get_mocketize(wrapper_: Callable) -> Callable:
31-
import decorator
32-
33-
if decorator.__version__ < "5": # type: ignore[attr-defined] # pragma: no cover
34-
return decorator.decorator(wrapper_)
35-
return decorator.decorator( # type: ignore[call-arg] # kwsyntax
36-
wrapper_,
37-
kwsyntax=True,
38-
)
34+
# trying to support different versions of `decorator`
35+
with contextlib.suppress(TypeError):
36+
return decorator.decorator(wrapper_, kwsyntax=True) # type: ignore[call-arg,unused-ignore]
37+
return decorator.decorator(wrapper_)
3938

4039

4140
__all__ = (

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ dependencies = [
3131
"decorator>=4.0.0",
3232
"urllib3>=1.25.3",
3333
"h11",
34+
"typing-extensions",
3435
]
3536
dynamic = ["version"]
3637

@@ -124,6 +125,7 @@ files = [
124125
]
125126
strict = true
126127
warn_unused_configs = true
128+
suppress_unused_ignore = true
127129
ignore_missing_imports = true
128130
warn_redundant_casts = true
129131
warn_unused_ignores = true

0 commit comments

Comments
 (0)