Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devpi-client hook broken #596

Closed
fschulze opened this issue Sep 12, 2022 · 6 comments · Fixed by #598
Closed

devpi-client hook broken #596

fschulze opened this issue Sep 12, 2022 · 6 comments · Fixed by #598

Comments

@fschulze
Copy link

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 to devpi push a release to pypi and the password is not set in ~pypirc which causes devpi-client to try the hook.

@fschulze
Copy link
Author

It can more easily be triggered by devpi login username.

@jaraco
Copy link
Owner

jaraco commented Sep 17, 2022

I'm slightly surprised that the argument spec isn't present, because ContextDecorator uses functools.wraps.

@jaraco
Copy link
Owner

jaraco commented Sep 17, 2022

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)>

@jaraco
Copy link
Owner

jaraco commented Sep 17, 2022

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.

@jaraco
Copy link
Owner

jaraco commented Sep 17, 2022

Oh, the issue is known (pytest-dev/pluggy#358) and already linked to #582.

@jaraco
Copy link
Owner

jaraco commented Sep 17, 2022

v23.9.3 provides a workaround, but the core issue should be fixed upstream in pluggy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants