ddeutil-workflow 0.0.58__py3-none-any.whl → 0.0.59__py3-none-any.whl
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.
- ddeutil/workflow/__about__.py +1 -1
- ddeutil/workflow/__cron.py +3 -3
- ddeutil/workflow/conf.py +6 -4
- ddeutil/workflow/event.py +2 -2
- ddeutil/workflow/exceptions.py +3 -3
- ddeutil/workflow/job.py +35 -34
- ddeutil/workflow/logs.py +78 -51
- ddeutil/workflow/params.py +9 -5
- ddeutil/workflow/result.py +18 -18
- ddeutil/workflow/reusables.py +9 -9
- ddeutil/workflow/scheduler.py +8 -8
- ddeutil/workflow/stages.py +70 -70
- ddeutil/workflow/utils.py +6 -6
- ddeutil/workflow/workflow.py +31 -31
- {ddeutil_workflow-0.0.58.dist-info → ddeutil_workflow-0.0.59.dist-info}/METADATA +6 -3
- ddeutil_workflow-0.0.59.dist-info/RECORD +31 -0
- {ddeutil_workflow-0.0.58.dist-info → ddeutil_workflow-0.0.59.dist-info}/WHEEL +1 -1
- ddeutil_workflow-0.0.58.dist-info/RECORD +0 -31
- {ddeutil_workflow-0.0.58.dist-info → ddeutil_workflow-0.0.59.dist-info}/entry_points.txt +0 -0
- {ddeutil_workflow-0.0.58.dist-info → ddeutil_workflow-0.0.59.dist-info}/licenses/LICENSE +0 -0
- {ddeutil_workflow-0.0.58.dist-info → ddeutil_workflow-0.0.59.dist-info}/top_level.txt +0 -0
ddeutil/workflow/workflow.py
CHANGED
@@ -69,10 +69,10 @@ __all__: TupleStr = (
|
|
69
69
|
class ReleaseType(str, Enum):
|
70
70
|
"""Release Type Enum support the type field on the Release dataclass."""
|
71
71
|
|
72
|
-
DEFAULT
|
73
|
-
SCHEDULE
|
74
|
-
POKING
|
75
|
-
FORCE
|
72
|
+
DEFAULT = "manual"
|
73
|
+
SCHEDULE = "schedule"
|
74
|
+
POKING = "poking"
|
75
|
+
FORCE = "force"
|
76
76
|
|
77
77
|
|
78
78
|
@total_ordering
|
@@ -105,14 +105,14 @@ class Release:
|
|
105
105
|
return f"{self.date:%Y-%m-%d %H:%M:%S}"
|
106
106
|
|
107
107
|
@classmethod
|
108
|
-
def from_dt(cls, dt: datetime
|
108
|
+
def from_dt(cls, dt: Union[datetime, str]) -> Self:
|
109
109
|
"""Construct Release object from `datetime` or `str` objects.
|
110
110
|
|
111
111
|
This method will replace second and millisecond value to 0 and
|
112
112
|
replace timezone to the `tz` config setting or extras overriding before
|
113
113
|
create Release object.
|
114
114
|
|
115
|
-
:param dt: (datetime
|
115
|
+
:param dt: (Union[datetime, str]) A datetime object or string that want to
|
116
116
|
construct to the Release object.
|
117
117
|
|
118
118
|
:raise TypeError: If the type of the dt argument does not valid with
|
@@ -129,7 +129,7 @@ class Release:
|
|
129
129
|
)
|
130
130
|
return cls(date=replace_sec(dt.replace(tzinfo=None)))
|
131
131
|
|
132
|
-
def __eq__(self, other: Release
|
132
|
+
def __eq__(self, other: Union[Release, datetime]) -> bool:
|
133
133
|
"""Override equal property that will compare only the same type or
|
134
134
|
datetime.
|
135
135
|
|
@@ -141,7 +141,7 @@ class Release:
|
|
141
141
|
return self.date == other
|
142
142
|
return NotImplemented
|
143
143
|
|
144
|
-
def __lt__(self, other: Release
|
144
|
+
def __lt__(self, other: Union[Release, datetime]) -> bool:
|
145
145
|
"""Override less-than property that will compare only the same type or
|
146
146
|
datetime.
|
147
147
|
|
@@ -209,7 +209,7 @@ class ReleaseQueue:
|
|
209
209
|
"""
|
210
210
|
return len(self.queue) > 0
|
211
211
|
|
212
|
-
def check_queue(self, value: Release
|
212
|
+
def check_queue(self, value: Union[Release, datetime]) -> bool:
|
213
213
|
"""Check a Release value already exists in list of tracking
|
214
214
|
queues.
|
215
215
|
|
@@ -476,7 +476,7 @@ class Workflow(BaseModel):
|
|
476
476
|
if len(set_tz) > 1:
|
477
477
|
raise ValueError(
|
478
478
|
f"The on fields should not contain multiple timezone, "
|
479
|
-
f"{list
|
479
|
+
f"{list(set_tz)}."
|
480
480
|
)
|
481
481
|
|
482
482
|
extras: Optional[DictData] = info.data.get("extras")
|
@@ -563,11 +563,11 @@ class Workflow(BaseModel):
|
|
563
563
|
adding jobs key to this parameter.
|
564
564
|
"""
|
565
565
|
# VALIDATE: Incoming params should have keys that set on this workflow.
|
566
|
-
if check_key :=
|
566
|
+
if check_key := [
|
567
567
|
f"{k!r}"
|
568
568
|
for k in self.params
|
569
569
|
if (k not in params and self.params[k].required)
|
570
|
-
|
570
|
+
]:
|
571
571
|
raise WorkflowException(
|
572
572
|
f"Required Param on this workflow setting does not set: "
|
573
573
|
f"{', '.join(check_key)}."
|
@@ -588,14 +588,14 @@ class Workflow(BaseModel):
|
|
588
588
|
|
589
589
|
def release(
|
590
590
|
self,
|
591
|
-
release:
|
591
|
+
release: Union[Release, datetime],
|
592
592
|
params: DictData,
|
593
593
|
*,
|
594
|
-
run_id: str
|
595
|
-
parent_run_id: str
|
594
|
+
run_id: Optional[str] = None,
|
595
|
+
parent_run_id: Optional[str] = None,
|
596
596
|
audit: type[Audit] = None,
|
597
597
|
queue: Optional[ReleaseQueue] = None,
|
598
|
-
override_log_name: str
|
598
|
+
override_log_name: Optional[str] = None,
|
599
599
|
result: Optional[Result] = None,
|
600
600
|
timeout: int = 600,
|
601
601
|
) -> Result:
|
@@ -745,12 +745,12 @@ class Workflow(BaseModel):
|
|
745
745
|
|
746
746
|
def poke(
|
747
747
|
self,
|
748
|
-
params: DictData
|
749
|
-
start_date: datetime
|
748
|
+
params: Optional[DictData] = None,
|
749
|
+
start_date: Optional[datetime] = None,
|
750
750
|
*,
|
751
|
-
run_id: str
|
751
|
+
run_id: Optional[str] = None,
|
752
752
|
periods: int = 1,
|
753
|
-
audit: Audit
|
753
|
+
audit: Optional[Audit] = None,
|
754
754
|
force_run: bool = False,
|
755
755
|
timeout: int = 1800,
|
756
756
|
max_poking_pool_worker: int = 2,
|
@@ -907,8 +907,8 @@ class Workflow(BaseModel):
|
|
907
907
|
job: Job,
|
908
908
|
params: DictData,
|
909
909
|
*,
|
910
|
-
result: Result
|
911
|
-
event: Event
|
910
|
+
result: Optional[Result] = None,
|
911
|
+
event: Optional[Event] = None,
|
912
912
|
) -> Result:
|
913
913
|
"""Job execution with passing dynamic parameters from the main workflow
|
914
914
|
execution to the target job object via job's ID.
|
@@ -969,10 +969,10 @@ class Workflow(BaseModel):
|
|
969
969
|
self,
|
970
970
|
params: DictData,
|
971
971
|
*,
|
972
|
-
run_id: str
|
973
|
-
parent_run_id: str
|
974
|
-
result: Result
|
975
|
-
event: Event
|
972
|
+
run_id: Optional[str] = None,
|
973
|
+
parent_run_id: Optional[str] = None,
|
974
|
+
result: Optional[Result] = None,
|
975
|
+
event: Optional[Event] = None,
|
976
976
|
timeout: int = 3600,
|
977
977
|
max_job_parallel: int = 2,
|
978
978
|
) -> Result:
|
@@ -999,8 +999,8 @@ class Workflow(BaseModel):
|
|
999
999
|
at the result context.
|
1000
1000
|
|
1001
1001
|
:param params: A parameter data that will parameterize before execution.
|
1002
|
-
:param run_id: (str
|
1003
|
-
:param parent_run_id: (str
|
1002
|
+
:param run_id: (Optional[str]) A workflow running ID.
|
1003
|
+
:param parent_run_id: (Optional[str]) A parent workflow running ID.
|
1004
1004
|
:param result: (Result) A Result instance for return context and status.
|
1005
1005
|
:param event: (Event) An Event manager instance that use to cancel this
|
1006
1006
|
execution if it forces stopped by parent execution.
|
@@ -1165,10 +1165,10 @@ class WorkflowTask:
|
|
1165
1165
|
|
1166
1166
|
def release(
|
1167
1167
|
self,
|
1168
|
-
release:
|
1169
|
-
run_id: str
|
1168
|
+
release: Optional[Union[Release, datetime]] = None,
|
1169
|
+
run_id: Optional[str] = None,
|
1170
1170
|
audit: type[Audit] = None,
|
1171
|
-
queue: ReleaseQueue
|
1171
|
+
queue: Optional[ReleaseQueue] = None,
|
1172
1172
|
) -> Result:
|
1173
1173
|
"""Release the workflow task that passing an override parameter to
|
1174
1174
|
the parent release method with the `values` field.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ddeutil-workflow
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.59
|
4
4
|
Summary: Lightweight workflow orchestration
|
5
5
|
Author-email: ddeutils <korawich.anu@gmail.com>
|
6
6
|
License: MIT
|
@@ -23,17 +23,20 @@ Requires-Python: >=3.9.13
|
|
23
23
|
Description-Content-Type: text/markdown
|
24
24
|
License-File: LICENSE
|
25
25
|
Requires-Dist: ddeutil[checksum]>=0.4.8
|
26
|
-
Requires-Dist: ddeutil-io[toml,yaml]>=0.2.
|
27
|
-
Requires-Dist: pydantic==2.11.
|
26
|
+
Requires-Dist: ddeutil-io[toml,yaml]>=0.2.13
|
27
|
+
Requires-Dist: pydantic==2.11.4
|
28
28
|
Requires-Dist: python-dotenv==1.1.0
|
29
29
|
Requires-Dist: schedule<2.0.0,==1.2.2
|
30
30
|
Provides-Extra: all
|
31
31
|
Requires-Dist: fastapi<1.0.0,>=0.115.0; extra == "all"
|
32
|
+
Requires-Dist: uvicorn; extra == "all"
|
32
33
|
Requires-Dist: httpx; extra == "all"
|
34
|
+
Requires-Dist: ujson; extra == "all"
|
33
35
|
Requires-Dist: aiofiles; extra == "all"
|
34
36
|
Requires-Dist: aiohttp; extra == "all"
|
35
37
|
Provides-Extra: api
|
36
38
|
Requires-Dist: fastapi<1.0.0,>=0.115.0; extra == "api"
|
39
|
+
Requires-Dist: uvicorn; extra == "api"
|
37
40
|
Requires-Dist: httpx; extra == "api"
|
38
41
|
Requires-Dist: ujson; extra == "api"
|
39
42
|
Provides-Extra: async
|
@@ -0,0 +1,31 @@
|
|
1
|
+
ddeutil/workflow/__about__.py,sha256=pgt1UgXVQ5NH2bT0-9YyCLh7xzGOl3WFa4CWgM2rMyE,28
|
2
|
+
ddeutil/workflow/__cron.py,sha256=5DHQKejG-76L_oREW78RcwMzeyKddJxSMmBzYyMAeeY,28536
|
3
|
+
ddeutil/workflow/__init__.py,sha256=NXEhjzKFdIGa-jtIq9HXChLCjSXNPd8VJ8ltggxbBO8,1371
|
4
|
+
ddeutil/workflow/__main__.py,sha256=x-sYedl4T8p6054aySk-EQX6vhytvPR0HvaBNYxMzp0,364
|
5
|
+
ddeutil/workflow/__types.py,sha256=7xXy6ynpT6Do6U5A-XYSVuinE2g-4wlZGGJ1NACK1BE,4343
|
6
|
+
ddeutil/workflow/conf.py,sha256=NLvjZ8bpDsn4e0MG3m1vgMdAwtmii5hP1D0STKQyZeo,14907
|
7
|
+
ddeutil/workflow/event.py,sha256=I9CUFAsqUNguCPALVmqwKWaUHcSpwg2S-chGrTZRXFY,10410
|
8
|
+
ddeutil/workflow/exceptions.py,sha256=Phe5JK-nLDt1Yh-ilWnpLIJl1VRsAzK4TBZ1tTiv9OQ,2359
|
9
|
+
ddeutil/workflow/job.py,sha256=2GGW_sY3XhZGYJpXWi84k4uTRV9YMPOMagVtDeeDya8,35289
|
10
|
+
ddeutil/workflow/logs.py,sha256=BFdPKcIsoSPU-tZBMQvBipAdlBur8IjOk7MxyqrTC8Q,28537
|
11
|
+
ddeutil/workflow/params.py,sha256=tBjKe1_e0TlUrSrlMahDuAdNNBlGBAKMmMMQ9eV-YSs,11616
|
12
|
+
ddeutil/workflow/result.py,sha256=LJieCsaQJOgZKz68wao2XKXCFm3bXl2jNkeHniP_Y90,5888
|
13
|
+
ddeutil/workflow/reusables.py,sha256=mw_Fi763B5am0EmntcjLBF7MDEhKqud2BYHcYyno5Ec,17663
|
14
|
+
ddeutil/workflow/scheduler.py,sha256=OsEyj2zscQ-3bDMk2z7UtKlCWLlgoGjaRFt17o1B1ew,27263
|
15
|
+
ddeutil/workflow/stages.py,sha256=_GGrI4sayY1HArqV0aWUMwukONnZ_6-QVAiaomP4nbY,92239
|
16
|
+
ddeutil/workflow/utils.py,sha256=S4TN1qH6t8NiZfIapJed3ZS35aQc18HzDPQ4oLqct7M,8804
|
17
|
+
ddeutil/workflow/workflow.py,sha256=gq7zbBeJptqb9rmHcR29c8Gbh43N1-cW94NdHGb6Td4,44856
|
18
|
+
ddeutil/workflow/api/__init__.py,sha256=kY30dL8HPY8tY_GBmm7y_3OdoXzB1-EA2a96PLU0AQw,5278
|
19
|
+
ddeutil/workflow/api/logs.py,sha256=NMTnOnsBrDB5129329xF2myLdrb-z9k1MQrmrP7qXJw,1818
|
20
|
+
ddeutil/workflow/api/utils.py,sha256=uTtUFVLpiYYahXvCVx8sueRQ03K2Xw1id_gW3IMmX1U,5295
|
21
|
+
ddeutil/workflow/api/routes/__init__.py,sha256=qoGtOMyVgQ5nTUc8J8wH27A8isaxl3IFCX8qoyibeCY,484
|
22
|
+
ddeutil/workflow/api/routes/job.py,sha256=8X5VLDJH6PumyNIY6JGRNBsf2gWN0eG9DzxRPSh6n4I,2190
|
23
|
+
ddeutil/workflow/api/routes/logs.py,sha256=U6vOni3wd-ZTOwd3yVdSOpgyRmNdcgfngU5KlLM3Cww,5383
|
24
|
+
ddeutil/workflow/api/routes/schedules.py,sha256=14RnaJKEGMSJtncI1H_QQVZNBe_jDS40PPRO6qFc3i0,4805
|
25
|
+
ddeutil/workflow/api/routes/workflows.py,sha256=GJu5PiXEylswrXylEImpncySjeU9chrvrtjhiMCw2RQ,4529
|
26
|
+
ddeutil_workflow-0.0.59.dist-info/licenses/LICENSE,sha256=nGFZ1QEhhhWeMHf9n99_fdt4vQaXS29xWKxt-OcLywk,1085
|
27
|
+
ddeutil_workflow-0.0.59.dist-info/METADATA,sha256=JqwaP7hwfaNAlrObHxnHlzDyBDbb_cy186S92GRjXZ4,19343
|
28
|
+
ddeutil_workflow-0.0.59.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
29
|
+
ddeutil_workflow-0.0.59.dist-info/entry_points.txt,sha256=qDTpPSauL0ciO6T4iSVt8bJeYrVEkkoEEw_RlGx6Kgk,63
|
30
|
+
ddeutil_workflow-0.0.59.dist-info/top_level.txt,sha256=m9M6XeSWDwt_yMsmH6gcOjHZVK5O0-vgtNBuncHjzW4,8
|
31
|
+
ddeutil_workflow-0.0.59.dist-info/RECORD,,
|
@@ -1,31 +0,0 @@
|
|
1
|
-
ddeutil/workflow/__about__.py,sha256=aH1VtwOIsTYSvZ--4Gjq5U7sAIC_RxyBRrJoMOYdUMs,28
|
2
|
-
ddeutil/workflow/__cron.py,sha256=yLWN_1MtcN5Uc3Dinq5lpsjW1_0HmIM5tEm-o_q0Spw,28527
|
3
|
-
ddeutil/workflow/__init__.py,sha256=NXEhjzKFdIGa-jtIq9HXChLCjSXNPd8VJ8ltggxbBO8,1371
|
4
|
-
ddeutil/workflow/__main__.py,sha256=x-sYedl4T8p6054aySk-EQX6vhytvPR0HvaBNYxMzp0,364
|
5
|
-
ddeutil/workflow/__types.py,sha256=7xXy6ynpT6Do6U5A-XYSVuinE2g-4wlZGGJ1NACK1BE,4343
|
6
|
-
ddeutil/workflow/conf.py,sha256=x3ZCvz_NCpfqMV2DQtMMdYN4pMN9s6AEX9uFsIpiqz0,14827
|
7
|
-
ddeutil/workflow/event.py,sha256=VAXUwkuKwaH2gpqc2g0qTE1EhO0dAi46b-RSEtBYvnc,10397
|
8
|
-
ddeutil/workflow/exceptions.py,sha256=HNXkZLaoWa6ejYG1NdwlUAyZiJWbsjjOJ9DjIPaM-aw,2343
|
9
|
-
ddeutil/workflow/job.py,sha256=FYfnJnSKVLtyVzM0VrcMRXOk_m_YH4vPCvfmzvaOiZ8,35241
|
10
|
-
ddeutil/workflow/logs.py,sha256=Jkcj42-GdK5kTY0w2y8PTCPyofRjfG5EVSirWICrjv4,27618
|
11
|
-
ddeutil/workflow/params.py,sha256=QCI5u2gCzi9vR8_emjyJaVevTrr81ofhFK_vPHfPf2k,11560
|
12
|
-
ddeutil/workflow/result.py,sha256=yEV_IXtiC8x-4zx6DKal5swebjtOWdKakv-WuhNyiNQ,5891
|
13
|
-
ddeutil/workflow/reusables.py,sha256=iXcS7Gg-71qVX4ln0ILTDx03cTtUnj_rNoXHTVdVrxc,17636
|
14
|
-
ddeutil/workflow/scheduler.py,sha256=8btWD5dDgTHyx92MJvFWbN79dDTAvVuaLzjm4c_HQvo,27239
|
15
|
-
ddeutil/workflow/stages.py,sha256=83pP3kLjTKIV66XsMm8rvEnF4ZNknxQTk80MePb_e5U,92032
|
16
|
-
ddeutil/workflow/utils.py,sha256=wrL9nAVPOFWEvgniELAHbB_NGVX5QeL9DkzHEE35LE8,8766
|
17
|
-
ddeutil/workflow/workflow.py,sha256=bJ-CCv4U8EOg73qQKVjdAQ0xU82OShUCJGdSgfa8dRs,44785
|
18
|
-
ddeutil/workflow/api/__init__.py,sha256=kY30dL8HPY8tY_GBmm7y_3OdoXzB1-EA2a96PLU0AQw,5278
|
19
|
-
ddeutil/workflow/api/logs.py,sha256=NMTnOnsBrDB5129329xF2myLdrb-z9k1MQrmrP7qXJw,1818
|
20
|
-
ddeutil/workflow/api/utils.py,sha256=uTtUFVLpiYYahXvCVx8sueRQ03K2Xw1id_gW3IMmX1U,5295
|
21
|
-
ddeutil/workflow/api/routes/__init__.py,sha256=qoGtOMyVgQ5nTUc8J8wH27A8isaxl3IFCX8qoyibeCY,484
|
22
|
-
ddeutil/workflow/api/routes/job.py,sha256=8X5VLDJH6PumyNIY6JGRNBsf2gWN0eG9DzxRPSh6n4I,2190
|
23
|
-
ddeutil/workflow/api/routes/logs.py,sha256=U6vOni3wd-ZTOwd3yVdSOpgyRmNdcgfngU5KlLM3Cww,5383
|
24
|
-
ddeutil/workflow/api/routes/schedules.py,sha256=14RnaJKEGMSJtncI1H_QQVZNBe_jDS40PPRO6qFc3i0,4805
|
25
|
-
ddeutil/workflow/api/routes/workflows.py,sha256=GJu5PiXEylswrXylEImpncySjeU9chrvrtjhiMCw2RQ,4529
|
26
|
-
ddeutil_workflow-0.0.58.dist-info/licenses/LICENSE,sha256=nGFZ1QEhhhWeMHf9n99_fdt4vQaXS29xWKxt-OcLywk,1085
|
27
|
-
ddeutil_workflow-0.0.58.dist-info/METADATA,sha256=1jRIZa2yDn_5BojKYl-Fvpbkb5rUSHwPnZl5JlDmSqA,19228
|
28
|
-
ddeutil_workflow-0.0.58.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
29
|
-
ddeutil_workflow-0.0.58.dist-info/entry_points.txt,sha256=qDTpPSauL0ciO6T4iSVt8bJeYrVEkkoEEw_RlGx6Kgk,63
|
30
|
-
ddeutil_workflow-0.0.58.dist-info/top_level.txt,sha256=m9M6XeSWDwt_yMsmH6gcOjHZVK5O0-vgtNBuncHjzW4,8
|
31
|
-
ddeutil_workflow-0.0.58.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|