Skip to content

feat(config): replace TypedDict options with Hook*Configuration - #704

Open
RonnyPfannschmidt wants to merge 3 commits into
pytest-dev:mainfrom
RonnyPfannschmidt:refactor/configuration-objects
Open

feat(config): replace TypedDict options with Hook*Configuration#704
RonnyPfannschmidt wants to merge 3 commits into
pytest-dev:mainfrom
RonnyPfannschmidt:refactor/configuration-objects

Conversation

@RonnyPfannschmidt

@RonnyPfannschmidt RonnyPfannschmidt commented Jul 22, 2026

Copy link
Copy Markdown
Member

Merge PR — step 2 of 7.

This PR targets main, so GitHub shows the cumulative diff of steps 1–2. For this step's isolated diff, use the downstream review PR RonnyPfannschmidt#5, which targets the previous step's branch.

Merge order is bottom-up: this one is ready once step 1 has landed.

Step Branch Review (downstream) Merge (upstream)
1 refactor/split-hook-modules RonnyPfannschmidt#6 #703
2 refactor/configuration-objects RonnyPfannschmidt#5 #704
3 refactor/markers-attach-config RonnyPfannschmidt#7 #706
4 refactor/hookimpl-wrapper-types RonnyPfannschmidt#8 #707
5 refactor/hookcaller-and-execution RonnyPfannschmidt#9 #708
6 refactor/project-spec RonnyPfannschmidt#10 #709
7 refactor/async-submitter RonnyPfannschmidt#11 #710

Summary

  • Replace live TypedDict hook options with HookspecConfiguration / HookimplConfiguration
  • Markers attach configuration objects; registration uses private discovery
  • parse_hook*_opts remains a deprecated pytest/support concession (dict return), only called when overridden and no modern config is present

Review

Incremental review against the module-split parent (preferred):
RonnyPfannschmidt#5

This upstream PR targets main and includes the module reorganization commit as well.

Test plan

  • uv run pytest
  • uv run pre-commit run -a
  • CI green
  • Changelog fragment once this PR number is known

Made with Cursor

@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/configuration-objects branch from 65ee170 to 6993f10 Compare July 24, 2026 16:53
@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/configuration-objects branch 3 times, most recently from ad3a5a9 to eef72c1 Compare August 12, 2026 11:14
@RonnyPfannschmidt
RonnyPfannschmidt marked this pull request as ready for review September 12, 2026 14:29
Add the design/ writeup chain (decisions + per-step docs 01-07) that
guides the stacked refactoring branches. Exclude design/ from
blacken-docs since the docs use elided pseudo-code signatures.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
RonnyPfannschmidt and others added 2 commits September 12, 2026 21:11
Move hook types, markers, callers, implementations, and multicall out of
the monolithic _hooks/_callers modules so later typed-config and
CompletionHook work can land without thrashing one huge file. Keep
_hooks and _callers as re-export shims for import compatibility.

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Cursor Grok 4.5 <grok@cursor.com>
Markers attach HookspecConfiguration/HookimplConfiguration objects.
Registration discovers those privately; parse_hookimpl_opts and
parse_hookspec_opts remain a deprecated pytest concession that returns
legacy dicts and is only called when a subclass overrides them and no
modern configuration attribute was found.

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Cursor Grok 4.5 <grok@cursor.com>
@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/configuration-objects branch from 01d2977 to 80420c2 Compare September 12, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant