dotflow 0.8.1__tar.gz → 0.8.2.dev2__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 (51) hide show
  1. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/PKG-INFO +2 -2
  2. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/README.md +1 -1
  3. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/__init__.py +1 -1
  4. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/cli/commands/start.py +1 -1
  5. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/cli/setup.py +2 -6
  6. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/action.py +3 -1
  7. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/config.py +1 -1
  8. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/exception.py +0 -10
  9. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/execution.py +17 -20
  10. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/task.py +2 -2
  11. dotflow-0.8.2.dev2/dotflow/core/types/__init__.py +10 -0
  12. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/workflow.py +2 -2
  13. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/log.py +1 -1
  14. dotflow-0.8.2.dev2/dotflow/utils/__init__.py +15 -0
  15. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/pyproject.toml +2 -2
  16. dotflow-0.8.1/dotflow/core/models/__init__.py +0 -10
  17. dotflow-0.8.1/dotflow/core/utils/__init__.py +0 -15
  18. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/LICENSE +0 -0
  19. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/abc/__init__.py +0 -0
  20. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/abc/file.py +0 -0
  21. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/abc/http.py +0 -0
  22. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/abc/tcp.py +0 -0
  23. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/cli/__init__.py +0 -0
  24. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/cli/command.py +0 -0
  25. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/cli/commands/__init__.py +0 -0
  26. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/cli/commands/init.py +0 -0
  27. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/cli/commands/server.py +0 -0
  28. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/cli/validators/__init__.py +0 -0
  29. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/cli/validators/start.py +0 -0
  30. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/__init__.py +0 -0
  31. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/context.py +0 -0
  32. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/decorators/__init__.py +0 -0
  33. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/decorators/action.py +0 -0
  34. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/decorators/retry.py +0 -0
  35. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/decorators/time.py +0 -0
  36. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/dotflow.py +0 -0
  37. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/module.py +0 -0
  38. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/serializers/__init__.py +0 -0
  39. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/serializers/task.py +0 -0
  40. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/serializers/transport.py +0 -0
  41. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/core/serializers/workflow.py +0 -0
  42. {dotflow-0.8.1/dotflow/core/models → dotflow-0.8.2.dev2/dotflow/core/types}/execution.py +0 -0
  43. {dotflow-0.8.1/dotflow/core/models → dotflow-0.8.2.dev2/dotflow/core/types}/status.py +0 -0
  44. {dotflow-0.8.1/dotflow/core/models → dotflow-0.8.2.dev2/dotflow/core/types}/worflow.py +0 -0
  45. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/main.py +0 -0
  46. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/providers/__init__.py +0 -0
  47. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/providers/zeromq.py +0 -0
  48. {dotflow-0.8.1 → dotflow-0.8.2.dev2}/dotflow/settings.py +0 -0
  49. {dotflow-0.8.1/dotflow/core → dotflow-0.8.2.dev2/dotflow}/utils/basic_functions.py +0 -0
  50. {dotflow-0.8.1/dotflow/core → dotflow-0.8.2.dev2/dotflow}/utils/error_handler.py +0 -0
  51. {dotflow-0.8.1/dotflow/core → dotflow-0.8.2.dev2/dotflow}/utils/tools.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dotflow
3
- Version: 0.8.1
3
+ Version: 0.8.2.dev2
4
4
  Summary: 🎲 Dotflow turns an idea into flow!
5
5
  License: MIT License
6
6
 
@@ -164,7 +164,7 @@ workflow.start()
164
164
  |03| [cli_with_mode](https://github.com/dotflow-io/dotflow/blob/master/examples/cli_with_mode.py) |
165
165
  |04| [cli_with_output_context](https://github.com/dotflow-io/dotflow/blob/master/examples/cli_with_output_context.py) |
166
166
  |05| [cli_with_path](https://github.com/dotflow-io/dotflow/blob/master/examples/cli_with_path.py) |
167
- |06| [cli](https://github.com/dotflow-io/dotflow/blob/master/examples/cli.py) |
167
+ |06| [simple_cli](https://github.com/dotflow-io/dotflow/blob/master/examples/simple_cli.py) |
168
168
  |07| [simple_class_workflow](https://github.com/dotflow-io/dotflow/blob/master/examples/simple_class_workflow.py) |
169
169
  |08| [simple_function_workflow_with_error](https://github.com/dotflow-io/dotflow/blob/master/examples/simple_function_workflow_with_error.py) |
170
170
  |09| [simple_function_workflow](https://github.com/dotflow-io/dotflow/blob/master/examples/simple_function_workflow.py) |
@@ -120,7 +120,7 @@ workflow.start()
120
120
  |03| [cli_with_mode](https://github.com/dotflow-io/dotflow/blob/master/examples/cli_with_mode.py) |
121
121
  |04| [cli_with_output_context](https://github.com/dotflow-io/dotflow/blob/master/examples/cli_with_output_context.py) |
122
122
  |05| [cli_with_path](https://github.com/dotflow-io/dotflow/blob/master/examples/cli_with_path.py) |
123
- |06| [cli](https://github.com/dotflow-io/dotflow/blob/master/examples/cli.py) |
123
+ |06| [simple_cli](https://github.com/dotflow-io/dotflow/blob/master/examples/simple_cli.py) |
124
124
  |07| [simple_class_workflow](https://github.com/dotflow-io/dotflow/blob/master/examples/simple_class_workflow.py) |
125
125
  |08| [simple_function_workflow_with_error](https://github.com/dotflow-io/dotflow/blob/master/examples/simple_function_workflow_with_error.py) |
126
126
  |09| [simple_function_workflow](https://github.com/dotflow-io/dotflow/blob/master/examples/simple_function_workflow.py) |
@@ -1,6 +1,6 @@
1
1
  """Dotflow __init__ module."""
2
2
 
3
- __version__ = "0.8.1"
3
+ __version__ = "0.8.2.dev2"
4
4
  __description__ = "🎲 Dotflow turns an idea into flow!"
5
5
 
6
6
  from .core.config import Config
@@ -3,7 +3,7 @@
3
3
  from os import system
4
4
 
5
5
  from dotflow import DotFlow, Config
6
- from dotflow.core.models.execution import TypeExecution
6
+ from dotflow.core.types.execution import TypeExecution
7
7
  from dotflow.cli.command import Command
8
8
 
9
9
 
@@ -5,12 +5,11 @@ from rich import print # type: ignore
5
5
  from dotflow import __version__, __description__
6
6
  from dotflow.log import logger
7
7
  from dotflow.settings import Settings as settings
8
- from dotflow.core.utils.basic_functions import basic_callback
9
- from dotflow.core.models.execution import TypeExecution
8
+ from dotflow.utils.basic_functions import basic_callback
9
+ from dotflow.core.types.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,9 @@ 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
- self.params = [param for param in self.func.__init__.__code__.co_varnames]
58
+ if hasattr(self.func, "__init__"):
59
+ if hasattr(self.func.__init__, "__code__"):
60
+ self.params = [param for param in self.func.__init__.__code__.co_varnames]
59
61
 
60
62
  def _get_context(self, kwargs: Dict):
61
63
  context = {}
@@ -1,6 +1,6 @@
1
1
  """Config module"""
2
2
 
3
- from dotflow.core.utils import make_dir
3
+ from dotflow.utils import make_dir
4
4
  from dotflow.settings import Settings as settings
5
5
 
6
6
 
@@ -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,9 +5,8 @@ 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
- from dotflow.core.models import TaskStatus
9
+ from dotflow.core.types import TaskStatus
11
10
 
12
11
  from dotflow.core.decorators import time
13
12
 
@@ -15,9 +14,10 @@ from dotflow.core.decorators import time
15
14
  class Execution:
16
15
 
17
16
  def __init__(
18
- self, task: Task,
19
- workflow_id: UUID,
20
- previous_context: Context
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
@@ -36,16 +36,16 @@ class Execution:
36
36
  if isinstance(additional_function, Action):
37
37
  try:
38
38
  current_context = additional_function(
39
- initial_context=self.task.initial_context,
40
- previous_context=previous_context
39
+ initial_context=self.task.initial_context,
40
+ previous_context=previous_context,
41
41
  )
42
42
  context.storage.append(current_context)
43
43
  previous_context = current_context
44
44
  except TypeError:
45
45
  current_context = additional_function(
46
- class_instance,
47
- initial_context=self.task.initial_context,
48
- previous_context=previous_context
46
+ class_instance,
47
+ initial_context=self.task.initial_context,
48
+ previous_context=previous_context,
49
49
  )
50
50
  context.storage.append(current_context)
51
51
  previous_context = current_context
@@ -60,10 +60,15 @@ class Execution:
60
60
  try:
61
61
  current_context = self.task.step(
62
62
  initial_context=self.task.initial_context,
63
- previous_context=self.task.previous_context
63
+ previous_context=self.task.previous_context,
64
64
  )
65
65
 
66
- if hasattr(current_context.storage.__init__, "__code__"):
66
+ object_attributes = [
67
+ type(getattr(current_context.storage, param)) is Action
68
+ for param in dir(current_context.storage)
69
+ ]
70
+
71
+ if True in object_attributes:
67
72
  current_context = self._execution_with_class(
68
73
  class_instance=current_context.storage
69
74
  )
@@ -71,14 +76,6 @@ class Execution:
71
76
  self.task.status = TaskStatus.COMPLETED
72
77
  self.task.current_context = current_context
73
78
 
74
- except AttributeError as err:
75
- if self.task.step.func and hasattr(self.task.step.func, "__name__"):
76
- if "'__code__'" in err.args[0].split():
77
- err = StepMissingInit(name=self.task.step.func.__name__)
78
-
79
- self.task.status = TaskStatus.FAILED
80
- self.task.error = err
81
-
82
79
  except Exception as err:
83
80
  self.task.status = TaskStatus.FAILED
84
81
  self.task.error = err
@@ -9,9 +9,9 @@ from dotflow.core.action import Action
9
9
  from dotflow.core.context import Context
10
10
  from dotflow.core.module import Module
11
11
  from dotflow.core.exception import MissingActionDecorator
12
- from dotflow.core.models.status import TaskStatus
12
+ from dotflow.core.types.status import TaskStatus
13
13
  from dotflow.settings import Settings as settings
14
- from dotflow.core.utils import basic_callback, traceback_error, message_error, copy_file
14
+ from dotflow.utils import basic_callback, traceback_error, message_error, copy_file
15
15
 
16
16
 
17
17
  class TaskInstance:
@@ -0,0 +1,10 @@
1
+ """Types __init__ module."""
2
+
3
+ from dotflow.core.types.execution import TypeExecution
4
+ from dotflow.core.types.status import TaskStatus
5
+
6
+
7
+ __all__ = [
8
+ "TypeExecution",
9
+ "TaskStatus"
10
+ ]
@@ -9,9 +9,9 @@ from typing import Callable, List
9
9
  from dotflow.core.context import Context
10
10
  from dotflow.core.execution import Execution
11
11
  from dotflow.core.exception import ExecutionModeNotExist
12
- from dotflow.core.models import TypeExecution, TaskStatus
12
+ from dotflow.core.types import TypeExecution, TaskStatus
13
13
  from dotflow.core.task import Task
14
- from dotflow.core.utils import basic_callback
14
+ from dotflow.utils import basic_callback
15
15
 
16
16
 
17
17
  class Workflow:
@@ -3,7 +3,7 @@
3
3
  import logging
4
4
  import logging.config
5
5
 
6
- from dotflow.core.utils import make_dir
6
+ from dotflow.utils import make_dir
7
7
  from dotflow.settings import Settings as settings
8
8
 
9
9
  make_dir(path=settings.INITIAL_PATH, show_log=True)
@@ -0,0 +1,15 @@
1
+ """Utils __init__ module."""
2
+
3
+ from dotflow.utils.error_handler import traceback_error, message_error
4
+ from dotflow.utils.basic_functions import basic_function, basic_callback
5
+ from dotflow.utils.tools import make_dir, copy_file
6
+
7
+
8
+ __all__ = [
9
+ "traceback_error",
10
+ "message_error",
11
+ "basic_function",
12
+ "basic_callback",
13
+ "make_dir",
14
+ "copy_file"
15
+ ]
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dotflow"
3
- version = "0.8.1"
3
+ version = "0.8.2.dev2"
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.1"
34
+ version = "0.8.2.dev2"
35
35
  description = "🎲 Dotflow turns an idea into flow!"
36
36
  authors = ["Fernando Celmer <email@fernandocelmer.com>"]
37
37
  readme = "README.md"
@@ -1,10 +0,0 @@
1
- """Types __init__ module."""
2
-
3
- from dotflow.core.models.execution import TypeExecution
4
- from dotflow.core.models.status import TaskStatus
5
-
6
-
7
- __all__ = [
8
- "TypeExecution",
9
- "TaskStatus"
10
- ]
@@ -1,15 +0,0 @@
1
- """Utils __init__ module."""
2
-
3
- from dotflow.core.utils.error_handler import traceback_error, message_error
4
- from dotflow.core.utils.basic_functions import basic_function, basic_callback
5
- from dotflow.core.utils.tools import make_dir, copy_file
6
-
7
-
8
- __all__ = [
9
- "traceback_error",
10
- "message_error",
11
- "basic_function",
12
- "basic_callback",
13
- "make_dir",
14
- "copy_file"
15
- ]
File without changes
File without changes
File without changes