跳转到主要内容

AboutCode Pipeline库。按步骤执行代码。

项目描述

aboutcode.pipeline

定义和运行流水线。

安装

pip install aboutcode.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()

组和步骤选择

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()

项目详情


下载文件

下载适用于您平台文件的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

aboutcode_pipeline-0.1.0.tar.gz (8.6 kB 查看哈希值)

上传时间 源码

构建分发版

aboutcode_pipeline-0.1.0-py3-none-any.whl (11.2 kB 查看哈希值)

上传时间 Python 3

由以下支持