yaml-workflow 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. yaml_workflow-0.1.2/.github/dependabot.yml +21 -0
  2. yaml_workflow-0.1.2/.github/workflows/ci.yml +73 -0
  3. yaml_workflow-0.1.2/.github/workflows/publish.yml +49 -0
  4. yaml_workflow-0.1.2/.github/workflows/release.yml +68 -0
  5. yaml_workflow-0.1.2/.gitignore +42 -0
  6. yaml_workflow-0.1.2/LICENSE +21 -0
  7. yaml_workflow-0.1.2/MANIFEST.in +24 -0
  8. yaml_workflow-0.1.2/PKG-INFO +125 -0
  9. yaml_workflow-0.1.2/README.md +61 -0
  10. yaml_workflow-0.1.2/docs/DOCUMENTATION_PLAN.md +267 -0
  11. yaml_workflow-0.1.2/docs/TASK_MODULES.md +409 -0
  12. yaml_workflow-0.1.2/docs/WORKFLOW_IMPROVEMENTS.md +873 -0
  13. yaml_workflow-0.1.2/docs/development.md +227 -0
  14. yaml_workflow-0.1.2/docs/tasks.md +78 -0
  15. yaml_workflow-0.1.2/docs/workflow-structure.md +103 -0
  16. yaml_workflow-0.1.2/pyproject.toml +105 -0
  17. yaml_workflow-0.1.2/src/yaml_workflow/__init__.py +5 -0
  18. yaml_workflow-0.1.2/src/yaml_workflow/__main__.py +4 -0
  19. yaml_workflow-0.1.2/src/yaml_workflow/cli.py +590 -0
  20. yaml_workflow-0.1.2/src/yaml_workflow/engine.py +559 -0
  21. yaml_workflow-0.1.2/src/yaml_workflow/examples/advanced_hello_world.yaml +184 -0
  22. yaml_workflow-0.1.2/src/yaml_workflow/examples/hello_world.yaml +39 -0
  23. yaml_workflow-0.1.2/src/yaml_workflow/examples/test_resume.yaml +54 -0
  24. yaml_workflow-0.1.2/src/yaml_workflow/exceptions.py +189 -0
  25. yaml_workflow-0.1.2/src/yaml_workflow/state.py +10 -0
  26. yaml_workflow-0.1.2/src/yaml_workflow/tasks/__init__.py +132 -0
  27. yaml_workflow-0.1.2/src/yaml_workflow/tasks/base.py +101 -0
  28. yaml_workflow-0.1.2/src/yaml_workflow/tasks/basic_tasks.py +86 -0
  29. yaml_workflow-0.1.2/src/yaml_workflow/tasks/batch_processor.py +428 -0
  30. yaml_workflow-0.1.2/src/yaml_workflow/tasks/file_tasks.py +556 -0
  31. yaml_workflow-0.1.2/src/yaml_workflow/tasks/file_utils.py +60 -0
  32. yaml_workflow-0.1.2/src/yaml_workflow/tasks/python_tasks.py +132 -0
  33. yaml_workflow-0.1.2/src/yaml_workflow/tasks/shell_tasks.py +144 -0
  34. yaml_workflow-0.1.2/src/yaml_workflow/tasks/template_tasks.py +53 -0
  35. yaml_workflow-0.1.2/src/yaml_workflow/workspace.py +358 -0
  36. yaml_workflow-0.1.2/tests/conftest.py +171 -0
  37. yaml_workflow-0.1.2/tests/test_batch_tasks.py +257 -0
  38. yaml_workflow-0.1.2/tests/test_cli.py +369 -0
  39. yaml_workflow-0.1.2/tests/test_custom_tasks.py +196 -0
  40. yaml_workflow-0.1.2/tests/test_engine.py +157 -0
  41. yaml_workflow-0.1.2/tests/test_examples.py +352 -0
  42. yaml_workflow-0.1.2/tests/test_file_tasks.py +307 -0
  43. yaml_workflow-0.1.2/tests/test_parallel.py +138 -0
  44. yaml_workflow-0.1.2/tests/test_python_tasks.py +89 -0
  45. yaml_workflow-0.1.2/tests/test_state.py +211 -0
  46. yaml_workflow-0.1.2/tests/test_template_tasks.py +175 -0
@@ -0,0 +1,21 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "pip"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ open-pull-requests-limit: 10
8
+ groups:
9
+ dependencies:
10
+ patterns:
11
+ - "*"
12
+
13
+ - package-ecosystem: "github-actions"
14
+ directory: "/"
15
+ schedule:
16
+ interval: "weekly"
17
+ open-pull-requests-limit: 10
18
+ groups:
19
+ github-actions:
20
+ patterns:
21
+ - "*"
@@ -0,0 +1,73 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches-ignore: ['main'] # Prevent direct pushes to main
6
+ pull_request:
7
+ branches: ['main'] # Only run on PRs targeting main
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install -e ".[test,dev]"
28
+
29
+ - name: Check formatting
30
+ run: |
31
+ black --check src tests
32
+ isort --check-only --profile black src tests
33
+
34
+ - name: Type checking
35
+ run: |
36
+ mypy src
37
+
38
+ - name: Run tests
39
+ run: |
40
+ pytest tests/ --cov --cov-branch --cov=yaml_workflow --cov-report=xml
41
+
42
+ - name: Upload coverage to Codecov (Attempt 1)
43
+ id: codecov1
44
+ uses: codecov/codecov-action@v5
45
+ continue-on-error: true
46
+ env:
47
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
48
+ with:
49
+ file: ./coverage.xml
50
+ fail_ci_if_error: false
51
+ token: ${{ secrets.CODECOV_TOKEN }}
52
+
53
+ - name: Upload coverage to Codecov (Attempt 2)
54
+ id: codecov2
55
+ if: steps.codecov1.outcome == 'failure'
56
+ uses: codecov/codecov-action@v5
57
+ continue-on-error: true
58
+ env:
59
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
60
+ with:
61
+ file: ./coverage.xml
62
+ fail_ci_if_error: false
63
+ token: ${{ secrets.CODECOV_TOKEN }}
64
+
65
+ - name: Upload coverage to Codecov (Final Attempt)
66
+ if: steps.codecov2.outcome == 'failure'
67
+ uses: codecov/codecov-action@v5
68
+ env:
69
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
70
+ with:
71
+ file: ./coverage.xml
72
+ fail_ci_if_error: true
73
+ token: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,49 @@
1
+ name: Build and Publish
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+ push:
8
+ tags:
9
+ - 'v*.*.*' # Match all version tags
10
+ - 'v*.*.*-test' # Match test release tags
11
+
12
+ jobs:
13
+ build-and-publish:
14
+ runs-on: ubuntu-latest
15
+ environment: ${{ contains(github.ref, '-test') && 'testpypi' || 'pypi' }}
16
+ permissions:
17
+ id-token: write
18
+ contents: read
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: "3.10"
26
+
27
+ - name: Install build dependencies
28
+ run: |
29
+ python -m pip install --upgrade pip
30
+ pip install build twine
31
+
32
+ - name: Build package
33
+ run: python -m build
34
+
35
+ - name: Run tests
36
+ run: |
37
+ pip install .[test]
38
+ pytest
39
+
40
+ - name: Publish to PyPI
41
+ if: ${{ !contains(github.ref, '-test') }}
42
+ uses: pypa/gh-action-pypi-publish@release/v1
43
+
44
+ - name: Publish to TestPyPI
45
+ if: contains(github.ref, '-test')
46
+ uses: pypa/gh-action-pypi-publish@release/v1
47
+ with:
48
+ repository-url: https://test.pypi.org/legacy/
49
+ skip-existing: true
@@ -0,0 +1,68 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
7
+ - 'v*.*.*-test' # Test releases
8
+
9
+ jobs:
10
+ release:
11
+ runs-on: ubuntu-latest
12
+ environment: release
13
+ permissions:
14
+ contents: write # Required for creating GitHub releases
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ with:
19
+ fetch-depth: 0 # Required for tag verification
20
+
21
+ - name: Set variables
22
+ id: vars
23
+ run: |
24
+ TAG=${GITHUB_REF#refs/tags/}
25
+ if [[ $TAG == *-test ]]; then
26
+ echo "is_test=true" >> $GITHUB_OUTPUT
27
+ echo "version=${TAG%-test}" >> $GITHUB_OUTPUT
28
+ else
29
+ echo "is_test=false" >> $GITHUB_OUTPUT
30
+ echo "version=$TAG" >> $GITHUB_OUTPUT
31
+ fi
32
+
33
+ - name: Verify tag version matches package version
34
+ if: ${{ !steps.vars.outputs.is_test }}
35
+ run: |
36
+ PACKAGE_VERSION=$(grep -m 1 'version = ' pyproject.toml | cut -d '"' -f 2)
37
+ if [ "${{ steps.vars.outputs.version }}" != "$PACKAGE_VERSION" ]; then
38
+ echo "Tag version (${{ steps.vars.outputs.version }}) does not match package version ($PACKAGE_VERSION)"
39
+ exit 1
40
+ fi
41
+
42
+ - name: Set up Python
43
+ uses: actions/setup-python@v5
44
+ with:
45
+ python-version: "3.10"
46
+
47
+ - name: Install dependencies
48
+ run: |
49
+ python -m pip install --upgrade pip
50
+ pip install build
51
+
52
+ - name: Build package
53
+ run: python -m build
54
+
55
+ - name: Create GitHub Release
56
+ if: ${{ !steps.vars.outputs.is_test }}
57
+ uses: softprops/action-gh-release@v2
58
+ with:
59
+ files: dist/*
60
+ generate_release_notes: true
61
+
62
+ - name: Create GitHub Pre-release
63
+ if: ${{ steps.vars.outputs.is_test }}
64
+ uses: softprops/action-gh-release@v2
65
+ with:
66
+ files: dist/*
67
+ prerelease: true
68
+ generate_release_notes: true
@@ -0,0 +1,42 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Virtual Environment
24
+ .env
25
+ .venv
26
+ env/
27
+ venv/
28
+ ENV/
29
+
30
+ # IDE
31
+ .idea/
32
+ .vscode/
33
+ *.swp
34
+ *.swo
35
+
36
+ # OS
37
+ .DS_Store
38
+ Thumbs.db
39
+
40
+ runs/
41
+ .coverage
42
+ /workflows/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 YAML Workflow Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,24 @@
1
+ include README.md
2
+ include LICENSE
3
+ include pyproject.toml
4
+ include MANIFEST.in
5
+ recursive-include src *.py
6
+ recursive-include src *.pyi
7
+ recursive-include src/yaml_workflow/examples *.yaml
8
+ recursive-include docs *.md
9
+ recursive-include tests *.py
10
+ recursive-include tests *.yaml
11
+ global-exclude *.pyc
12
+ global-exclude *.pyo
13
+ global-exclude *.pyd
14
+ global-exclude .git*
15
+ global-exclude .DS_Store
16
+ global-exclude *.swp
17
+ global-exclude *.swo
18
+ recursive-exclude * __pycache__
19
+ recursive-exclude * *.py[cod]
20
+ recursive-exclude .pytest_cache *
21
+ recursive-exclude .mypy_cache *
22
+ recursive-exclude build *
23
+ recursive-exclude dist *
24
+ recursive-exclude *.egg-info *
@@ -0,0 +1,125 @@
1
+ Metadata-Version: 2.4
2
+ Name: yaml-workflow
3
+ Version: 0.1.2
4
+ Summary: A lightweight, powerful, and flexible workflow engine that executes tasks defined in YAML configuration files
5
+ Project-URL: Homepage, https://github.com/orieg/yaml-workflow
6
+ Project-URL: Issues, https://github.com/orieg/yaml-workflow/issues
7
+ Project-URL: Documentation, https://github.com/orieg/yaml-workflow#readme
8
+ Author-email: Nicolas Brousse <nicolas@brousse.info>
9
+ License: MIT License
10
+
11
+ Copyright (c) 2024 YAML Workflow Contributors
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+ License-File: LICENSE
31
+ Keywords: automation,batch-processing,configuration,data-pipeline,data-processing,distributed-tasks,etl,job-scheduler,modular-workflows,orchestration,parallel-processing,pipeline,process-automation,reports,retry-mechanism,state-management,task-orchestration,task-runner,templating,workflow,workflow-automation,workflow-engine,workflow-management,yaml,yaml-configuration
32
+ Classifier: Development Status :: 4 - Beta
33
+ Classifier: Intended Audience :: Developers
34
+ Classifier: Intended Audience :: Information Technology
35
+ Classifier: Intended Audience :: System Administrators
36
+ Classifier: License :: OSI Approved :: MIT License
37
+ Classifier: Natural Language :: English
38
+ Classifier: Operating System :: OS Independent
39
+ Classifier: Programming Language :: Python :: 3
40
+ Classifier: Programming Language :: Python :: 3.10
41
+ Classifier: Programming Language :: Python :: 3.11
42
+ Classifier: Programming Language :: Python :: 3.12
43
+ Classifier: Programming Language :: Python :: 3.13
44
+ Classifier: Topic :: Software Development :: Build Tools
45
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
46
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
47
+ Classifier: Topic :: System :: Systems Administration
48
+ Classifier: Typing :: Typed
49
+ Requires-Python: >=3.10
50
+ Requires-Dist: click>=8.0
51
+ Requires-Dist: jinja2>=3.0
52
+ Requires-Dist: pyyaml>=6.0
53
+ Provides-Extra: dev
54
+ Requires-Dist: black==25.1.0; extra == 'dev'
55
+ Requires-Dist: build>=1.0.0; extra == 'dev'
56
+ Requires-Dist: isort>=5.0; extra == 'dev'
57
+ Requires-Dist: mypy>=1.0; extra == 'dev'
58
+ Requires-Dist: twine>=4.0.0; extra == 'dev'
59
+ Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
60
+ Provides-Extra: test
61
+ Requires-Dist: pytest-cov>=4.0; extra == 'test'
62
+ Requires-Dist: pytest>=7.0; extra == 'test'
63
+ Description-Content-Type: text/markdown
64
+
65
+ # YAML Workflow
66
+
67
+ A lightweight, powerful, and flexible workflow engine that executes tasks defined in YAML configuration files. This engine allows you to create modular, reusable workflows by connecting tasks through YAML definitions, with support for parallel processing, batch operations, and state management.
68
+
69
+ ## Features
70
+
71
+ - 📝 YAML-driven workflow definition
72
+ - 🔌 Dynamic module and function loading
73
+ - 🔄 Input/output variable management
74
+ - ⚠️ Comprehensive error handling
75
+ - 🔁 Retry mechanisms
76
+ - ⚡ Parallel processing support
77
+ - 📊 Progress tracking and logging
78
+ - 💾 State persistence and resume capability
79
+ - 🔄 Batch processing with chunking
80
+ - 🌐 Template variable substitution
81
+ - 🔀 Flow control with custom step sequences
82
+
83
+ ## Quick Start
84
+
85
+ 1. Install the package:
86
+ ```bash
87
+ pip install yaml-workflow
88
+ ```
89
+
90
+ 2. Initialize example workflows:
91
+ ```bash
92
+ # Create workflows directory with examples
93
+ yaml-workflow init
94
+
95
+ # Or specify a custom directory
96
+ yaml-workflow init --dir my-workflows
97
+
98
+ # Initialize with specific examples only
99
+ yaml-workflow init --example hello_world
100
+ ```
101
+
102
+ 3. Run the example workflow:
103
+ ```bash
104
+ # Run with input parameters
105
+ yaml-workflow run workflows/hello_world.yaml name=Alice
106
+
107
+ # List available workflows
108
+ yaml-workflow list
109
+
110
+ # Validate a workflow
111
+ yaml-workflow validate workflows/hello_world.yaml
112
+
113
+ # Resume a failed workflow
114
+ yaml-workflow run workflows/hello_world.yaml --resume
115
+ ```
116
+
117
+ ## Documentation
118
+
119
+ - [Task Types](https://github.com/orieg/yaml-workflow/blob/main/docs/tasks.md) - Available task types and how to use them
120
+ - [Workflow Structure](https://github.com/orieg/yaml-workflow/blob/main/docs/workflow-structure.md) - Detailed workflow configuration
121
+ - [Development Guide](https://github.com/orieg/yaml-workflow/blob/main/docs/development.md) - Setup, building, and contributing
122
+
123
+ ## License
124
+
125
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,61 @@
1
+ # YAML Workflow
2
+
3
+ A lightweight, powerful, and flexible workflow engine that executes tasks defined in YAML configuration files. This engine allows you to create modular, reusable workflows by connecting tasks through YAML definitions, with support for parallel processing, batch operations, and state management.
4
+
5
+ ## Features
6
+
7
+ - 📝 YAML-driven workflow definition
8
+ - 🔌 Dynamic module and function loading
9
+ - 🔄 Input/output variable management
10
+ - ⚠️ Comprehensive error handling
11
+ - 🔁 Retry mechanisms
12
+ - ⚡ Parallel processing support
13
+ - 📊 Progress tracking and logging
14
+ - 💾 State persistence and resume capability
15
+ - 🔄 Batch processing with chunking
16
+ - 🌐 Template variable substitution
17
+ - 🔀 Flow control with custom step sequences
18
+
19
+ ## Quick Start
20
+
21
+ 1. Install the package:
22
+ ```bash
23
+ pip install yaml-workflow
24
+ ```
25
+
26
+ 2. Initialize example workflows:
27
+ ```bash
28
+ # Create workflows directory with examples
29
+ yaml-workflow init
30
+
31
+ # Or specify a custom directory
32
+ yaml-workflow init --dir my-workflows
33
+
34
+ # Initialize with specific examples only
35
+ yaml-workflow init --example hello_world
36
+ ```
37
+
38
+ 3. Run the example workflow:
39
+ ```bash
40
+ # Run with input parameters
41
+ yaml-workflow run workflows/hello_world.yaml name=Alice
42
+
43
+ # List available workflows
44
+ yaml-workflow list
45
+
46
+ # Validate a workflow
47
+ yaml-workflow validate workflows/hello_world.yaml
48
+
49
+ # Resume a failed workflow
50
+ yaml-workflow run workflows/hello_world.yaml --resume
51
+ ```
52
+
53
+ ## Documentation
54
+
55
+ - [Task Types](https://github.com/orieg/yaml-workflow/blob/main/docs/tasks.md) - Available task types and how to use them
56
+ - [Workflow Structure](https://github.com/orieg/yaml-workflow/blob/main/docs/workflow-structure.md) - Detailed workflow configuration
57
+ - [Development Guide](https://github.com/orieg/yaml-workflow/blob/main/docs/development.md) - Setup, building, and contributing
58
+
59
+ ## License
60
+
61
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.