ddeutil-workflow 0.0.16__tar.gz → 0.0.18__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 (70) hide show
  1. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/PKG-INFO +27 -23
  2. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/README.md +24 -21
  3. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/pyproject.toml +4 -2
  4. ddeutil_workflow-0.0.18/src/ddeutil/workflow/__about__.py +1 -0
  5. ddeutil_workflow-0.0.16/src/ddeutil/workflow/cron.py → ddeutil_workflow-0.0.18/src/ddeutil/workflow/__cron.py +12 -6
  6. ddeutil_workflow-0.0.18/src/ddeutil/workflow/__init__.py +72 -0
  7. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/src/ddeutil/workflow/api.py +1 -2
  8. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/src/ddeutil/workflow/cli.py +1 -2
  9. ddeutil_workflow-0.0.18/src/ddeutil/workflow/conf.py +483 -0
  10. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/src/ddeutil/workflow/job.py +77 -39
  11. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/src/ddeutil/workflow/on.py +10 -7
  12. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/src/ddeutil/workflow/repeat.py +2 -3
  13. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/src/ddeutil/workflow/route.py +1 -2
  14. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/src/ddeutil/workflow/scheduler.py +38 -32
  15. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/src/ddeutil/workflow/stage.py +49 -19
  16. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/src/ddeutil/workflow/utils.py +22 -22
  17. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/src/ddeutil_workflow.egg-info/PKG-INFO +27 -23
  18. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/src/ddeutil_workflow.egg-info/SOURCES.txt +9 -5
  19. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/src/ddeutil_workflow.egg-info/requires.txt +2 -1
  20. ddeutil_workflow-0.0.16/tests/test_cron.py → ddeutil_workflow-0.0.18/tests/test__cron.py +35 -9
  21. ddeutil_workflow-0.0.18/tests/test_conf.py +100 -0
  22. ddeutil_workflow-0.0.18/tests/test_conf_log.py +89 -0
  23. ddeutil_workflow-0.0.18/tests/test_job.py +70 -0
  24. ddeutil_workflow-0.0.18/tests/test_job_py.py +141 -0
  25. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_job_strategy.py +18 -9
  26. ddeutil_workflow-0.0.18/tests/test_job_strategy_run.py +75 -0
  27. ddeutil_workflow-0.0.18/tests/test_on.py +190 -0
  28. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_scheduler.py +54 -4
  29. ddeutil_workflow-0.0.18/tests/test_scheduler_tasks.py +72 -0
  30. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_stage.py +6 -10
  31. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_stage_hook.py +5 -15
  32. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_stage_py.py +28 -3
  33. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_utils.py +8 -14
  34. ddeutil_workflow-0.0.18/tests/test_utils_filter.py +80 -0
  35. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_utils_params.py +0 -3
  36. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_utils_result.py +8 -0
  37. ddeutil_workflow-0.0.18/tests/test_workflow.py +156 -0
  38. ddeutil_workflow-0.0.18/tests/test_workflow_job_run.py +28 -0
  39. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_workflow_matrix.py +1 -4
  40. ddeutil_workflow-0.0.18/tests/test_workflow_params.py +23 -0
  41. ddeutil_workflow-0.0.18/tests/test_workflow_poke.py +22 -0
  42. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_workflow_run.py +37 -11
  43. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_workflow_task.py +1 -4
  44. ddeutil_workflow-0.0.16/src/ddeutil/workflow/__about__.py +0 -1
  45. ddeutil_workflow-0.0.16/src/ddeutil/workflow/__init__.py +0 -24
  46. ddeutil_workflow-0.0.16/src/ddeutil/workflow/conf.py +0 -318
  47. ddeutil_workflow-0.0.16/src/ddeutil/workflow/log.py +0 -195
  48. ddeutil_workflow-0.0.16/tests/test_job.py +0 -18
  49. ddeutil_workflow-0.0.16/tests/test_job_py.py +0 -47
  50. ddeutil_workflow-0.0.16/tests/test_log.py +0 -24
  51. ddeutil_workflow-0.0.16/tests/test_on.py +0 -67
  52. ddeutil_workflow-0.0.16/tests/test_poke.py +0 -13
  53. ddeutil_workflow-0.0.16/tests/test_workflow.py +0 -75
  54. ddeutil_workflow-0.0.16/tests/test_workflow_params.py +0 -12
  55. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/LICENSE +0 -0
  56. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/setup.cfg +0 -0
  57. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/src/ddeutil/workflow/__types.py +0 -0
  58. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/src/ddeutil/workflow/exceptions.py +0 -0
  59. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/src/ddeutil_workflow.egg-info/dependency_links.txt +0 -0
  60. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/src/ddeutil_workflow.egg-info/entry_points.txt +0 -0
  61. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/src/ddeutil_workflow.egg-info/top_level.txt +0 -0
  62. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test__conf_exist.py +0 -0
  63. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test__regex.py +0 -0
  64. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_params.py +0 -0
  65. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_stage_bash.py +0 -0
  66. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_stage_trigger.py +0 -0
  67. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_utils_tag.py +0 -0
  68. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_utils_template.py +0 -0
  69. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_workflow_depends.py +0 -0
  70. {ddeutil_workflow-0.0.16 → ddeutil_workflow-0.0.18}/tests/test_workflow_on.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ddeutil-workflow
3
- Version: 0.0.16
3
+ Version: 0.0.18
4
4
  Summary: Lightweight workflow orchestration with less dependencies
5
5
  Author-email: ddeutils <korawich.anu@gmail.com>
6
6
  License: MIT
@@ -23,7 +23,8 @@ Requires-Python: >=3.9.13
23
23
  Description-Content-Type: text/markdown
24
24
  License-File: LICENSE
25
25
  Requires-Dist: ddeutil>=0.4.3
26
- Requires-Dist: ddeutil-io[yaml]>=0.2.3
26
+ Requires-Dist: ddeutil-io[toml,yaml]>=0.2.3
27
+ Requires-Dist: pydantic==2.9.2
27
28
  Requires-Dist: python-dotenv==1.0.1
28
29
  Requires-Dist: typer<1.0.0,==0.12.5
29
30
  Requires-Dist: schedule<2.0.0,==1.2.2
@@ -33,6 +34,7 @@ Requires-Dist: fastapi<1.0.0,>=0.115.0; extra == "api"
33
34
  # Workflow
34
35
 
35
36
  [![test](https://github.com/ddeutils/ddeutil-workflow/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/ddeutils/ddeutil-workflow/actions/workflows/tests.yml)
37
+ [![codecov](https://codecov.io/gh/ddeutils/ddeutil-workflow/graph/badge.svg?token=3NDPN2I0H9)](https://codecov.io/gh/ddeutils/ddeutil-workflow)
36
38
  [![pypi version](https://img.shields.io/pypi/v/ddeutil-workflow)](https://pypi.org/project/ddeutil-workflow/)
37
39
  [![python support version](https://img.shields.io/pypi/pyversions/ddeutil-workflow)](https://pypi.org/project/ddeutil-workflow/)
38
40
  [![size](https://img.shields.io/github/languages/code-size/ddeutils/ddeutil-workflow)](https://github.com/ddeutils/ddeutil-workflow)
@@ -74,8 +76,9 @@ configuration. It called **Metadata Driven Data Workflow**.
74
76
 
75
77
  ## :round_pushpin: Installation
76
78
 
77
- This project need `ddeutil-io` extension namespace packages. If you want to install
78
- this package with application add-ons, you should add `app` in installation;
79
+ This project need `ddeutil` and `ddeutil-io` extension namespace packages.
80
+ If you want to install this package with application add-ons, you should add
81
+ `app` in installation;
79
82
 
80
83
  | Usecase | Install Optional | Support |
81
84
  |-------------------|------------------------------------------|--------------------|
@@ -181,29 +184,30 @@ and do not raise any error to you.
181
184
 
182
185
  | Environment | Component | Default | Description | Remark |
183
186
  |:----------------------------------------|-----------|----------------------------------|--------------------------------------------------------------------------------------------------------------------|--------|
184
- | `WORKFLOW_ROOT_PATH` | Core | . | The root path of the workflow application | |
185
- | `WORKFLOW_CORE_REGISTRY` | Core | src.ddeutil.workflow,tests.utils | List of importable string for the hook stage | |
186
- | `WORKFLOW_CORE_REGISTRY_FILTER` | Core | ddeutil.workflow.utils | List of importable string for the filter template | |
187
- | `WORKFLOW_CORE_PATH_CONF` | Core | conf | The config path that keep all template `.yaml` files | |
188
- | `WORKFLOW_CORE_TIMEZONE` | Core | Asia/Bangkok | A Timezone string value that will pass to `ZoneInfo` object | |
189
- | `WORKFLOW_CORE_STAGE_DEFAULT_ID` | Core | true | A flag that enable default stage ID that use for catch an execution output | |
190
- | `WORKFLOW_CORE_STAGE_RAISE_ERROR` | Core | false | A flag that all stage raise StageException from stage execution | |
187
+ | `WORKFLOW_ROOT_PATH` | Core | . | The root path of the workflow application. | |
188
+ | `WORKFLOW_CORE_REGISTRY` | Core | src.ddeutil.workflow,tests.utils | List of importable string for the hook stage. | |
189
+ | `WORKFLOW_CORE_REGISTRY_FILTER` | Core | ddeutil.workflow.utils | List of importable string for the filter template. | |
190
+ | `WORKFLOW_CORE_PATH_CONF` | Core | conf | The config path that keep all template `.yaml` files. | |
191
+ | `WORKFLOW_CORE_TIMEZONE` | Core | Asia/Bangkok | A Timezone string value that will pass to `ZoneInfo` object. | |
192
+ | `WORKFLOW_CORE_STAGE_DEFAULT_ID` | Core | true | A flag that enable default stage ID that use for catch an execution output. | |
193
+ | `WORKFLOW_CORE_STAGE_RAISE_ERROR` | Core | false | A flag that all stage raise StageException from stage execution. | |
191
194
  | `WORKFLOW_CORE_JOB_DEFAULT_ID` | Core | false | A flag that enable default job ID that use for catch an execution output. The ID that use will be sequence number. | |
192
- | `WORKFLOW_CORE_MAX_NUM_POKING` | Core | 4 | | |
193
- | `WORKFLOW_CORE_MAX_JOB_PARALLEL` | Core | 2 | The maximum job number that able to run parallel in workflow executor | |
194
- | `WORKFLOW_CORE_WORKFLOW_ID_SIMPLE_MODE` | Core | true | | |
195
- | `WORKFLOW_LOG_DEBUG_MODE` | Log | true | A flag that enable logging with debug level mode | |
196
- | `WORKFLOW_LOG_ENABLE_WRITE` | Log | true | A flag that enable logging object saving log to its destination | |
197
- | `WORKFLOW_APP_MAX_PROCESS` | Schedule | 2 | The maximum process worker number that run in scheduler app module | |
198
- | `WORKFLOW_APP_MAX_SCHEDULE_PER_PROCESS` | Schedule | 100 | A schedule per process that run parallel | |
199
- | `WORKFLOW_APP_STOP_BOUNDARY_DELTA` | Schedule | '{"minutes": 5, "seconds": 20}' | A time delta value that use to stop scheduler app in json string format | |
195
+ | `WORKFLOW_CORE_JOB_RAISE_ERROR` | Core | true | A flag that all job raise JobException from job strategy execution. | |
196
+ | `WORKFLOW_CORE_MAX_NUM_POKING` | Core | 4 | . | |
197
+ | `WORKFLOW_CORE_MAX_JOB_PARALLEL` | Core | 2 | The maximum job number that able to run parallel in workflow executor. | |
198
+ | `WORKFLOW_CORE_GENERATE_ID_SIMPLE_MODE` | Core | true | A flog that enable generating ID with `md5` algorithm. | |
199
+ | `WORKFLOW_LOG_DEBUG_MODE` | Log | true | A flag that enable logging with debug level mode. | |
200
+ | `WORKFLOW_LOG_ENABLE_WRITE` | Log | true | A flag that enable logging object saving log to its destination. | |
201
+ | `WORKFLOW_APP_MAX_PROCESS` | Schedule | 2 | The maximum process worker number that run in scheduler app module. | |
202
+ | `WORKFLOW_APP_MAX_SCHEDULE_PER_PROCESS` | Schedule | 100 | A schedule per process that run parallel. | |
203
+ | `WORKFLOW_APP_STOP_BOUNDARY_DELTA` | Schedule | '{"minutes": 5, "seconds": 20}' | A time delta value that use to stop scheduler app in json string format. | |
200
204
 
201
205
  **API Application**:
202
206
 
203
- | Environment | Component | Default | Description | Remark |
204
- |:--------------------------------------|-----------|---------|-----------------------------------------------------------------------------------|--------|
205
- | `WORKFLOW_API_ENABLE_ROUTE_WORKFLOW` | API | true | A flag that enable workflow route to manage execute manually and workflow logging | |
206
- | `WORKFLOW_API_ENABLE_ROUTE_SCHEDULE` | API | true | A flag that enable run scheduler | |
207
+ | Environment | Component | Default | Description | Remark |
208
+ |:--------------------------------------|-----------|---------|------------------------------------------------------------------------------------|--------|
209
+ | `WORKFLOW_API_ENABLE_ROUTE_WORKFLOW` | API | true | A flag that enable workflow route to manage execute manually and workflow logging. | |
210
+ | `WORKFLOW_API_ENABLE_ROUTE_SCHEDULE` | API | true | A flag that enable run scheduler. | |
207
211
 
208
212
  ## :rocket: Deployment
209
213
 
@@ -1,6 +1,7 @@
1
1
  # Workflow
2
2
 
3
3
  [![test](https://github.com/ddeutils/ddeutil-workflow/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/ddeutils/ddeutil-workflow/actions/workflows/tests.yml)
4
+ [![codecov](https://codecov.io/gh/ddeutils/ddeutil-workflow/graph/badge.svg?token=3NDPN2I0H9)](https://codecov.io/gh/ddeutils/ddeutil-workflow)
4
5
  [![pypi version](https://img.shields.io/pypi/v/ddeutil-workflow)](https://pypi.org/project/ddeutil-workflow/)
5
6
  [![python support version](https://img.shields.io/pypi/pyversions/ddeutil-workflow)](https://pypi.org/project/ddeutil-workflow/)
6
7
  [![size](https://img.shields.io/github/languages/code-size/ddeutils/ddeutil-workflow)](https://github.com/ddeutils/ddeutil-workflow)
@@ -42,8 +43,9 @@ configuration. It called **Metadata Driven Data Workflow**.
42
43
 
43
44
  ## :round_pushpin: Installation
44
45
 
45
- This project need `ddeutil-io` extension namespace packages. If you want to install
46
- this package with application add-ons, you should add `app` in installation;
46
+ This project need `ddeutil` and `ddeutil-io` extension namespace packages.
47
+ If you want to install this package with application add-ons, you should add
48
+ `app` in installation;
47
49
 
48
50
  | Usecase | Install Optional | Support |
49
51
  |-------------------|------------------------------------------|--------------------|
@@ -149,29 +151,30 @@ and do not raise any error to you.
149
151
 
150
152
  | Environment | Component | Default | Description | Remark |
151
153
  |:----------------------------------------|-----------|----------------------------------|--------------------------------------------------------------------------------------------------------------------|--------|
152
- | `WORKFLOW_ROOT_PATH` | Core | . | The root path of the workflow application | |
153
- | `WORKFLOW_CORE_REGISTRY` | Core | src.ddeutil.workflow,tests.utils | List of importable string for the hook stage | |
154
- | `WORKFLOW_CORE_REGISTRY_FILTER` | Core | ddeutil.workflow.utils | List of importable string for the filter template | |
155
- | `WORKFLOW_CORE_PATH_CONF` | Core | conf | The config path that keep all template `.yaml` files | |
156
- | `WORKFLOW_CORE_TIMEZONE` | Core | Asia/Bangkok | A Timezone string value that will pass to `ZoneInfo` object | |
157
- | `WORKFLOW_CORE_STAGE_DEFAULT_ID` | Core | true | A flag that enable default stage ID that use for catch an execution output | |
158
- | `WORKFLOW_CORE_STAGE_RAISE_ERROR` | Core | false | A flag that all stage raise StageException from stage execution | |
154
+ | `WORKFLOW_ROOT_PATH` | Core | . | The root path of the workflow application. | |
155
+ | `WORKFLOW_CORE_REGISTRY` | Core | src.ddeutil.workflow,tests.utils | List of importable string for the hook stage. | |
156
+ | `WORKFLOW_CORE_REGISTRY_FILTER` | Core | ddeutil.workflow.utils | List of importable string for the filter template. | |
157
+ | `WORKFLOW_CORE_PATH_CONF` | Core | conf | The config path that keep all template `.yaml` files. | |
158
+ | `WORKFLOW_CORE_TIMEZONE` | Core | Asia/Bangkok | A Timezone string value that will pass to `ZoneInfo` object. | |
159
+ | `WORKFLOW_CORE_STAGE_DEFAULT_ID` | Core | true | A flag that enable default stage ID that use for catch an execution output. | |
160
+ | `WORKFLOW_CORE_STAGE_RAISE_ERROR` | Core | false | A flag that all stage raise StageException from stage execution. | |
159
161
  | `WORKFLOW_CORE_JOB_DEFAULT_ID` | Core | false | A flag that enable default job ID that use for catch an execution output. The ID that use will be sequence number. | |
160
- | `WORKFLOW_CORE_MAX_NUM_POKING` | Core | 4 | | |
161
- | `WORKFLOW_CORE_MAX_JOB_PARALLEL` | Core | 2 | The maximum job number that able to run parallel in workflow executor | |
162
- | `WORKFLOW_CORE_WORKFLOW_ID_SIMPLE_MODE` | Core | true | | |
163
- | `WORKFLOW_LOG_DEBUG_MODE` | Log | true | A flag that enable logging with debug level mode | |
164
- | `WORKFLOW_LOG_ENABLE_WRITE` | Log | true | A flag that enable logging object saving log to its destination | |
165
- | `WORKFLOW_APP_MAX_PROCESS` | Schedule | 2 | The maximum process worker number that run in scheduler app module | |
166
- | `WORKFLOW_APP_MAX_SCHEDULE_PER_PROCESS` | Schedule | 100 | A schedule per process that run parallel | |
167
- | `WORKFLOW_APP_STOP_BOUNDARY_DELTA` | Schedule | '{"minutes": 5, "seconds": 20}' | A time delta value that use to stop scheduler app in json string format | |
162
+ | `WORKFLOW_CORE_JOB_RAISE_ERROR` | Core | true | A flag that all job raise JobException from job strategy execution. | |
163
+ | `WORKFLOW_CORE_MAX_NUM_POKING` | Core | 4 | . | |
164
+ | `WORKFLOW_CORE_MAX_JOB_PARALLEL` | Core | 2 | The maximum job number that able to run parallel in workflow executor. | |
165
+ | `WORKFLOW_CORE_GENERATE_ID_SIMPLE_MODE` | Core | true | A flog that enable generating ID with `md5` algorithm. | |
166
+ | `WORKFLOW_LOG_DEBUG_MODE` | Log | true | A flag that enable logging with debug level mode. | |
167
+ | `WORKFLOW_LOG_ENABLE_WRITE` | Log | true | A flag that enable logging object saving log to its destination. | |
168
+ | `WORKFLOW_APP_MAX_PROCESS` | Schedule | 2 | The maximum process worker number that run in scheduler app module. | |
169
+ | `WORKFLOW_APP_MAX_SCHEDULE_PER_PROCESS` | Schedule | 100 | A schedule per process that run parallel. | |
170
+ | `WORKFLOW_APP_STOP_BOUNDARY_DELTA` | Schedule | '{"minutes": 5, "seconds": 20}' | A time delta value that use to stop scheduler app in json string format. | |
168
171
 
169
172
  **API Application**:
170
173
 
171
- | Environment | Component | Default | Description | Remark |
172
- |:--------------------------------------|-----------|---------|-----------------------------------------------------------------------------------|--------|
173
- | `WORKFLOW_API_ENABLE_ROUTE_WORKFLOW` | API | true | A flag that enable workflow route to manage execute manually and workflow logging | |
174
- | `WORKFLOW_API_ENABLE_ROUTE_SCHEDULE` | API | true | A flag that enable run scheduler | |
174
+ | Environment | Component | Default | Description | Remark |
175
+ |:--------------------------------------|-----------|---------|------------------------------------------------------------------------------------|--------|
176
+ | `WORKFLOW_API_ENABLE_ROUTE_WORKFLOW` | API | true | A flag that enable workflow route to manage execute manually and workflow logging. | |
177
+ | `WORKFLOW_API_ENABLE_ROUTE_SCHEDULE` | API | true | A flag that enable run scheduler. | |
175
178
 
176
179
  ## :rocket: Deployment
177
180
 
@@ -27,7 +27,8 @@ classifiers = [
27
27
  requires-python = ">=3.9.13"
28
28
  dependencies = [
29
29
  "ddeutil>=0.4.3",
30
- "ddeutil-io[yaml]>=0.2.3",
30
+ "ddeutil-io[yaml,toml]>=0.2.3",
31
+ "pydantic==2.9.2",
31
32
  "python-dotenv==1.0.1",
32
33
  "typer==0.12.5,<1.0.0",
33
34
  "schedule==1.2.2,<2.0.0",
@@ -63,7 +64,8 @@ concurrency = ["thread", "multiprocessing"]
63
64
  source = ["ddeutil.workflow"]
64
65
  omit = [
65
66
  "src/ddeutil/workflow/__about__.py",
66
- # Omit this files because it does not ready to production.
67
+ "src/ddeutil/workflow/__cron.py",
68
+ # NOTE: Omit this files because it does not ready to production.
67
69
  "src/ddeutil/workflow/api.py",
68
70
  "src/ddeutil/workflow/cli.py",
69
71
  "src/ddeutil/workflow/repeat.py",
@@ -0,0 +1 @@
1
+ __version__: str = "0.0.18"
@@ -18,10 +18,7 @@ from ddeutil.core import (
18
18
  isinstance_check,
19
19
  must_split,
20
20
  )
21
- from ddeutil.core.dtutils import (
22
- next_date,
23
- replace_date,
24
- )
21
+ from ddeutil.core.dtutils import next_date, replace_date
25
22
 
26
23
  WEEKDAYS: dict[str, int] = {
27
24
  "Sun": 0,
@@ -37,7 +34,7 @@ WEEKDAYS: dict[str, int] = {
37
34
  class CronYearLimit(Exception): ...
38
35
 
39
36
 
40
- def str2cron(value: str) -> str:
37
+ def str2cron(value: str) -> str: # pragma: no cov
41
38
  """Convert Special String with the @ prefix to Crontab value.
42
39
 
43
40
  :param value: A string value that want to convert to cron value.
@@ -69,6 +66,8 @@ def str2cron(value: str) -> str:
69
66
 
70
67
  @dataclass(frozen=True)
71
68
  class Unit:
69
+ """Unit dataclass for CronPart object."""
70
+
72
71
  name: str
73
72
  range: partial
74
73
  min: int
@@ -85,6 +84,8 @@ class Unit:
85
84
 
86
85
  @dataclass
87
86
  class Options:
87
+ """Options dataclass for config CronPart object."""
88
+
88
89
  output_weekday_names: bool = False
89
90
  output_month_names: bool = False
90
91
  output_hashes: bool = False
@@ -158,7 +159,12 @@ CRON_UNITS_YEAR: tuple[Unit, ...] = CRON_UNITS + (
158
159
 
159
160
  @total_ordering
160
161
  class CronPart:
161
- """Part of Cron object that represent a collection of positive integers."""
162
+ """Part of Cron object that represent a collection of positive integers.
163
+
164
+ :param unit: A Unit dataclass object.
165
+ :param values: A crontab values that want to validate
166
+ :param options: A Options dataclass object.
167
+ """
162
168
 
163
169
  __slots__: tuple[str, ...] = (
164
170
  "unit",
@@ -0,0 +1,72 @@
1
+ # ------------------------------------------------------------------------------
2
+ # Copyright (c) 2022 Korawich Anuttra. All rights reserved.
3
+ # Licensed under the MIT License. See LICENSE in the project root for
4
+ # license information.
5
+ # ------------------------------------------------------------------------------
6
+ from .conf import (
7
+ Config,
8
+ FileLog,
9
+ Loader,
10
+ )
11
+ from .exceptions import (
12
+ JobException,
13
+ ParamValueException,
14
+ StageException,
15
+ UtilException,
16
+ WorkflowException,
17
+ )
18
+ from .job import Job, Strategy
19
+ from .on import (
20
+ On,
21
+ YearOn,
22
+ interval2crontab,
23
+ )
24
+ from .scheduler import (
25
+ Schedule,
26
+ ScheduleWorkflow,
27
+ Workflow,
28
+ WorkflowTaskData,
29
+ )
30
+ from .stage import (
31
+ BashStage,
32
+ EmptyStage,
33
+ HookStage,
34
+ PyStage,
35
+ Stage,
36
+ TriggerStage,
37
+ handler_result,
38
+ )
39
+ from .utils import (
40
+ FILTERS,
41
+ ChoiceParam,
42
+ DatetimeParam,
43
+ DefaultParam,
44
+ FilterFunc,
45
+ FilterRegistry,
46
+ IntParam,
47
+ Param,
48
+ Result,
49
+ ReturnTagFunc,
50
+ StrParam,
51
+ TagFunc,
52
+ batch,
53
+ cross_product,
54
+ custom_filter,
55
+ dash2underscore,
56
+ delay,
57
+ filter_func,
58
+ gen_id,
59
+ get_args_const,
60
+ get_diff_sec,
61
+ get_dt_now,
62
+ has_template,
63
+ make_exec,
64
+ make_filter_registry,
65
+ make_registry,
66
+ map_post_filter,
67
+ not_in_template,
68
+ param2template,
69
+ queue2str,
70
+ str2template,
71
+ tag,
72
+ )
@@ -21,8 +21,7 @@ from fastapi.responses import UJSONResponse
21
21
  from pydantic import BaseModel
22
22
 
23
23
  from .__about__ import __version__
24
- from .conf import config
25
- from .log import get_logger
24
+ from .conf import config, get_logger
26
25
  from .repeat import repeat_at, repeat_every
27
26
  from .scheduler import WorkflowTaskData
28
27
 
@@ -13,8 +13,7 @@ from typing import Annotated, Optional
13
13
  from ddeutil.core import str2list
14
14
  from typer import Argument, Option, Typer
15
15
 
16
- from .conf import config
17
- from .log import get_logger
16
+ from .conf import config, get_logger
18
17
 
19
18
  logger = get_logger("ddeutil.workflow")
20
19
  cli: Typer = Typer()