pipeline
Simple pipeline workflow processing.
| CLASS | DESCRIPTION |
|---|---|
Action |
An action to perform in a pipeline. |
Pipeline |
A collection of actions to perform on an input. |
| FUNCTION | DESCRIPTION |
|---|---|
import_function |
Import a function from a dotted path. |
noop_func |
A function that does nothing when called. |
pipeline_factory |
Create a |
Attributes¶
Classes¶
Action
¶
Action(
action: str,
id_: Optional[str] = None,
args: Optional[list] = None,
kwargs: Optional[dict] = None,
commit_metadata_func: Optional[Callable] = None,
version_metadata_func: Optional[Callable] = None,
)
An action to perform in a pipeline.
| METHOD | DESCRIPTION |
|---|---|
run |
Perform the action on the input. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
commit_metadata_func |
Function the action can call to set metadata about the commit.
TYPE:
|
id |
Identifier for the action.
TYPE:
|
version_metadata_func |
Function the action can call to set metadata about the version a commit belongs to.
TYPE:
|
Attributes¶
commit_metadata_func
instance-attribute
¶
commit_metadata_func: Optional[Callable] = commit_metadata_func or noop_func
Function the action can call to set metadata about the commit.
version_metadata_func
instance-attribute
¶
version_metadata_func: Optional[Callable] = version_metadata_func or noop_func
Function the action can call to set metadata about the version a commit belongs to.
Functions¶
run
¶
run(context: dict, input_value: Any) -> str
Perform the action on the input.
| PARAMETER | DESCRIPTION |
|---|---|
context
|
The current pipeline context for rendering
TYPE:
|
input_value
|
The value to processes
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The processed string |
Pipeline
¶
Pipeline(actions: Union[list, tuple], **kwargs)
A collection of actions to perform on an input.
| METHOD | DESCRIPTION |
|---|---|
run |
Run the pipeline using |
| ATTRIBUTE | DESCRIPTION |
|---|---|
actions |
The actions to perform on the input.
TYPE:
|
context |
The current state of the pipeline initialized by keyword arguments.
TYPE:
|
Attributes¶
context
instance-attribute
¶
context: dict = copy()
The current state of the pipeline initialized by keyword arguments.
Functions¶
run
¶
run(input_value: Optional[str] = None) -> str
Run the pipeline using input_value as the starting point.
| PARAMETER | DESCRIPTION |
|---|---|
input_value
|
An optional string value to start the pipeline.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The processed result of the pipeline. |
Functions¶
import_function
¶
import_function(function_path: str) -> Callable
Import a function from a dotted path.
Examples:
>>> import_function("generate_changelog.pipeline.noop_func")
<function noop_func at 0x11016d280>
| PARAMETER | DESCRIPTION |
|---|---|
function_path
|
A dotted path to a function
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Callable
|
The callable function |
pipeline_factory
¶
pipeline_factory(
action_list: list,
commit_metadata_func: Optional[Callable] = None,
version_metadata_func: Optional[Callable] = None,
**kwargs: Any
) -> Pipeline
Create a Pipeline from a list of actions specified by dictionaries.
| PARAMETER | DESCRIPTION |
|---|---|
action_list
|
A
TYPE:
|
commit_metadata_func
|
Optional callable that actions can use to set commit metadata
TYPE:
|
version_metadata_func
|
Optional callable that actions can use to set version metadata
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Pipeline
|
The instantiated Pipeline |