# step-exec-lib
[](https://github.com/giantswarm/step-exec-lib/actions/workflows/main.yml)
[](https://codecov.io/gh/giantswarm/step-exec-lib)
[](https://pypi.org/project/step-exec-lib/)
[](https://pypi.org/project/step-exec-lib/)
[](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.10",
"maintainer_email": null,
"keywords": "composition, steps",
"author": "\u0141ukasz Pi\u0105tkowski",
"author_email": "lukasz@giantswarm.io",
"download_url": "https://files.pythonhosted.org/packages/e2/68/4a8e50e8bdd12a9d1e90ba2e046cd171ec57b22aba79b7856c97bc36aec4/step_exec_lib-0.4.1.tar.gz",
"platform": null,
"description": "# step-exec-lib\n\n[](https://github.com/giantswarm/step-exec-lib/actions/workflows/main.yml)\n[](https://codecov.io/gh/giantswarm/step-exec-lib)\n[](https://pypi.org/project/step-exec-lib/)\n[](https://pypi.org/project/step-exec-lib/)\n[](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.4.1",
"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": "0693cd8ef804b222ea3eb2e6902d138f63960bddeecb71ac0c48b159729d9b31",
"md5": "96cf274331ecb90f75caae90ea287caf",
"sha256": "91dee1173793d068b2429588e164e780ddbf2f8e17e6afffe3dcc1dc7a71aa42"
},
"downloads": -1,
"filename": "step_exec_lib-0.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "96cf274331ecb90f75caae90ea287caf",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 14440,
"upload_time": "2024-12-03T10:50:32",
"upload_time_iso_8601": "2024-12-03T10:50:32.624487Z",
"url": "https://files.pythonhosted.org/packages/06/93/cd8ef804b222ea3eb2e6902d138f63960bddeecb71ac0c48b159729d9b31/step_exec_lib-0.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e2684a8e50e8bdd12a9d1e90ba2e046cd171ec57b22aba79b7856c97bc36aec4",
"md5": "dec4ffca3635268de0cd81be469d75a8",
"sha256": "027fbad3f9c06287260016c135a93977948688211fc152d33ee6e789561e9e87"
},
"downloads": -1,
"filename": "step_exec_lib-0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "dec4ffca3635268de0cd81be469d75a8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 13046,
"upload_time": "2024-12-03T10:50:33",
"upload_time_iso_8601": "2024-12-03T10:50:33.505729Z",
"url": "https://files.pythonhosted.org/packages/e2/68/4a8e50e8bdd12a9d1e90ba2e046cd171ec57b22aba79b7856c97bc36aec4/step_exec_lib-0.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-03 10:50:33",
"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"
}