-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Defer annotation eval on Python 3.14 #13550
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well done, thanks
from annotationlib import Format | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder if
from annotationlib import Format | |
from annotationlib import Format | |
signature = partial(inspect.signature, annotation_format=Format.STRING) | |
else: | |
from inspect import signature | |
would be sufficient, it may be a bit too much of a code golf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it would work but raise mypy errors as signature
isn't explicitly exported.
src/_pytest/nodes.py:31: error: Module "_pytest.compat" does not explicitly export attribute "signature" [attr-defined]
src/_pytest/fixtures.py:52: error: Module "_pytest.compat" does not explicitly export attribute "signature" [attr-defined]
That could be resolved with from inspect import signature as signature
but at that point we might as well use a dedicated function for it. That will also make it easier to understand what's going on here.
--
@RonnyPfannschmidt Can this PR be backported to 8.4.x
in case there is another release before 8.5
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see, thanks for verifying , let me add the backport label
Anything else left here? The test failures look unrelated to me. |
Failures are unrelated |
Fixes #13549