depdigest.DeclaredRegistry#

class depdigest.DeclaredRegistry(package_prefix, directory, declarations, attr_name='form_name', discovery_mode='filesystem', entrypoint_group=None, *, load_policy='strict')[source]#

Map declared identities to selectively loaded implementations.

declarations is a mapping or iterable of (identity, plugin_key) pairs. Keys/iteration/membership describe visible declarations, not successful imports. Values/items load implementations as their views are iterated. Failed imports raise KeyError with their cause retained; use retry to attempt them again. load_policy="strict" checks mapped soft dependencies before import. Explicit load_policy="adapter" permits Python adapter inspection without that precheck. Visibility still follows current configuration, and execution checks remain the host’s responsibility. Importability is not availability. Concurrent value requests serialize through initialization on this registry. Mutation/discovery/configuration changes require external coordination.

__init__(package_prefix, directory, declarations, attr_name='form_name', discovery_mode='filesystem', entrypoint_group=None, *, load_policy='strict')[source]#

Methods

__init__(package_prefix, directory, declarations)

clear()

Remove declarations, overrides and caches without importing plugins.

declared_keys()

Return all declared identities, including currently hidden ones.

discover()

Explicitly import eligible undeclared plugins and add their identities.

get(k[,d])

items()

keys()

loaded_keys()

Return visible identities with a cached implementation or override.

pop(k[,d])

value.

popitem()

as a 2-tuple; but raise KeyError if D is empty.

refresh()

Forget failed loads and entry-point metadata, retaining implementations.

retry(key)

Clear a recorded failure and request the identity again.

setdefault(k[,d])

update([E, ]**F)

If E present and has a .keys() method, does:

values()