pluginkit 0.4.2__tar.gz → 0.4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pluginkit-0.4.2 → pluginkit-0.4.3}/PKG-INFO +1 -1
- {pluginkit-0.4.2 → pluginkit-0.4.3}/pyproject.toml +1 -1
- {pluginkit-0.4.2 → pluginkit-0.4.3}/src/pluginkit/manager.py +8 -1
- {pluginkit-0.4.2 → pluginkit-0.4.3}/LICENSE +0 -0
- {pluginkit-0.4.2 → pluginkit-0.4.3}/README.md +0 -0
- {pluginkit-0.4.2 → pluginkit-0.4.3}/src/pluginkit/__init__.py +0 -0
- {pluginkit-0.4.2 → pluginkit-0.4.3}/src/pluginkit/aio.py +0 -0
- {pluginkit-0.4.2 → pluginkit-0.4.3}/src/pluginkit/exceptions.py +0 -0
- {pluginkit-0.4.2 → pluginkit-0.4.3}/src/pluginkit/markers.py +0 -0
- {pluginkit-0.4.2 → pluginkit-0.4.3}/src/pluginkit/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pluginkit"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.3"
|
|
4
4
|
description = "A strictly-typed, generics-first plugin framework for Python 3.13: hooks with derived return types"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [{ name = "Morten Hansen", email = "morten@winterop.com" }]
|
|
@@ -203,7 +203,9 @@ class HookCaller:
|
|
|
203
203
|
if not self.spec.historic:
|
|
204
204
|
raise TypeError(f"hook {self.name!r} is not historic")
|
|
205
205
|
kwargs = self.check_arguments(kwargs)
|
|
206
|
-
|
|
206
|
+
# Snapshot the event so a later mutation of the caller's dict can't change
|
|
207
|
+
# what plugins registered after this call replay.
|
|
208
|
+
self._history.append((dict(kwargs), result_callback))
|
|
207
209
|
for outcome in self._collect(kwargs):
|
|
208
210
|
if result_callback is not None:
|
|
209
211
|
result_callback(outcome)
|
|
@@ -411,6 +413,11 @@ class PluginManager:
|
|
|
411
413
|
for name, parameter in signature.parameters.items()
|
|
412
414
|
if parameter.default is not inspect.Parameter.empty
|
|
413
415
|
}
|
|
416
|
+
if self.hook._get_caller(member_name) is not None:
|
|
417
|
+
raise ValueError(
|
|
418
|
+
f"extension point {member_name!r} is already registered; "
|
|
419
|
+
f"re-adding it would drop the implementations already wired to it"
|
|
420
|
+
)
|
|
414
421
|
self._validate_spec(member_name, spec, params)
|
|
415
422
|
self.hook._add_caller(self._make_caller(member_name, spec, params, defaults))
|
|
416
423
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|