This PR cleans up some odd use of global state (an extension registry that lived on the ExtensionPoint trait type class) that's never used in practice.
In detail:
ExtensionPointBinding no longer uses ExtensionPoint.extension_registry as the default extension registry. (Note that ExtensionPoint.extension_registry doesn't exist unless it's explicitly injected from some external source.)
The tests for bind_extension_point no longer inject a registry onto the ExtensionPoint trait type class, and have been updated to use an explicit registry everywhere
The extension_registry argument to bind_extension_point is now required rather than optional
The bind static method on the ExtensionPoint trait type, which doesn't support specifying an extension registry, has been removed. If any users of this exist, they should use bind_extension_point instead.
My original plan was to deprecate calls to bind_extension_point that didn't specify a registry. That changed when I discovered that those calls only work after a deliberate injection of a registry onto the ExtensionPoint trait type class. To the best of my knowledge, no code is doing that (outside of test_extension_point_binding in this package), and all uses of bind_extension_point that I found in the wild are already supplying a registry explicitly. I also found no uses of the ExtensionPoint.bind static method. So I think in this case deprecation is unnecessary and we can simply remove the functionality.
This PR cleans up some odd use of global state (an extension registry that lived on the
ExtensionPoint
trait type class) that's never used in practice.In detail:
ExtensionPointBinding
no longer usesExtensionPoint.extension_registry
as the default extension registry. (Note thatExtensionPoint.extension_registry
doesn't exist unless it's explicitly injected from some external source.)bind_extension_point
no longer inject a registry onto theExtensionPoint
trait type class, and have been updated to use an explicit registry everywhereextension_registry
argument tobind_extension_point
is now required rather than optionalbind
static method on theExtensionPoint
trait type, which doesn't support specifying an extension registry, has been removed. If any users of this exist, they should usebind_extension_point
instead.My original plan was to deprecate calls to
bind_extension_point
that didn't specify a registry. That changed when I discovered that those calls only work after a deliberate injection of a registry onto theExtensionPoint
trait type class. To the best of my knowledge, no code is doing that (outside oftest_extension_point_binding
in this package), and all uses ofbind_extension_point
that I found in the wild are already supplying a registry explicitly. I also found no uses of theExtensionPoint.bind
static method. So I think in this case deprecation is unnecessary and we can simply remove the functionality.xref: #97