Closed fschulze closed 1 year ago
It can more easily be triggered by devpi login username
.
I'm slightly surprised that the argument spec isn't present, because ContextDecorator uses functools.wraps.
It looks like inspect.getfullargspec
shows the raw args, but inspect.signature
resolves the wrapping.
>>> inspect.getfullargspec(cl.devpiclient_get_password)
FullArgSpec(args=[], varargs='args', varkw='kwds', defaults=None, kwonlyargs=[], kwonlydefaults=None, annotations={})
>>> inspect.signature(cl.devpiclient_get_password)
<Signature (url, username)>
Docs say that getfullargspec
is discouraged and signature
should be used:
Note that signature() and Signature Object provide the recommended API for callable introspection, and support additional behaviours (like positional-only arguments) that are sometimes encountered in extension module APIs. This function is retained primarily for use in code that needs to maintain compatibility with the Python 2 inspect module API.
Oh, the issue is known (https://github.com/pytest-dev/pluggy/issues/358) and already linked to #582.
v23.9.3 provides a workaround, but the core issue should be fixed upstream in pluggy.
The
@suppress(KeyringError)
line breaks the devpi-client hook. It looks like the argument spec is changed by it which causes pluggy to not pass in the arguments correctly. It happens when trying todevpi push
a release to pypi and the password is not set in~pypirc
which causes devpi-client to try the hook.