fix: request signature with annotation format STRING#668
Open
mschoettle wants to merge 2 commits intopytest-dev:mainfrom
Open
fix: request signature with annotation format STRING#668mschoettle wants to merge 2 commits intopytest-dev:mainfrom
mschoettle wants to merge 2 commits intopytest-dev:mainfrom
Conversation
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.
7ae22a5 to
bba1a7a
Compare
33a4b79 to
bba1a7a
Compare
Member
|
note - this may be super-seeded by #632 which i just picked up again |
Contributor
Author
|
Yes indeed. |
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.