processes 1.0.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.
- processes-1.0.2/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- processes-1.0.2/.github/ISSUE_TEMPLATE/custom.md +10 -0
- processes-1.0.2/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- processes-1.0.2/.github/workflows/docs.yml +17 -0
- processes-1.0.2/.github/workflows/lint-pr.yml +31 -0
- processes-1.0.2/.github/workflows/lint.yml +29 -0
- processes-1.0.2/.github/workflows/mypy.yml +27 -0
- processes-1.0.2/.github/workflows/publish.yml +47 -0
- processes-1.0.2/.github/workflows/tags.yml +29 -0
- processes-1.0.2/.github/workflows/tests.yml +34 -0
- processes-1.0.2/.gitignore +181 -0
- processes-1.0.2/CHANGELOG.md +23 -0
- processes-1.0.2/LICENSE +21 -0
- processes-1.0.2/PKG-INFO +155 -0
- processes-1.0.2/README.md +136 -0
- processes-1.0.2/assets/banner.svg +90 -0
- processes-1.0.2/docs/index.md +123 -0
- processes-1.0.2/docs/reference.md +6 -0
- processes-1.0.2/examples/01_basic_tasks_and_dependencies/README.md +163 -0
- processes-1.0.2/examples/01_basic_tasks_and_dependencies/example1.py +95 -0
- processes-1.0.2/examples/02_task_dependencies_result_passing/README.md +198 -0
- processes-1.0.2/examples/02_task_dependencies_result_passing/example2.py +194 -0
- processes-1.0.2/examples/README.md +112 -0
- processes-1.0.2/mkdocs.yml +31 -0
- processes-1.0.2/pyproject.toml +65 -0
- processes-1.0.2/pytest.ini +3 -0
- processes-1.0.2/src/processes/__init__.py +24 -0
- processes-1.0.2/src/processes/html_logging.py +201 -0
- processes-1.0.2/src/processes/process.py +417 -0
- processes-1.0.2/src/processes/task.py +302 -0
- processes-1.0.2/tests/__init__.py +0 -0
- processes-1.0.2/tests/log_cleaner.py +8 -0
- processes-1.0.2/tests/mail_config.example.toml +13 -0
- processes-1.0.2/tests/manual_test_email.py +103 -0
- processes-1.0.2/tests/test_args_kwargs.py +166 -0
- processes-1.0.2/tests/test_dependencies.py +266 -0
- processes-1.0.2/tests/test_examples.py +17 -0
- processes-1.0.2/tests/test_logfiles.py +130 -0
- processes-1.0.2/tests/test_normal_run_no_errors.py +166 -0
- processes-1.0.2/tests/test_unique_name.py +45 -0
- processes-1.0.2/uv.lock +1385 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**To Reproduce**
|
|
14
|
+
Steps to reproduce the behavior:
|
|
15
|
+
1. Go to '...'
|
|
16
|
+
2. Click on '....'
|
|
17
|
+
3. Scroll down to '....'
|
|
18
|
+
4. See error
|
|
19
|
+
|
|
20
|
+
**Expected behavior**
|
|
21
|
+
A clear and concise description of what you expected to happen.
|
|
22
|
+
|
|
23
|
+
**Screenshots**
|
|
24
|
+
If applicable, add screenshots to help explain your problem.
|
|
25
|
+
|
|
26
|
+
**Desktop (please complete the following information):**
|
|
27
|
+
- OS: [e.g. iOS]
|
|
28
|
+
- Browser [e.g. chrome, safari]
|
|
29
|
+
- Version [e.g. 22]
|
|
30
|
+
|
|
31
|
+
**Smartphone (please complete the following information):**
|
|
32
|
+
- Device: [e.g. iPhone6]
|
|
33
|
+
- OS: [e.g. iOS8.1]
|
|
34
|
+
- Browser [e.g. stock browser, safari]
|
|
35
|
+
- Version [e.g. 22]
|
|
36
|
+
|
|
37
|
+
**Additional context**
|
|
38
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
A clear and concise description of what you want to happen.
|
|
15
|
+
|
|
16
|
+
**Describe alternatives you've considered**
|
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: docs
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
permissions:
|
|
7
|
+
contents: write
|
|
8
|
+
jobs:
|
|
9
|
+
deploy:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: astral-sh/setup-uv@v5
|
|
14
|
+
- name: Install dependencies
|
|
15
|
+
run: uv sync --all-groups
|
|
16
|
+
- name: Build and Deploy
|
|
17
|
+
run: uv run mkdocs gh-deploy --force
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: "Lint PR"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
- edited
|
|
8
|
+
- synchronize
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
pull-requests: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
main:
|
|
15
|
+
name: Validate PR title
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: amannn/action-semantic-pull-request@v6
|
|
19
|
+
env:
|
|
20
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
21
|
+
with:
|
|
22
|
+
types: |
|
|
23
|
+
fix # A bug fix for the user, not a fix to a build script
|
|
24
|
+
feat # A new feature for the user, not a new feature for builds
|
|
25
|
+
docs # Changes to the documentation
|
|
26
|
+
style # Formatting, missing semi colons, etc; no production code change
|
|
27
|
+
refactor # Refactoring production code, eg. renaming a variable
|
|
28
|
+
perf # Code changes that improve performance
|
|
29
|
+
test # Adding missing tests, refactoring tests; no production code change
|
|
30
|
+
build # Changes that affect the build system or external dependencies
|
|
31
|
+
ci # Changes to our CI configuration files and scripts
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Install uv
|
|
16
|
+
uses: astral-sh/setup-uv@v5
|
|
17
|
+
with:
|
|
18
|
+
enable-cache: true # Speeds up future runs
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
run: uv python install # Uses the version from your pyproject.toml
|
|
22
|
+
|
|
23
|
+
- name: Run Ruff Check
|
|
24
|
+
# 'uv run' ensures we use the version in your lockfile
|
|
25
|
+
run: uv run ruff check .
|
|
26
|
+
|
|
27
|
+
- name: Run Ruff Format Check
|
|
28
|
+
# Fails if code isn't formatted according to your 100-char rule
|
|
29
|
+
run: uv run ruff format --check .
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: mypy-check
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Install uv
|
|
16
|
+
uses: astral-sh/setup-uv@v5
|
|
17
|
+
with:
|
|
18
|
+
enable-cache: true # Speeds up future runs
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
run: uv python install # Uses the version from your pyproject.toml
|
|
22
|
+
|
|
23
|
+
- name: Install Dependencies
|
|
24
|
+
run: uv sync --all-extras --dev
|
|
25
|
+
|
|
26
|
+
- name: Run mypy Check
|
|
27
|
+
run: uv run mypy src
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
quality-gate:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
- name: Install uv
|
|
13
|
+
uses: astral-sh/setup-uv@v5
|
|
14
|
+
|
|
15
|
+
- name: Install dependencies
|
|
16
|
+
run: uv sync --all-extras --dev
|
|
17
|
+
|
|
18
|
+
- name: Ruff Check
|
|
19
|
+
run: uv run ruff check .
|
|
20
|
+
|
|
21
|
+
- name: Ruff Format
|
|
22
|
+
run: uv run ruff format --check .
|
|
23
|
+
|
|
24
|
+
- name: Mypy
|
|
25
|
+
run: uv run mypy src
|
|
26
|
+
|
|
27
|
+
- name: Pytest
|
|
28
|
+
run: uv run pytest
|
|
29
|
+
|
|
30
|
+
build-n-publish:
|
|
31
|
+
name: Build and publish
|
|
32
|
+
needs: quality-gate
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
permissions:
|
|
35
|
+
id-token: write
|
|
36
|
+
contents: read
|
|
37
|
+
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v4
|
|
40
|
+
- name: Install uv
|
|
41
|
+
uses: astral-sh/setup-uv@v5
|
|
42
|
+
|
|
43
|
+
- name: Build package
|
|
44
|
+
run: uv build
|
|
45
|
+
|
|
46
|
+
- name: Publish to PyPI
|
|
47
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Tag Push Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*' # Triggers whenever you push a tag starting with 'v'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
name: Build and Publish to PyPI
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
id-token: write
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout Code
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Install uv
|
|
21
|
+
uses: astral-sh/setup-uv@v5
|
|
22
|
+
with:
|
|
23
|
+
enable-cache: true
|
|
24
|
+
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
run: uv python install
|
|
27
|
+
|
|
28
|
+
- name: Run Tests
|
|
29
|
+
run: uv run pytest
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Python Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [ main, master ]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ${{ matrix.os }}
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
15
|
+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout code
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Install uv
|
|
22
|
+
uses: astral-sh/setup-uv@v5
|
|
23
|
+
with:
|
|
24
|
+
version: "latest"
|
|
25
|
+
enable-cache: true
|
|
26
|
+
|
|
27
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
28
|
+
run: uv python install ${{ matrix.python-version }}
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: uv sync
|
|
32
|
+
|
|
33
|
+
- name: Run tests
|
|
34
|
+
run: uv run pytest
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# poetry
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
102
|
+
#poetry.lock
|
|
103
|
+
|
|
104
|
+
# pdm
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
106
|
+
#pdm.lock
|
|
107
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
108
|
+
# in version control.
|
|
109
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
110
|
+
.pdm.toml
|
|
111
|
+
.pdm-python
|
|
112
|
+
.pdm-build/
|
|
113
|
+
|
|
114
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
115
|
+
__pypackages__/
|
|
116
|
+
|
|
117
|
+
# Celery stuff
|
|
118
|
+
celerybeat-schedule
|
|
119
|
+
celerybeat.pid
|
|
120
|
+
|
|
121
|
+
# SageMath parsed files
|
|
122
|
+
*.sage.py
|
|
123
|
+
|
|
124
|
+
# Environments
|
|
125
|
+
.env
|
|
126
|
+
.venv
|
|
127
|
+
env/
|
|
128
|
+
venv/
|
|
129
|
+
ENV/
|
|
130
|
+
env.bak/
|
|
131
|
+
venv.bak/
|
|
132
|
+
|
|
133
|
+
# Spyder project settings
|
|
134
|
+
.spyderproject
|
|
135
|
+
.spyproject
|
|
136
|
+
|
|
137
|
+
# Rope project settings
|
|
138
|
+
.ropeproject
|
|
139
|
+
|
|
140
|
+
# mkdocs documentation
|
|
141
|
+
/site
|
|
142
|
+
|
|
143
|
+
# mypy
|
|
144
|
+
.mypy_cache/
|
|
145
|
+
.dmypy.json
|
|
146
|
+
dmypy.json
|
|
147
|
+
|
|
148
|
+
# Pyre type checker
|
|
149
|
+
.pyre/
|
|
150
|
+
|
|
151
|
+
# pytype static type analyzer
|
|
152
|
+
.pytype/
|
|
153
|
+
|
|
154
|
+
# Cython debug symbols
|
|
155
|
+
cython_debug/
|
|
156
|
+
|
|
157
|
+
# PyCharm
|
|
158
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
159
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
160
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
161
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
162
|
+
#.idea/
|
|
163
|
+
|
|
164
|
+
smtp_config.json
|
|
165
|
+
|
|
166
|
+
/.vscode
|
|
167
|
+
.vscode/*
|
|
168
|
+
|
|
169
|
+
!.vscode/settings.json
|
|
170
|
+
!.vscode/extensions.json
|
|
171
|
+
!.vscode/launch.json
|
|
172
|
+
|
|
173
|
+
mail_config.toml
|
|
174
|
+
|
|
175
|
+
.python-version
|
|
176
|
+
|
|
177
|
+
.ruff_cache
|
|
178
|
+
|
|
179
|
+
/logs/
|
|
180
|
+
logs/*
|
|
181
|
+
logs
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
## v1.0.2 (2026-01-19)
|
|
2
|
+
|
|
3
|
+
### Fix
|
|
4
|
+
|
|
5
|
+
- **ci**: added a workflow for publishing to pypi
|
|
6
|
+
|
|
7
|
+
## v1.0.1 (2026-01-19)
|
|
8
|
+
|
|
9
|
+
### Fix
|
|
10
|
+
|
|
11
|
+
- **lint**: fix ruff formatting
|
|
12
|
+
|
|
13
|
+
## v1.0.0 (2026-01-19)
|
|
14
|
+
|
|
15
|
+
### BREAKING CHANGE
|
|
16
|
+
|
|
17
|
+
- Task.run method had one of its kwargs removed
|
|
18
|
+
|
|
19
|
+
### Fix
|
|
20
|
+
|
|
21
|
+
- **Task-can-no-longer-pass-logger-to-its-function.-Changed-some-examples,-documentations-and-better-type-hints**: Task.run method no longer can pass logger to its function as kwarg
|
|
22
|
+
|
|
23
|
+
## v0.1.0 (2026-01-18)
|
processes-1.0.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Oliver Mohr
|
|
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.
|
processes-1.0.2/PKG-INFO
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: processes
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: A Python library for managing and executing dependent tasks in parallel or sequential order with automatic dependency resolution and topological sorting
|
|
5
|
+
Author-email: Oliver Mohr Bonometti <oliver.mohr.b@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: dag,dependencies,etl,parallel,process,tasks,topological-sort,workflow
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
<div align="center">
|
|
21
|
+
<img src="assets/banner.svg" width="100%" alt="Processes - Smart Task Orchestration">
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
# 🚀 Processes: Smart Task Orchestration
|
|
25
|
+
|
|
26
|
+
[](https://www.python.org/)
|
|
27
|
+
[](https://github.com/oliverm91/processes/actions/workflows/tests.yml)
|
|
28
|
+

|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
[](https://opensource.org/licenses/MIT)
|
|
32
|
+
[](https://oliverm91.github.io/processes/)
|
|
33
|
+
|
|
34
|
+
[](https://github.com/oliverm91/processes/actions/workflows/lint.yml)
|
|
35
|
+
[](https://github.com/oliverm91/processes/actions/workflows/mypy.yml)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
**Processes** is a lightweight, high-performance Python library designed to execute complex task graphs. It manages **dependencies**, handles **parallel execution**, and ensures system resilience without any external libraries.
|
|
42
|
+
|
|
43
|
+
File logging and **email notification** is supported.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 📑 Table of Contents
|
|
48
|
+
* [✨ Features](#-features)
|
|
49
|
+
* [⚙️ Core Concepts](#️-core-concepts)
|
|
50
|
+
* [🛠️ Use Cases](#️-use-cases)
|
|
51
|
+
* [💻 Quick Start](#-quick-start)
|
|
52
|
+
* [🛡️ Fault Tolerance & Logs](#️-fault-tolerance--logs)
|
|
53
|
+
* [📦 Installation](#-installation)
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## ✨ Features
|
|
58
|
+
|
|
59
|
+
* **🐍 Pure Python:** Zero external dependencies. Built entirely on the **Python Standard Library**.
|
|
60
|
+
* **⚡ Parallel Execution:** Built-in support for parallelization to maximize throughput.
|
|
61
|
+
* **🔗 Dependency Resolution:** Automatically sorts and executes tasks based on their requirements, regardless of input order.
|
|
62
|
+
* **📝 Shared Logging:** Multiple tasks can write to the same logfile or maintain separate ones seamlessly.
|
|
63
|
+
* **📧 Email Notifications:** Integrated SMTP support (including HTML) to alert you the moment an exception occurs.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## ⚙️ Core Concepts
|
|
68
|
+
|
|
69
|
+
The library operates on two main primitives:
|
|
70
|
+
|
|
71
|
+
1. **Task**: The atomic unit of work. It encapsulates a function, its parameters, its specific logfile, and its relationship with other tasks.
|
|
72
|
+
2. **Process**: The orchestrator. It builds the execution graph, validates dependencies, and manages the lifecycle of the entire workflow.
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## 🛠️ Use Cases
|
|
78
|
+
- **ETL Pipelines:** Fetch data from an API, transform it, and load it into a database as separate, dependent tasks.
|
|
79
|
+
|
|
80
|
+
- **System Maintenance:** Run parallel cleanup scripts, check server health, and receive email alerts if a specific check fails.
|
|
81
|
+
|
|
82
|
+
- **Automated Reporting:** Generate multiple data parts in parallel, aggregate them into a final report, and distribute via SMTP.
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 💻 Quick Start
|
|
88
|
+
Define your tasks and their dependencies. **Processes** will handle the execution order and data injection between tasks.
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
from datetime import date
|
|
92
|
+
|
|
93
|
+
from processes import Process, Task, TaskDependency, HTMLSMTPHandler
|
|
94
|
+
|
|
95
|
+
# 1. Setup Email Alerts (Optional)
|
|
96
|
+
smtp_handler = HTMLSMTPHandler(
|
|
97
|
+
('smtp_server', 587), 'sender@example.com', ['admin@example.com', 'user@example.com'],
|
|
98
|
+
use_tls=True, credentials=('user', 'pass')
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
# 2. If necessary, create wrappers for your Tasks.
|
|
102
|
+
def get_previous_working_day():
|
|
103
|
+
return date(2025, 12, 30)
|
|
104
|
+
def indep_task():
|
|
105
|
+
return "foo"
|
|
106
|
+
def search_and_sum_csv(t: date):
|
|
107
|
+
return 10
|
|
108
|
+
def sum_data_from_csv_and_x(x, a=1, b=2):
|
|
109
|
+
return x + a + b
|
|
110
|
+
|
|
111
|
+
# 3. Create the Task Graph (order is irrelevant, that is handled by Process)
|
|
112
|
+
tasks = [
|
|
113
|
+
Task("t-1", "etl.log", get_previous_working_day),
|
|
114
|
+
Task("intependent", "indep.log", indep_task, html_mail_handler=smtp_handler), # This task will send email on failure
|
|
115
|
+
Task("sum_csv", "etl.log", search_and_sum_csv,
|
|
116
|
+
dependencies= [
|
|
117
|
+
TaskDependency("t-1",
|
|
118
|
+
use_result_as_additional_args=True) # Adds result of t-1 task to search_and_sum_csv function as aditional args
|
|
119
|
+
]
|
|
120
|
+
),
|
|
121
|
+
Task("sum_x_and_csv", "etl.log", sum_data_from_csv_and_x,
|
|
122
|
+
args = (10,), kwargs = {"b": 100},
|
|
123
|
+
dependencies=[
|
|
124
|
+
TaskDependency("sum_csv",
|
|
125
|
+
use_result_as_additional_kwargs=True,
|
|
126
|
+
additional_kwarg_name="a")
|
|
127
|
+
]
|
|
128
|
+
)
|
|
129
|
+
]
|
|
130
|
+
|
|
131
|
+
# 4. Run the Process
|
|
132
|
+
with Process(tasks) as process: # Context Manager ensures correct disposal of loggers
|
|
133
|
+
process_result = process.run() # To enable parallelization use .run(parallel=True)
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 🛡️ Fault Tolerance & Logs
|
|
140
|
+
### Resilience by Design
|
|
141
|
+
If a `Task` raises an exception, the `Process` **does not stop**. It intelligently skips any tasks that depend on the failed one but continues to execute all other independent branches of your workflow.
|
|
142
|
+
|
|
143
|
+
### Advanced Logging
|
|
144
|
+
All tasks record their execution flow to their assigned logfiles. You can share a single logfile across the whole process or isolate specific tasks for easier debugging.
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 📦 Installation
|
|
150
|
+
|
|
151
|
+
Since it's a pure Python library, you can install it directly from the repository using `pip`:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
pip install git+https://github.com/oliverm91/processes.git
|
|
155
|
+
```
|