From b6d2656822a43374860b2139b0620639d42dca3f Mon Sep 17 00:00:00 2001 From: faph Date: Wed, 1 Nov 2023 17:09:44 +0000 Subject: [PATCH] Use pluggy's new public HookCaller type for type hints --- pyproject.toml | 2 +- src/py_adapter/plugin/__init__.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4b8d41c..a75d291 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ dependencies = [ "fastavro~=1.8", # TODO: consider moving Avro-related dependencies to optional dependencies "memoization~=0.4", "orjson~=3.0", - "pluggy~=1.2", + "pluggy~=1.3", "py-avro-schema~=3.0", "python-dateutil~=2.8", ] diff --git a/src/py_adapter/plugin/__init__.py b/src/py_adapter/plugin/__init__.py index 2dea2b2..0070163 100644 --- a/src/py_adapter/plugin/__init__.py +++ b/src/py_adapter/plugin/__init__.py @@ -22,8 +22,6 @@ import pluggy if TYPE_CHECKING: - from pluggy._hooks import _HookCaller - import py_adapter logger = logging.getLogger(__package__) @@ -66,7 +64,7 @@ def _load_default_plugins(manager_: pluggy.PluginManager) -> None: manager_.register(plugin, name=name) -def plugin_hook(plugin_name: str, hook_name: str) -> "_HookCaller": +def plugin_hook(plugin_name: str, hook_name: str) -> pluggy.HookCaller: """ Return a hook (caller) for a single named plugin and hook name