Skip to content

Commit e33adfa

Browse files
Remove deprecated HookimplOpts usage and minimize internal dependencies
- Remove HookImpl.opts deprecated attribute - Remove HookimplConfiguration.to_opts() method (no longer used) - Update benchmark tests to use hookimpl.get_hookconfig() directly - Eliminates internal HookimplOpts conversions while preserving public API 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 79af872 commit e33adfa

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

src/pluggy/_hooks.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,6 @@ def __init__(
136136
#: The name of the hook specification to match, see :ref:`specname`.
137137
self.specname: Final = specname
138138

139-
def to_opts(self) -> HookimplOpts:
140-
"""Convert to HookimplOpts for backward compatibility."""
141-
return {
142-
"wrapper": self.wrapper,
143-
"hookwrapper": self.hookwrapper,
144-
"optionalhook": self.optionalhook,
145-
"tryfirst": self.tryfirst,
146-
"trylast": self.trylast,
147-
"specname": self.specname,
148-
}
149-
150139
@classmethod
151140
def from_opts(cls, opts: HookimplOpts) -> HookimplConfiguration:
152141
"""Create from HookimplOpts for backward compatibility."""
@@ -734,7 +723,6 @@ class HookImpl:
734723
"argnames",
735724
"kwargnames",
736725
"plugin",
737-
"opts",
738726
"plugin_name",
739727
"wrapper",
740728
"hookwrapper",
@@ -764,9 +752,6 @@ def __init__(
764752
#: The :class:`HookimplConfiguration` used to configure this hook
765753
#: implementation.
766754
self.hookimpl_config: Final = hook_impl_config
767-
#: The :class:`HookimplOpts` used to configure this hook implementation
768-
#: (deprecated).
769-
self.opts: Final = hook_impl_config.to_opts()
770755
#: The name of the plugin which defined this hook implementation.
771756
self.plugin_name: Final = plugin_name
772757
#: Whether the hook implementation is a :ref:`wrapper <hookwrapper>`.

testing/benchmark.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from pluggy import PluginManager
1212
from pluggy._callers import _multicall
1313
from pluggy._hooks import HookImpl
14-
from pluggy._hooks import HookimplConfiguration
1514

1615

1716
hookspec = HookspecMarker("example")
@@ -47,7 +46,7 @@ def setup():
4746
None,
4847
"<temp>",
4948
method,
50-
HookimplConfiguration.from_opts(method.example_impl),
49+
hookimpl.get_hookconfig(method),
5150
)
5251
hook_impls.append(f)
5352
caller_kwargs = {"arg1": 1, "arg2": 2, "arg3": 3}

0 commit comments

Comments
 (0)