pypeline-runner 1.3.0__py3-none-any.whl → 1.4.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 CHANGED
@@ -1 +1 @@
1
- __version__ = "1.3.0"
1
+ __version__ = "1.4.0"
@@ -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
- step_class = PipelineLoader._create_run_command_step_class(step_config.run, step_class_name)
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
- [self.command],
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
1
+ Metadata-Version: 2.3
2
2
  Name: pypeline-runner
3
- Version: 1.3.0
3
+ Version: 1.4.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
@@ -20,7 +19,7 @@ Classifier: Programming Language :: Python :: 3.13
20
19
  Classifier: Topic :: Software Development :: Libraries
21
20
  Requires-Dist: py-app-dev (>=2.3.3,<3.0.0)
22
21
  Requires-Dist: pyyaml (>=6.0,<7.0)
23
- Requires-Dist: typer[all] (>=0.12,<0.13)
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=F5mW07pSyGrqDNY2Ehr-UpDzpBtN-FsYU0QGZWf6PJE,22
1
+ pypeline/__init__.py,sha256=8UhoYEXHs1Oai7BW_ExBmuwWnRI-yMG_u1fQAXMizHQ,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
6
  pypeline/domain/execution_context.py,sha256=0zc3OgXeIMDpgWWYMaDGub7fY5urLLR79yuCaXVxoTQ,1101
7
- pypeline/domain/pipeline.py,sha256=1xhIl1zFr6r8mGeQWn04P2_N5smTu-eyY_6irNZNpWk,3860
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=GC4AS8rGKdJJVSNXfxV3-0F94-Rgt-Soth6rl_gZuW8,8806
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.3.0.dist-info/LICENSE,sha256=sKxdoqSmW9ezvPvt0ZGJbneyA0SBcm0GiqzTv2jN230,1066
27
- pypeline_runner-1.3.0.dist-info/METADATA,sha256=vFgk-TdAPHnMIP4gabBdE_nevAscPi4Vvrl_H6xVhpM,7211
28
- pypeline_runner-1.3.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
29
- pypeline_runner-1.3.0.dist-info/entry_points.txt,sha256=pe1u0uuhPI_yeQ0KjEw6jK-EvQfPcZwBSajgbAdKz1o,47
30
- pypeline_runner-1.3.0.dist-info/RECORD,,
26
+ pypeline_runner-1.4.0.dist-info/LICENSE,sha256=sKxdoqSmW9ezvPvt0ZGJbneyA0SBcm0GiqzTv2jN230,1066
27
+ pypeline_runner-1.4.0.dist-info/METADATA,sha256=U148kmNlXfpu71NuVMTcvIcGpN-0M7BB6EahoEo8RZU,7158
28
+ pypeline_runner-1.4.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
29
+ pypeline_runner-1.4.0.dist-info/entry_points.txt,sha256=pe1u0uuhPI_yeQ0KjEw6jK-EvQfPcZwBSajgbAdKz1o,47
30
+ pypeline_runner-1.4.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.1
2
+ Generator: poetry-core 2.0.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any