dotflow 0.8.0.dev4__tar.gz → 0.8.2.dev1__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.
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/PKG-INFO +1 -1
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/__init__.py +1 -1
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/cli/setup.py +0 -4
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/action.py +2 -1
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/exception.py +0 -10
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/execution.py +24 -25
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/pyproject.toml +2 -2
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/LICENSE +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/README.md +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/abc/__init__.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/abc/file.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/abc/http.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/abc/tcp.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/cli/__init__.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/cli/command.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/cli/commands/__init__.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/cli/commands/init.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/cli/commands/server.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/cli/commands/start.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/cli/validators/__init__.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/cli/validators/start.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/__init__.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/config.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/context.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/decorators/__init__.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/decorators/action.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/decorators/retry.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/decorators/time.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/dotflow.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/models/__init__.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/models/execution.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/models/status.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/models/worflow.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/module.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/serializers/__init__.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/serializers/task.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/serializers/transport.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/serializers/workflow.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/task.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/utils/__init__.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/utils/basic_functions.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/utils/error_handler.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/utils/tools.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/core/workflow.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/log.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/main.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/providers/__init__.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/providers/zeromq.py +0 -0
- {dotflow-0.8.0.dev4 → dotflow-0.8.2.dev1}/dotflow/settings.py +0 -0
|
@@ -10,7 +10,6 @@ from dotflow.core.models.execution import TypeExecution
|
|
|
10
10
|
from dotflow.core.exception import (
|
|
11
11
|
MissingActionDecorator,
|
|
12
12
|
ExecutionModeNotExist,
|
|
13
|
-
StepMissingInit,
|
|
14
13
|
ModuleNotFound,
|
|
15
14
|
MESSAGE_UNKNOWN_ERROR,
|
|
16
15
|
)
|
|
@@ -88,9 +87,6 @@ class Command:
|
|
|
88
87
|
except ExecutionModeNotExist as err:
|
|
89
88
|
print(message_icon, message_error, err)
|
|
90
89
|
|
|
91
|
-
except StepMissingInit as err:
|
|
92
|
-
print(message_icon, message_error, err)
|
|
93
|
-
|
|
94
90
|
except ModuleNotFound as err:
|
|
95
91
|
print(message_icon, message_error, err)
|
|
96
92
|
|
|
@@ -55,7 +55,8 @@ class Action(object):
|
|
|
55
55
|
self.params = [param for param in self.func.__code__.co_varnames]
|
|
56
56
|
|
|
57
57
|
if type(self.func) is type:
|
|
58
|
-
|
|
58
|
+
if hasattr(self.func, "__init__"):
|
|
59
|
+
self.params = [param for param in self.func.__init__.__code__.co_varnames]
|
|
59
60
|
|
|
60
61
|
def _get_context(self, kwargs: Dict):
|
|
61
62
|
context = {}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
MESSAGE_UNKNOWN_ERROR = "Unknown error, please check logs for more information."
|
|
4
4
|
MESSAGE_MISSING_STEP_DECORATOR = "A step function necessarily needs an 'action' decorator to circulate in the workflow. For more implementation details, access the documentation: https://dotflow-io.github.io/dotflow/nav/getting-started/#3-task-function."
|
|
5
5
|
MESSAGE_EXECUTION_NOT_EXIST = "The execution mode does not exist. Allowed parameter is 'sequential' and 'background'."
|
|
6
|
-
MESSAGE_STEP_MISSING_INIT = "The '{name}' class assigned to the step is incomplete. It is extremely important that there is an '__init__' function."
|
|
7
6
|
MESSAGE_MODULE_NOT_FOUND = "Problem importing the python module, it probably doesn't exist or is wrong."
|
|
8
7
|
|
|
9
8
|
|
|
@@ -23,15 +22,6 @@ class ExecutionModeNotExist(Exception):
|
|
|
23
22
|
)
|
|
24
23
|
|
|
25
24
|
|
|
26
|
-
class StepMissingInit(Exception):
|
|
27
|
-
|
|
28
|
-
def __init__(self, name: str):
|
|
29
|
-
name = name
|
|
30
|
-
super(StepMissingInit, self).__init__(
|
|
31
|
-
MESSAGE_STEP_MISSING_INIT.format(name=name)
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
|
|
35
25
|
class ModuleNotFound(Exception):
|
|
36
26
|
|
|
37
27
|
def __init__(self):
|
|
@@ -5,7 +5,6 @@ from typing import Callable
|
|
|
5
5
|
|
|
6
6
|
from dotflow.core.action import Action
|
|
7
7
|
from dotflow.core.context import Context
|
|
8
|
-
from dotflow.core.exception import StepMissingInit
|
|
9
8
|
from dotflow.core.task import Task
|
|
10
9
|
from dotflow.core.models import TaskStatus
|
|
11
10
|
|
|
@@ -15,9 +14,10 @@ from dotflow.core.decorators import time
|
|
|
15
14
|
class Execution:
|
|
16
15
|
|
|
17
16
|
def __init__(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
self,
|
|
18
|
+
task: Task,
|
|
19
|
+
workflow_id: UUID,
|
|
20
|
+
previous_context: Context
|
|
21
21
|
) -> None:
|
|
22
22
|
self.task = task
|
|
23
23
|
self.task.status = TaskStatus.IN_PROGRESS
|
|
@@ -28,25 +28,27 @@ class Execution:
|
|
|
28
28
|
|
|
29
29
|
def _execution_with_class(self, class_instance: Callable):
|
|
30
30
|
context = Context(storage=[])
|
|
31
|
+
previous_context = self.task.previous_context
|
|
31
32
|
|
|
32
33
|
for func_name in dir(class_instance):
|
|
33
34
|
additional_function = getattr(class_instance, func_name)
|
|
35
|
+
|
|
34
36
|
if isinstance(additional_function, Action):
|
|
35
37
|
try:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
previous_context=self.task.previous_context
|
|
40
|
-
)
|
|
38
|
+
current_context = additional_function(
|
|
39
|
+
initial_context=self.task.initial_context,
|
|
40
|
+
previous_context=previous_context,
|
|
41
41
|
)
|
|
42
|
+
context.storage.append(current_context)
|
|
43
|
+
previous_context = current_context
|
|
42
44
|
except TypeError:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
previous_context=self.task.previous_context
|
|
48
|
-
)
|
|
45
|
+
current_context = additional_function(
|
|
46
|
+
class_instance,
|
|
47
|
+
initial_context=self.task.initial_context,
|
|
48
|
+
previous_context=previous_context,
|
|
49
49
|
)
|
|
50
|
+
context.storage.append(current_context)
|
|
51
|
+
previous_context = current_context
|
|
50
52
|
|
|
51
53
|
if not context.storage:
|
|
52
54
|
return Context(storage=class_instance)
|
|
@@ -58,10 +60,15 @@ class Execution:
|
|
|
58
60
|
try:
|
|
59
61
|
current_context = self.task.step(
|
|
60
62
|
initial_context=self.task.initial_context,
|
|
61
|
-
previous_context=self.task.previous_context
|
|
63
|
+
previous_context=self.task.previous_context,
|
|
62
64
|
)
|
|
63
65
|
|
|
64
|
-
|
|
66
|
+
so_this_is_a_class = [
|
|
67
|
+
type(getattr(current_context.storage, param)) is Action
|
|
68
|
+
for param in dir(current_context.storage)
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
if True in so_this_is_a_class:
|
|
65
72
|
current_context = self._execution_with_class(
|
|
66
73
|
class_instance=current_context.storage
|
|
67
74
|
)
|
|
@@ -69,14 +76,6 @@ class Execution:
|
|
|
69
76
|
self.task.status = TaskStatus.COMPLETED
|
|
70
77
|
self.task.current_context = current_context
|
|
71
78
|
|
|
72
|
-
except AttributeError as err:
|
|
73
|
-
if self.task.step.func and hasattr(self.task.step.func, "__name__"):
|
|
74
|
-
if "'__code__'" in err.args[0].split():
|
|
75
|
-
err = StepMissingInit(name=self.task.step.func.__name__)
|
|
76
|
-
|
|
77
|
-
self.task.status = TaskStatus.FAILED
|
|
78
|
-
self.task.error = err
|
|
79
|
-
|
|
80
79
|
except Exception as err:
|
|
81
80
|
self.task.status = TaskStatus.FAILED
|
|
82
81
|
self.task.error = err
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "dotflow"
|
|
3
|
-
version = "0.8.
|
|
3
|
+
version = "0.8.2.dev1"
|
|
4
4
|
authors = [
|
|
5
5
|
{ name="Fernando Celmer", email="email@fernandocelmer.com" },
|
|
6
6
|
]
|
|
@@ -31,7 +31,7 @@ Documentation = "https://github.com/dotflow-io/dotflow/blob/master/README.md"
|
|
|
31
31
|
|
|
32
32
|
[tool.poetry]
|
|
33
33
|
name = "dotflow"
|
|
34
|
-
version = "0.8.
|
|
34
|
+
version = "0.8.2.dev1"
|
|
35
35
|
description = "🎲 Dotflow turns an idea into flow!"
|
|
36
36
|
authors = ["Fernando Celmer <email@fernandocelmer.com>"]
|
|
37
37
|
readme = "README.md"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|