Extensions
Extension system for extending DiracX functionality.
extensions
Attributes
T = TypeVar('T')
module-attribute
P = ParamSpec('P')
module-attribute
Functions
extensions_by_priority()
Yield extension module names in order of priority.
NOTE: This function is duplicated in diracx._client_importer to avoid importing diracx in the MetaPathFinder as part of unrelated imports (e.g. http.client).
Source code in diracx-core/src/diracx/core/extensions.py
select_from_extension(*, group, name=None)
Select entry points by group and name, in order of priority.
Source code in diracx-core/src/diracx/core/extensions.py
supports_extending(group, name)
Decorator to replace a function with an extension implementation.
This decorator looks for an entry point in the specified group and name, and if found, replaces the decorated function with the extension's implementation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
group
|
str
|
The entry point group to search in |
required |
name
|
str
|
The entry point name to search for |
required |
Example
@supports_extending("diracx.resources", "find_compatible_platforms") def my_function(): return "default implementation"