# step-exec-lib
[![build](https://github.com/giantswarm/step-exec-lib/actions/workflows/main.yml/badge.svg)](https://github.com/giantswarm/step-exec-lib/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/giantswarm/step-exec-lib/branch/master/graph/badge.svg)](https://codecov.io/gh/giantswarm/step-exec-lib)
[![PyPI Version](https://img.shields.io/pypi/v/step-exec-lib.svg)](https://pypi.org/project/step-exec-lib/)
[![Python Versions](https://img.shields.io/pypi/pyversions/step-exec-lib.svg)](https://pypi.org/project/step-exec-lib/)
[![Apache License](https://img.shields.io/badge/license-apache-blue.svg)](https://pypi.org/project/step-exec-lib/)
A simple library to easily orchestrate a set of Steps into a filtrable pipeline.
**Disclaimer**: docs are still work-in-progress!
Each step provides a defined set of actions. When a pipeline is execute first all `pre` actions
of all Steps are executed, then `run` actions and so on. Steps can provide labels, so
you can easily disable/enable a subset of steps.
A ready to use python app template. Based on `pipenv`.
## How to use the library
### BuildStep
The most important basic class is [BuildStep](step_exec_lib/steps.py). The class is abstract
and you have to inherit from it to provide any actual functionality. The most important methods and properties of
this class are:
* Each `BuildStep` provides a set of step names it is associated with in the `steps_provided` property.
These steps are used for filtering with `--steps`/`--skip-steps` command line options.
* `initialize_config` provides additional config options a specific class delivered from `BuildStep`
wants to provide.
* `pre_run` is optional and should be used for validation and assertions. `pre_runs` of all `BuildSteps` are executed
before any `run` method is executed. Its purpose is to allow the `abs`
to quit with error even before any actual build or tests are done. The method can't be blocking and should run
fast. If `pre_step` of any `BuildStep` fails, `run` methods of all `BuildSteps` are skipped.
* `run` is the method where actual long-running actions of the `BuildStep` are executed.
* `cleanup` is an optional method used to clean up resources that might have been needed by `run` but can't be cleaned
up until all `runs` have executed. `cleanups` are called after any `run` failed or all of them are done.
### BuildStepsFilteringPipeline
`BuildStep` class provides the `steps_provided` property, but is not in control of whether it should be executed or not
and when. `BuildSteps` have to be assembled into `pipelines`. The basic pipeline in `BuildStepsFilteringPipeline`, which
allows you to make a sequential pipeline out of your steps and filter and skip them according to `steps_provided` they
return and command line options `--steps`/`--skip-steps`. Each major part of `abs` execution is combined into a
pipeline, like `HelmBuildFilteringPipeline` used to execute build pipeline with Helm 3 or `PytestTestFilteringPipeline`
which is used to execute tests using `pytest` once the build pipeline is done.
Raw data
{
"_id": null,
"home_page": "https://github.com/giantswarm/step-exec-lib",
"name": "step-exec-lib",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.7",
"maintainer_email": null,
"keywords": "composition, steps",
"author": "\u0141ukasz Pi\u0105tkowski",
"author_email": "lukasz@giantswarm.io",
"download_url": "https://files.pythonhosted.org/packages/9b/8b/39283079a4c31d668746797a977ae0d4963833cb9ab62f918b559f74a2b1/step_exec_lib-0.2.0.tar.gz",
"platform": null,
"description": "# step-exec-lib\n\n[![build](https://github.com/giantswarm/step-exec-lib/actions/workflows/main.yml/badge.svg)](https://github.com/giantswarm/step-exec-lib/actions/workflows/main.yml)\n[![codecov](https://codecov.io/gh/giantswarm/step-exec-lib/branch/master/graph/badge.svg)](https://codecov.io/gh/giantswarm/step-exec-lib)\n[![PyPI Version](https://img.shields.io/pypi/v/step-exec-lib.svg)](https://pypi.org/project/step-exec-lib/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/step-exec-lib.svg)](https://pypi.org/project/step-exec-lib/)\n[![Apache License](https://img.shields.io/badge/license-apache-blue.svg)](https://pypi.org/project/step-exec-lib/)\n\nA simple library to easily orchestrate a set of Steps into a filtrable pipeline.\n\n**Disclaimer**: docs are still work-in-progress!\n\nEach step provides a defined set of actions. When a pipeline is execute first all `pre` actions\nof all Steps are executed, then `run` actions and so on. Steps can provide labels, so\nyou can easily disable/enable a subset of steps.\n\nA ready to use python app template. Based on `pipenv`.\n\n## How to use the library\n\n### BuildStep\n\nThe most important basic class is [BuildStep](step_exec_lib/steps.py). The class is abstract\nand you have to inherit from it to provide any actual functionality. The most important methods and properties of\nthis class are:\n\n* Each `BuildStep` provides a set of step names it is associated with in the `steps_provided` property.\n These steps are used for filtering with `--steps`/`--skip-steps` command line options.\n* `initialize_config` provides additional config options a specific class delivered from `BuildStep`\n wants to provide.\n* `pre_run` is optional and should be used for validation and assertions. `pre_runs` of all `BuildSteps` are executed\n before any `run` method is executed. Its purpose is to allow the `abs`\n to quit with error even before any actual build or tests are done. The method can't be blocking and should run\n fast. If `pre_step` of any `BuildStep` fails, `run` methods of all `BuildSteps` are skipped.\n* `run` is the method where actual long-running actions of the `BuildStep` are executed.\n* `cleanup` is an optional method used to clean up resources that might have been needed by `run` but can't be cleaned\n up until all `runs` have executed. `cleanups` are called after any `run` failed or all of them are done.\n\n### BuildStepsFilteringPipeline\n\n`BuildStep` class provides the `steps_provided` property, but is not in control of whether it should be executed or not\nand when. `BuildSteps` have to be assembled into `pipelines`. The basic pipeline in `BuildStepsFilteringPipeline`, which\nallows you to make a sequential pipeline out of your steps and filter and skip them according to `steps_provided` they\nreturn and command line options `--steps`/`--skip-steps`. Each major part of `abs` execution is combined into a\npipeline, like `HelmBuildFilteringPipeline` used to execute build pipeline with Helm 3 or `PytestTestFilteringPipeline`\nwhich is used to execute tests using `pytest` once the build pipeline is done.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "A library that helps execute pipeline of tasks using filters and simple composition",
"version": "0.2.0",
"project_urls": {
"Homepage": "https://github.com/giantswarm/step-exec-lib",
"Repository": "https://github.com/giantswarm/step-exec-lib"
},
"split_keywords": [
"composition",
" steps"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b4ab7ca40b6564a64ce2b4014c7f1315b43948d49d1ec52bd6fcf3410c97d23b",
"md5": "48ee3782603d7f31498d25e3c6dbe864",
"sha256": "73e65b37d9f96642fb288c6f800c679b315a228246350d533565c01bf7d02372"
},
"downloads": -1,
"filename": "step_exec_lib-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "48ee3782603d7f31498d25e3c6dbe864",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.7",
"size": 15216,
"upload_time": "2024-05-28T08:32:49",
"upload_time_iso_8601": "2024-05-28T08:32:49.354954Z",
"url": "https://files.pythonhosted.org/packages/b4/ab/7ca40b6564a64ce2b4014c7f1315b43948d49d1ec52bd6fcf3410c97d23b/step_exec_lib-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9b8b39283079a4c31d668746797a977ae0d4963833cb9ab62f918b559f74a2b1",
"md5": "e5efc8ed9fdaa7a38deba9a9dc9d840d",
"sha256": "6cf65cc9233f1be634ff91384157ec83bd6318f90db0cadab48c817aba4d64ae"
},
"downloads": -1,
"filename": "step_exec_lib-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "e5efc8ed9fdaa7a38deba9a9dc9d840d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.7",
"size": 13594,
"upload_time": "2024-05-28T08:32:51",
"upload_time_iso_8601": "2024-05-28T08:32:51.123409Z",
"url": "https://files.pythonhosted.org/packages/9b/8b/39283079a4c31d668746797a977ae0d4963833cb9ab62f918b559f74a2b1/step_exec_lib-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-28 08:32:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "giantswarm",
"github_project": "step-exec-lib",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"tox": true,
"lcname": "step-exec-lib"
}