-
Couldn't load subscription status.
- Fork 48
Closed
Description
Describe the bug
As a distro we have to update our package set continuously and as such we noticed mocket pins decorator<5.
Opening up the version constraint we are seeing a single test failure:
__________________________________ test_patch __________________________________
args = (), kw = {}
def fun(*args, **kw):
if not kwsyntax:
> args, kw = fix(args, kw, sig)
/nix/store/yx953vz3zzf7g8khilj09a3y958ghm1x-python3.9-decorator-5.0.9/lib/python3.9/site-packages/decorator.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/yx953vz3zzf7g8khilj09a3y958ghm1x-python3.9-decorator-5.0.9/lib/python3.9/site-packages/decorator.py:203: in fix
ba = sig.bind(*args, **kwargs)
/nix/store/lzf2sy1cvn4i7vkxigp9cq9qfp98g8b3-python3-3.9.6/lib/python3.9/inspect.py:3062: in bind
return self._bind(args, kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Signature (method_patch)>, args = (), kwargs = {}
def _bind(self, args, kwargs, *, partial=False):
"""Private method. Don't use directly."""
arguments = {}
parameters = iter(self.parameters.values())
parameters_ex = ()
arg_vals = iter(args)
while True:
# Let's iterate through the positional arguments and corresponding
# parameters
try:
arg_val = next(arg_vals)
except StopIteration:
# No more positional arguments
try:
param = next(parameters)
except StopIteration:
# No more parameters. That's it. Just need to check that
# we have no `kwargs` after this while loop
break
else:
if param.kind == _VAR_POSITIONAL:
# That's OK, just empty *args. Let's start parsing
# kwargs
break
elif param.name in kwargs:
if param.kind == _POSITIONAL_ONLY:
msg = '{arg!r} parameter is positional only, ' \
'but was passed as a keyword'
msg = msg.format(arg=param.name)
raise TypeError(msg) from None
parameters_ex = (param,)
break
elif (param.kind == _VAR_KEYWORD or
param.default is not _empty):
# That's fine too - we have a default value for this
# parameter. So, lets start parsing `kwargs`, starting
# with the current parameter
parameters_ex = (param,)
break
else:
# No default, not VAR_KEYWORD, not VAR_POSITIONAL,
# not in `kwargs`
if partial:
parameters_ex = (param,)
break
else:
msg = 'missing a required argument: {arg!r}'
msg = msg.format(arg=param.name)
> raise TypeError(msg) from None
E TypeError: missing a required argument: 'method_patch'
/nix/store/lzf2sy1cvn4i7vkxigp9cq9qfp98g8b3-python3-3.9.6/lib/python3.9/inspect.py:2977: TypeError
To Reproduce
Steps to reproduce the behavior:
- Remove upper bound on decorator constraint
python setup.py install
Expected behavior
Support recent decorator releases.
Additional context
n/a
Metadata
Metadata
Assignees
Labels
No labels