Skip to content

Conversation

@RonnyPfannschmidt
Copy link
Member

closes #629

using direct attributes instead of signature to avoid the extra objects

RonnyPfannschmidt and others added 2 commits November 28, 2025 21:57
In Python 3.14+, annotations are evaluated lazily per PEP 649/749.
When inspect.signature() is called, it tries to resolve annotations
by default, which fails if the annotation references an undefined type.

Add a version-gated _signature helper that uses
annotation_format=annotationlib.Format.STRING on Python 3.14+ to
prevent annotation resolution errors.

Fixes pytest-dev#629

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Use code object attributes (co_varnames, co_argcount) and __defaults__
directly instead of inspect.signature(). This avoids annotation
resolution entirely, which is simpler and more efficient.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@RonnyPfannschmidt RonnyPfannschmidt marked this pull request as draft November 28, 2025 21:07
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 this pull request may close these issues.

pluggy requires from __future__ import annotations although it shouldn't in Python 3.14

1 participant