fix: request signature with annotation format STRING - #668
Closed
mschoettle wants to merge 2 commits into
Closed
Conversation
mschoettle
force-pushed
the
fix-inspect-signature
branch
3 times, most recently
from
April 28, 2026 20:29
30f1b58 to
7ae22a5
Compare
mschoettle
commented
Apr 28, 2026
|
|
||
| def _signature(func: Callable[..., object]) -> inspect.Signature: | ||
| return inspect.signature(func, annotation_format=Format.STRING) | ||
| else: # pragma: no cover |
Contributor
Author
There was a problem hiding this comment.
This is reported as uncovered despite the comment
Contributor
Author
There was a problem hiding this comment.
Actually, with the combined coverage data the comment should not be required. Not sure what's wrong with the codecov check.
mschoettle
force-pushed
the
fix-inspect-signature
branch
from
April 28, 2026 20:56
7ae22a5 to
bba1a7a
Compare
mschoettle
marked this pull request as draft
April 29, 2026 13:00
mschoettle
force-pushed
the
fix-inspect-signature
branch
from
April 29, 2026 13:39
33a4b79 to
bba1a7a
Compare
mschoettle
marked this pull request as ready for review
April 29, 2026 13:41
Member
|
note - this may be super-seeded by #632 which i just picked up again |
Contributor
Author
|
Yes indeed. |
Member
|
thank you for providing this, as mentioned earlier #632 solves it different |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Python 3.14+ the default annotation format is
Format.VALUEwhich causes an error when requesting a signature with an undefined name.On Python 3.14,
ruffsuggests to move certain imports into type checking blocks, leading for example to the following:Causing:
Changing the annotation format to
STRINGfixes this.