pypeline-runner 1.3.0__py3-none-any.whl → 1.5.0__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.
- pypeline/__init__.py +1 -1
- pypeline/domain/execution_context.py +3 -0
- pypeline/domain/pipeline.py +2 -2
- pypeline/pypeline.py +6 -3
- {pypeline_runner-1.3.0.dist-info → pypeline_runner-1.5.0.dist-info}/METADATA +4 -5
- {pypeline_runner-1.3.0.dist-info → pypeline_runner-1.5.0.dist-info}/RECORD +9 -9
- {pypeline_runner-1.3.0.dist-info → pypeline_runner-1.5.0.dist-info}/WHEEL +1 -1
- {pypeline_runner-1.3.0.dist-info → pypeline_runner-1.5.0.dist-info}/LICENSE +0 -0
- {pypeline_runner-1.3.0.dist-info → pypeline_runner-1.5.0.dist-info}/entry_points.txt +0 -0
pypeline/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.
|
|
1
|
+
__version__ = "1.5.0"
|
|
@@ -3,6 +3,7 @@ from dataclasses import dataclass, field
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from typing import List, Optional
|
|
5
5
|
|
|
6
|
+
from py_app_dev.core.data_registry import DataRegistry
|
|
6
7
|
from py_app_dev.core.subprocess import SubprocessExecutor
|
|
7
8
|
|
|
8
9
|
from .artifacts import ProjectArtifactsLocator
|
|
@@ -13,6 +14,8 @@ class ExecutionContext:
|
|
|
13
14
|
project_root_dir: Path
|
|
14
15
|
# Keep track of all install directories, updated by any step for the subsequent steps
|
|
15
16
|
install_dirs: List[Path] = field(default_factory=list)
|
|
17
|
+
# Data registry to exchange data of any type
|
|
18
|
+
data_registry: DataRegistry = field(default_factory=DataRegistry)
|
|
16
19
|
|
|
17
20
|
def add_install_dirs(self, install_dirs: List[Path]) -> None:
|
|
18
21
|
self.install_dirs.extend(install_dirs)
|
pypeline/domain/pipeline.py
CHANGED
|
@@ -32,8 +32,8 @@ class PipelineStepConfig(DataClassDictMixin):
|
|
|
32
32
|
module: Optional[str] = None
|
|
33
33
|
#: Step class name
|
|
34
34
|
class_name: Optional[str] = None
|
|
35
|
-
#: Command to run. For simple steps that don't need a class
|
|
36
|
-
run: Optional[str] = None
|
|
35
|
+
#: Command to run. For simple steps that don't need a class. Example: run: [echo, 'Hello World!']
|
|
36
|
+
run: Optional[Union[str, List[str]]] = None
|
|
37
37
|
#: Step description
|
|
38
38
|
description: Optional[str] = None
|
|
39
39
|
#: Step timeout in seconds
|
pypeline/pypeline.py
CHANGED
|
@@ -53,7 +53,9 @@ class PipelineLoader(Generic[TExecutionContext]):
|
|
|
53
53
|
elif step_config.file:
|
|
54
54
|
step_class = PipelineLoader._load_user_step(project_root_dir.joinpath(step_config.file), step_class_name)
|
|
55
55
|
elif step_config.run:
|
|
56
|
-
|
|
56
|
+
# We want the run field to always return a list of strings (the command and its arguments).
|
|
57
|
+
run_command = step_config.run.split(" ") if isinstance(step_config.run, str) else step_config.run
|
|
58
|
+
step_class = PipelineLoader._create_run_command_step_class(run_command, step_class_name)
|
|
57
59
|
else:
|
|
58
60
|
raise UserNotificationException(f"Step '{step_class_name}' has no 'module' nor 'file' nor `run` defined." " Please check your pipeline configuration.")
|
|
59
61
|
result.append(PipelineStepReference[TExecutionContext](group_name, cast(Type[PipelineStep[TExecutionContext]], step_class), step_config.config))
|
|
@@ -86,7 +88,7 @@ class PipelineLoader(Generic[TExecutionContext]):
|
|
|
86
88
|
return step_class
|
|
87
89
|
|
|
88
90
|
@staticmethod
|
|
89
|
-
def _create_run_command_step_class(command: str, name: str) -> Type[PipelineStep[ExecutionContext]]:
|
|
91
|
+
def _create_run_command_step_class(command: List[str], name: str) -> Type[PipelineStep[ExecutionContext]]:
|
|
90
92
|
"""Dynamically creates a step class for a given command."""
|
|
91
93
|
|
|
92
94
|
class TmpDynamicRunCommandStep(PipelineStep[ExecutionContext]):
|
|
@@ -103,7 +105,8 @@ class PipelineLoader(Generic[TExecutionContext]):
|
|
|
103
105
|
|
|
104
106
|
def run(self) -> int:
|
|
105
107
|
self.execution_context.create_process_executor(
|
|
106
|
-
[
|
|
108
|
+
# We have to disable type checking for the command because mypy considers that a List[str] is not compatible with a List[Union[str, Path]] :(
|
|
109
|
+
self.command, # type: ignore
|
|
107
110
|
cwd=self.project_root_dir,
|
|
108
111
|
).execute()
|
|
109
112
|
return 0
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: pypeline-runner
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.5.0
|
|
4
4
|
Summary: Configure and execute pipelines with Python (similar to GitHub workflows or Jenkins pipelines).
|
|
5
|
-
Home-page: https://github.com/cuinixam/pypeline
|
|
6
5
|
License: MIT
|
|
7
6
|
Author: cuinixam
|
|
8
7
|
Author-email: me@cuinixam.com
|
|
@@ -18,9 +17,9 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.13
|
|
20
19
|
Classifier: Topic :: Software Development :: Libraries
|
|
21
|
-
Requires-Dist: py-app-dev (>=2.
|
|
20
|
+
Requires-Dist: py-app-dev (>=2.5,<3.0)
|
|
22
21
|
Requires-Dist: pyyaml (>=6.0,<7.0)
|
|
23
|
-
Requires-Dist: typer
|
|
22
|
+
Requires-Dist: typer (>=0.12,<0.13)
|
|
24
23
|
Project-URL: Bug Tracker, https://github.com/cuinixam/pypeline/issues
|
|
25
24
|
Project-URL: Changelog, https://github.com/cuinixam/pypeline/blob/main/CHANGELOG.md
|
|
26
25
|
Project-URL: Documentation, https://pypeline-runner.readthedocs.io
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
pypeline/__init__.py,sha256=
|
|
1
|
+
pypeline/__init__.py,sha256=X9pTeGHIYZtDOmfb9pnn2DEqWZMAyaPlqdFwEhsuSvk,22
|
|
2
2
|
pypeline/__run.py,sha256=TCdaX05Qm3g8T4QYryKB25Xxf0L5Km7hFOHe1mK9vI0,350
|
|
3
3
|
pypeline/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
pypeline/domain/artifacts.py,sha256=qXshnk9umi0AVGV4m5iEiy_MQ5Ad2LDZwI8OULU-qMk,1355
|
|
5
5
|
pypeline/domain/config.py,sha256=AlavAaz5hSxa6yaKYnj-x71ClhOtA41yv5Qf2JIE47k,1650
|
|
6
|
-
pypeline/domain/execution_context.py,sha256=
|
|
7
|
-
pypeline/domain/pipeline.py,sha256=
|
|
6
|
+
pypeline/domain/execution_context.py,sha256=ho-WvCVRMUfYo1532eQYabXCHtXDgvSNUkX8S3Cr7Xo,1278
|
|
7
|
+
pypeline/domain/pipeline.py,sha256=mO5tc18nxiAtnLs_MR56u7PAoTJDMZ_KVkCqMzV-YG8,3916
|
|
8
8
|
pypeline/domain/project_slurper.py,sha256=YCho7V1BHjFmC_foxHFaWX8c_VbMJ16XEB4CQBlMrhc,894
|
|
9
9
|
pypeline/kickstart/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
pypeline/kickstart/create.py,sha256=dWqSdDsqNh7_AnNEsJzsmheR2-xyO6rpUwF-7AwzCYY,2188
|
|
@@ -18,13 +18,13 @@ pypeline/kickstart/templates/project/scoopfile.json,sha256=DcfZ8jYf9hmPHM-AWwnPK
|
|
|
18
18
|
pypeline/kickstart/templates/project/steps/my_step.py,sha256=_zx01qAVuwn6IMPBUBwKY-IBjS9Gs2m-d51L9sayGug,733
|
|
19
19
|
pypeline/main.py,sha256=GtuOgB9OeNFgbWLHZux80fppYQVwMYNFZoZhDIlJW9c,3457
|
|
20
20
|
pypeline/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
|
-
pypeline/pypeline.py,sha256=
|
|
21
|
+
pypeline/pypeline.py,sha256=fHGocevkWywVVTOkHJ0YSPBKjDwyJ8Zjs37wP4eMAO0,9209
|
|
22
22
|
pypeline/steps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
23
|
pypeline/steps/create_venv.py,sha256=vTPSA0gGGzq_QhI1jAgsGchS2s8_ZpEtnWcb0uL8BHE,1934
|
|
24
24
|
pypeline/steps/scoop_install.py,sha256=_YdoCMXLON0eIwck8PJOcNhayx_ka1krBAidw_oRuFE,3373
|
|
25
25
|
pypeline/steps/west_install.py,sha256=hPyr28ksdKsQ0tv0gMNytzupgk1IgjN9CpmaBdX5zps,1947
|
|
26
|
-
pypeline_runner-1.
|
|
27
|
-
pypeline_runner-1.
|
|
28
|
-
pypeline_runner-1.
|
|
29
|
-
pypeline_runner-1.
|
|
30
|
-
pypeline_runner-1.
|
|
26
|
+
pypeline_runner-1.5.0.dist-info/LICENSE,sha256=sKxdoqSmW9ezvPvt0ZGJbneyA0SBcm0GiqzTv2jN230,1066
|
|
27
|
+
pypeline_runner-1.5.0.dist-info/METADATA,sha256=BBR8eGiEfCmhMBS-Dgn6lmx7RRYuWUbxitVehIHRMOo,7154
|
|
28
|
+
pypeline_runner-1.5.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
|
29
|
+
pypeline_runner-1.5.0.dist-info/entry_points.txt,sha256=pe1u0uuhPI_yeQ0KjEw6jK-EvQfPcZwBSajgbAdKz1o,47
|
|
30
|
+
pypeline_runner-1.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|