pluggy icon indicating copy to clipboard operation
pluggy copied to clipboard

incorrect hookimpl signature inspection for decorated functions

Open eachimei opened this issue 3 years ago • 7 comments

Please see details at: https://github.com/jaraco/keyring/pull/582#issuecomment-1200450421

Suggestion for pluggy._hooks:varnames: use inspect.signature(func) instead of getfullargspec since it has the ability to follow wrapper chains (and that's actually the default behavior): https://docs.python.org/3/library/inspect.html#inspect.signature

As can be seen in the mentioned comment above, the current code (pluggy 1.0.0) actually breaks/limits hook-implementations.

eachimei avatar Jul 31 '22 16:07 eachimei

the "limit" was never intentional - its primarily a artifact of python 2 support, signature should be used these days

RonnyPfannschmidt avatar Jul 31 '22 17:07 RonnyPfannschmidt

0001-proposed-fix-for-issue-358.patch.txt

Attached is a fix proposal (including a matching test) as a git-patch.

eachimei avatar Aug 02 '22 19:08 eachimei

Why not open a pr?, this is absolutely horrible to work with from mobile, and it's still quite a pain if I get back to the computer

RonnyPfannschmidt avatar Aug 02 '22 19:08 RonnyPfannschmidt

I'd love to and I actually tried, but seems like I don't have permission to push a branch?

eachimei avatar Aug 02 '22 20:08 eachimei

@eachimei the way to contribute in GitHub in general is fork the repository, push your branch there, then open a PR. 👍

nicoddemus avatar Aug 02 '22 20:08 nicoddemus

I'd love to and I actually tried, but seems like I don't have permission to push a branch?


From: Ronny Pfannschmidt @.> Sent: Tuesday, August 2, 2022 10:58:18 PM To: pytest-dev/pluggy @.> Cc: Achimeir, Eyal @.>; Author @.> Subject: Re: [pytest-dev/pluggy] incorrect hookimpl signature inspection for decorated functions (Issue #358)

Why not open a pr?, this is absolutely horrible to work with from mobile, and it's still quite a pain if I get back to the computer

— Reply to this email directly, view it on GitHubhttps://github.com/pytest-dev/pluggy/issues/358#issuecomment-1203156306, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AU7SA4SHGSYKKZOYZGWCS6TVXF4VVANCNFSM55FEE5HA. You are receiving this because you authored the thread.Message ID: @.***>

Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

eachimei avatar Oct 11 '22 08:10 eachimei

You need to create a fork, then push to your fork. From there you can open a PR to this repository.

nicoddemus avatar Oct 11 '22 10:10 nicoddemus

@nicoddemus

You need to create a fork, then push to your fork. From there you can open a PR to this repository.

Thank you, already done: PR approved but not merged yet: https://github.com/pytest-dev/pluggy/pull/359

eachimei avatar Nov 06 '22 09:11 eachimei

@RonnyPfannschmidt looks like this can be closed as completed.

zanieb avatar Dec 30 '22 17:12 zanieb

indeed, thanks

RonnyPfannschmidt avatar Jul 20 '23 13:07 RonnyPfannschmidt