junban 1.0.2__tar.gz → 1.0.3__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.
- {junban-1.0.2 → junban-1.0.3}/PKG-INFO +1 -1
- {junban-1.0.2 → junban-1.0.3}/junban/pipeline.py +7 -3
- {junban-1.0.2 → junban-1.0.3}/junban/pipeline_step.py +8 -0
- {junban-1.0.2 → junban-1.0.3}/junban.egg-info/PKG-INFO +1 -1
- {junban-1.0.2 → junban-1.0.3}/pyproject.toml +1 -1
- {junban-1.0.2 → junban-1.0.3}/LICENSE +0 -0
- {junban-1.0.2 → junban-1.0.3}/README.md +0 -0
- {junban-1.0.2 → junban-1.0.3}/junban/__init__.py +0 -0
- {junban-1.0.2 → junban-1.0.3}/junban/pipeline_context.py +0 -0
- {junban-1.0.2 → junban-1.0.3}/junban.egg-info/SOURCES.txt +0 -0
- {junban-1.0.2 → junban-1.0.3}/junban.egg-info/dependency_links.txt +0 -0
- {junban-1.0.2 → junban-1.0.3}/junban.egg-info/top_level.txt +0 -0
- {junban-1.0.2 → junban-1.0.3}/setup.cfg +0 -0
|
@@ -41,9 +41,13 @@ class Pipeline(Generic[C]):
|
|
|
41
41
|
current_context = context
|
|
42
42
|
for step in self.steps:
|
|
43
43
|
try:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
skip = step.maybe_skip(context)
|
|
45
|
+
if skip:
|
|
46
|
+
self._log_info(f"[{self.name}] Skipping..")
|
|
47
|
+
else:
|
|
48
|
+
self._log_info(f"[{self.name}] {step.get_start_message()}")
|
|
49
|
+
current_context = step.run(current_context)
|
|
50
|
+
self._log_info(f"[{self.name}] {step.get_end_message()}")
|
|
47
51
|
except AssertionError as e:
|
|
48
52
|
self._log_error(f"[{self.name}] Assertion error in step {step.__class__.__name__}: {str(e)}")
|
|
49
53
|
raise
|
|
@@ -20,6 +20,11 @@ class PipelineStep(ABC, Generic[C]):
|
|
|
20
20
|
"""
|
|
21
21
|
return True
|
|
22
22
|
|
|
23
|
+
def _skip(self, context: C) -> bool:
|
|
24
|
+
""" If this method returns True, the pipeline step will be skipped entirely.
|
|
25
|
+
Should not modify the context in any way."""
|
|
26
|
+
return False
|
|
27
|
+
|
|
23
28
|
@abstractmethod
|
|
24
29
|
def get_start_message(self) -> str:
|
|
25
30
|
raise NotImplementedError
|
|
@@ -32,6 +37,9 @@ class PipelineStep(ABC, Generic[C]):
|
|
|
32
37
|
def _execute(self, context: C) -> C:
|
|
33
38
|
raise NotImplementedError
|
|
34
39
|
|
|
40
|
+
def maybe_skip(self, context: C) -> bool:
|
|
41
|
+
return self._skip(context)
|
|
42
|
+
|
|
35
43
|
def run(self, context: C) -> C:
|
|
36
44
|
if not self._check_entry_assumptions(context):
|
|
37
45
|
assert False, "Entry assumptions not met"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|