py-app-dev 2.3.3__tar.gz → 2.4.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py-app-dev
3
- Version: 2.3.3
3
+ Version: 2.4.0
4
4
  Summary: My application development modules.
5
5
  Home-page: https://github.com/cuinixam/python-app-dev
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "py-app-dev"
3
- version = "2.3.3"
3
+ version = "2.4.0"
4
4
  description = "My application development modules."
5
5
  authors = ["cuinixam <me@cuinixam.com>"]
6
6
  license = "MIT"
@@ -0,0 +1 @@
1
+ __version__ = "2.4.0"
@@ -12,6 +12,7 @@ from typing import (
12
12
  Type,
13
13
  TypeAlias,
14
14
  TypeVar,
15
+ Union,
15
16
  )
16
17
 
17
18
  from mashumaro import DataClassDictMixin
@@ -37,7 +38,7 @@ class PipelineStepConfig(DataClassDictMixin):
37
38
  config: Optional[Dict[str, Any]] = None
38
39
 
39
40
 
40
- PipelineConfig: TypeAlias = OrderedDict[str, List[PipelineStepConfig]]
41
+ PipelineConfig: TypeAlias = Union[List[PipelineStepConfig], OrderedDict[str, List[PipelineStepConfig]]]
41
42
 
42
43
  TPipelineStep = TypeVar("TPipelineStep")
43
44
 
@@ -52,7 +53,7 @@ class PipelineStep:
52
53
  class PipelineStepReference(Generic[TPipelineStep]):
53
54
  """Once a Step is found, keep the Step class reference to be able to instantiate it later."""
54
55
 
55
- group_name: str
56
+ group_name: Optional[str]
56
57
  _class: Type[TPipelineStep]
57
58
  config: Optional[Dict[str, Any]] = None
58
59
 
@@ -64,13 +65,20 @@ class PipelineLoader(Generic[TPipelineStep]):
64
65
 
65
66
  def load_steps(self) -> List[PipelineStepReference[TPipelineStep]]:
66
67
  result = []
67
- for group_name, steps_config in self.pipeline_config.items():
68
- result.extend(self._load_steps(group_name, steps_config, self.project_root_dir))
68
+ if isinstance(self.pipeline_config, list):
69
+ # Handle List[PipelineStepConfig]
70
+ result.extend(self._load_steps(None, self.pipeline_config, self.project_root_dir))
71
+ elif isinstance(self.pipeline_config, OrderedDict):
72
+ # Handle OrderedDict[str, List[PipelineStepConfig]]
73
+ for group_name, steps_config in self.pipeline_config.items():
74
+ result.extend(self._load_steps(group_name, steps_config, self.project_root_dir))
75
+ else:
76
+ raise UserNotificationException("Invalid pipeline configuration. Expected a list or an ordered dictionary.")
69
77
  return result
70
78
 
71
79
  @staticmethod
72
80
  def _load_steps(
73
- group_name: str,
81
+ group_name: Optional[str],
74
82
  steps_config: List[PipelineStepConfig],
75
83
  project_root_dir: Path,
76
84
  ) -> List[PipelineStepReference[TPipelineStep]]:
@@ -1 +0,0 @@
1
- __version__ = "2.3.3"
File without changes
File without changes