feat(decorators): attach Hook*Configuration objects on marked functions - #7
Open
RonnyPfannschmidt wants to merge 1 commit into
Open
Conversation
Reviewer's GuideRefactors hook specification storage to use a HookspecConfiguration object on HookSpec.config (with a deprecated .opts alias), updates hook caller logic to read configuration from .config, and adds tests to validate historic+firstresult configuration at decoration time and that specs are correctly storing configuration. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This was referenced Jul 24, 2026
refactor(caller): Protocol HookCaller, split callers, CompletionHook multicall
pytest-dev/pluggy#708
Open
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new
HookSpec.optsproperty is read-only and no longer part of__slots__, so if existing code mutatesspec.optsit will now fail; consider adding a setter that forwards toconfig(or explicitly confirming and documenting thatoptsis now a read-only deprecated alias) to avoid subtle breakage.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new `HookSpec.opts` property is read-only and no longer part of `__slots__`, so if existing code mutates `spec.opts` it will now fail; consider adding a setter that forwards to `config` (or explicitly confirming and documenting that `opts` is now a read-only deprecated alias) to avoid subtle breakage.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
RonnyPfannschmidt
force-pushed
the
refactor/markers-attach-config
branch
from
July 24, 2026 16:38
6238439 to
e406f69
Compare
RonnyPfannschmidt
force-pushed
the
refactor/configuration-objects
branch
from
July 24, 2026 16:53
65ee170 to
6993f10
Compare
RonnyPfannschmidt
force-pushed
the
refactor/markers-attach-config
branch
from
July 24, 2026 16:54
e406f69 to
5b654ff
Compare
RonnyPfannschmidt
force-pushed
the
refactor/configuration-objects
branch
from
August 12, 2026 10:50
6993f10 to
035b254
Compare
RonnyPfannschmidt
force-pushed
the
refactor/markers-attach-config
branch
from
August 12, 2026 10:50
5b654ff to
1ac246f
Compare
RonnyPfannschmidt
force-pushed
the
refactor/configuration-objects
branch
from
August 12, 2026 10:57
035b254 to
ad3a5a9
Compare
RonnyPfannschmidt
force-pushed
the
refactor/markers-attach-config
branch
from
August 12, 2026 10:57
1ac246f to
4dc4e1f
Compare
Complete design step 03: markers already attach configuration objects since step 02; this finishes the step by storing the spec configuration as HookSpec.config (try-claude naming) with a deprecated .opts alias, reading .config in HookCaller firstresult resolution, and covering decoration-time historic+firstresult validation and configuration attachment with tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
RonnyPfannschmidt
force-pushed
the
refactor/configuration-objects
branch
from
August 12, 2026 11:14
ad3a5a9 to
eef72c1
Compare
RonnyPfannschmidt
force-pushed
the
refactor/markers-attach-config
branch
from
August 12, 2026 11:14
4dc4e1f to
5840c41
Compare
This was referenced Aug 12, 2026
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.
Review PR — step 3 of 7.
This PR targets the previous step's branch, so its diff is only this step's change. Review happens here. The corresponding upstream PR, which is the one that actually merges, is pytest-dev#706.
Merges happen upstream one step at a time, bottom-up. When step 3 lands upstream, this PR is closed and the rest of the stack is rebased onto the new
main.refactor/split-hook-modulesrefactor/configuration-objectsrefactor/markers-attach-configrefactor/hookimpl-wrapper-typesrefactor/hookcaller-and-executionrefactor/project-specrefactor/async-submitterChain step 03 of the internal-refactoring series (design/03-markers-attach-config.md).
Stores the spec configuration as HookSpec.config (deprecated .opts alias kept), reads .config in firstresult resolution, and adds decoration-time historic+firstresult validation tests.
Stacked on #5.
🤖 Generated with Claude Code
Summary by Sourcery
Attach and expose hook specification configuration objects on marked functions and shift usage from the deprecated opts attribute to config, including validation and tests for historic/firstresult behavior.
New Features:
Enhancements:
Tests:
Chores: