AboutCode Pipeline library. Execute code in steps.
Project description
aboutcode.pipeline
Define and run pipelines.
Install
pip install aboutcode.pipeline
Define and execute a pipeline
from aboutcode.pipeline import BasePipeline
class PrintMessages(BasePipeline):
@classmethod
def steps(cls):
return (cls.step1,)
def step1(self):
print("Message from step1")
PrintMessages().execute()
Groups and steps selection
from aboutcode.pipeline import BasePipeline
from aboutcode.pipeline import group
class PrintMessages(BasePipeline):
@classmethod
def steps(cls):
return (cls.step1, cls.step2)
def step1(self):
print("Message from step1")
@group("foo")
def step2(self):
print("Message from step2")
# Execute pipeline with group selection
run = PrintMessages(selected_groups=["foo"])
exitcode, error = run.execute()
# Execute pipeline with steps selection
run = PrintMessages(selected_steps=["step1"])
exitcode, error = run.execute()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for aboutcode_pipeline-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07ac77ee76d0acc237c5dfbcdeab2fd3289e24cbd503e1dc54178990a9466ca6 |
|
MD5 | e4c2d4fbd8df5639683f621517d8cdda |
|
BLAKE2b-256 | 6d97e36c49a998606e8f14549f03cabe7901362799c50346823b4e759ba6aed5 |