Skip to content

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

Open
RonnyPfannschmidt wants to merge 1 commit into
pytest-dev:mainfrom
RonnyPfannschmidt:refactor/configuration-objects
Open

RonnyPfannschmidt wants to merge 1 commit into
pytest-dev:mainfrom
RonnyPfannschmidt:refactor/configuration-objects

Conversation

@RonnyPfannschmidt

@RonnyPfannschmidt RonnyPfannschmidt commented Jul 22, 2026 •

Copy link
Copy Markdown
Member

Written by Claude Opus 5.5 via Claude Code for the pluggy maintainers; I prompted it, it did the work, I read it.

Step 2 of 7, merges bottom-up: #703 → #704 → #706 → #707 → #708 → #709 → #710
The diff here is this step alone; review discussion happens on RonnyPfannschmidt#5.

  • Hook options become HookspecConfiguration / HookimplConfiguration objects, and the markers attach those instead of dicts.
  • Registration reads the configuration objects directly. PluginManager.parse_hookimpl_opts / parse_hookspec_opts are only called when a subclass overrides them and no configuration object was found; they return legacy dicts. They are documented as deprecated but do not warn yet.
  • HookspecOpts / HookimplOpts stay importable from pluggy for pytest's typing; they now live in _pytest_compat.

@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
@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/configuration-objects branch from eef72c1 to 01d2977 Compare September 12, 2026 19:04
@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/configuration-objects branch from 01d2977 to 80420c2 Compare September 12, 2026 19:14
@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/configuration-objects branch 3 times, most recently from 7496872 to c1ed863 Compare September 24, 2026 11:24
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>
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