A pipen cli plugin to check requirements for processes of a pipeline
Project description
pipen-cli-run
Checking the requirements for processes of a pipeline
Install
pip install -U pipen-cli-require
Usage
Defining requirements of a process
# pipeline.py
from pipen import Pipen, Proc
class P1(Proc):
"""Process 1
Requires:
- name: pipen
message: Run `pip install -U pipen` to install
check: |
{{proc.lang}} -c "import pipen"
- name: liquidpy
message: Run `pip install -U liquidpy` to install
check: |
{{proc.lang}} -c "import liquid"
- name: nonexist
message: Run `pip install -U nonexist` to install
check: |
{{proc.lang}} -c "import nonexist"
"""
input = "a"
output = "outfile:file:out.txt"
lang = "python"
# Setup the pipeline
# Must be outside __main__
# Or define a function to return the pipeline
pipeline = Pipen(...)
if __name__ == '__main__':
# Pipeline must be executed with __main__
pipeline.run()
Checking the requirements via the CLI
> pipen require -v -n 2 tests/example_pipeline.py:example_pipeline
Checking requirements for pipeline: EXAMPLE_PIPELINE
└── P1: Process 1
├── ✔️ pipen
├── ✔️ liquidpy
└── x nonexist: Run `pip install -U nonexist` to install
└── Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'nonexist'
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 pipen_cli_require-0.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 112c60eab468be99e51ebde0c506f7fa284f26486dcab9617cfdc22066656b7f |
|
MD5 | 340f9bea7cf85ea4c8ff34cd0b99cdd8 |
|
BLAKE2b-256 | 8e2d77f52295474162c19aa06859ea89666184f3433809ec633bb2e92485686b |