pypeline-runner 1.8.0__py3-none-any.whl → 1.9.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.8.0"
1
+ __version__ = "1.9.0"
@@ -24,7 +24,9 @@ class ExecutionContext:
24
24
  # Add the install directories to the PATH
25
25
  env = os.environ.copy()
26
26
  env["PATH"] = os.pathsep.join([path.absolute().as_posix() for path in self.install_dirs] + [env["PATH"]])
27
- return SubprocessExecutor(command, cwd=cwd, env=env, shell=True) # noqa: S604
27
+ # When started from a windows shell (e.g. cmd on Jenkins) the shell parameter must be set to True
28
+ shell = True if os.name == "nt" else False
29
+ return SubprocessExecutor(command, cwd=cwd, env=env, shell=shell)
28
30
 
29
31
  def create_artifacts_locator(self) -> ProjectArtifactsLocator:
30
32
  return ProjectArtifactsLocator(self.project_root_dir)
@@ -6,6 +6,6 @@ authors = ["Your Name"]
6
6
  package-mode = false
7
7
 
8
8
  [tool.poetry.dependencies]
9
- python = ">=3.10,<3.13"
9
+ python = ">=3.10,<4.0"
10
10
  pypeline-runner = "*"
11
11
  west = "*"
pypeline/main.py CHANGED
@@ -1,6 +1,6 @@
1
1
  import sys
2
2
  from pathlib import Path
3
- from typing import Optional
3
+ from typing import List, Optional
4
4
 
5
5
  import typer
6
6
  from py_app_dev.core.exceptions import UserNotificationException
@@ -43,30 +43,11 @@ def init(
43
43
  def run(
44
44
  project_dir: Path = typer.Option(Path.cwd().absolute(), help="The project directory"), # noqa: B008,
45
45
  config_file: Optional[str] = typer.Option(None, help="The name of the YAML configuration file containing the pypeline definition."),
46
- step: Optional[str] = typer.Option(
47
- None,
48
- help="Name of the step to run (as written in the pipeline config).",
49
- ),
50
- single: bool = typer.Option(
51
- False,
52
- help="If provided, only the provided step will run, without running all previous steps in the pipeline.",
53
- is_flag=True,
54
- ),
55
- print: bool = typer.Option(
56
- False,
57
- help="Print the pipeline steps.",
58
- is_flag=True,
59
- ),
60
- force_run: bool = typer.Option(
61
- False,
62
- help="Force the execution of a step even if it is not dirty.",
63
- is_flag=True,
64
- ),
65
- dry_run: bool = typer.Option(
66
- False,
67
- help="Do not run any step, just print the steps that would be executed.",
68
- is_flag=True,
69
- ),
46
+ step: Optional[List[str]] = typer.Option(None, help="Name of the step to run (as written in the pipeline config)."), # noqa: B008
47
+ single: bool = typer.Option(False, help="If provided, only the provided step will run, without running all previous steps in the pipeline."),
48
+ print: bool = typer.Option(False, help="Print the pipeline steps."),
49
+ force_run: bool = typer.Option(False, help="Force the execution of a step even if it is not dirty."),
50
+ dry_run: bool = typer.Option(False, help="Do not run any step, just print the steps that would be executed."),
70
51
  ) -> None:
71
52
  project_slurper = ProjectSlurper(project_dir, config_file)
72
53
  if print:
@@ -79,11 +60,11 @@ def run(
79
60
  return
80
61
  if not project_slurper.pipeline:
81
62
  raise UserNotificationException("No pipeline found in the configuration.")
63
+ if single and step and len(step) > 1:
64
+ raise UserNotificationException("Only one step can be run with the --single flag.")
82
65
  # Schedule the steps to run
83
66
  steps_references = PipelineScheduler[ExecutionContext](project_slurper.pipeline, project_dir).get_steps_to_run(step, single)
84
67
  if not steps_references:
85
- if step:
86
- raise UserNotificationException(f"Step '{step}' not found in the pipeline.")
87
68
  logger.info("No steps to run.")
88
69
  return
89
70
 
pypeline/pypeline.py CHANGED
@@ -115,22 +115,35 @@ class PipelineScheduler(Generic[TExecutionContext]):
115
115
  self.project_root_dir = project_root_dir
116
116
  self.logger = logger.bind()
117
117
 
118
- def get_steps_to_run(self, step_name: Optional[str] = None, single: bool = False) -> List[PipelineStepReference[PipelineStep[TExecutionContext]]]:
119
- return self.filter_steps_references(self.create_pipeline_loader(self.pipeline, self.project_root_dir).load_steps_references(), step_name, single)
118
+ def get_steps_to_run(self, step_names: Optional[List[str]] = None, single: bool = False) -> List[PipelineStepReference[PipelineStep[TExecutionContext]]]:
119
+ return self.filter_steps_references(self.create_pipeline_loader(self.pipeline, self.project_root_dir).load_steps_references(), step_names, single)
120
120
 
121
121
  @staticmethod
122
122
  def filter_steps_references(
123
123
  steps_references: List[PipelineStepReference[PipelineStep[TExecutionContext]]],
124
- step_name: Optional[str],
124
+ step_names: Optional[List[str]],
125
125
  single: Optional[bool],
126
126
  ) -> List[PipelineStepReference[PipelineStep[TExecutionContext]]]:
127
- if step_name:
128
- step_reference = next((step for step in steps_references if step.name == step_name), None)
129
- if not step_reference:
130
- return []
131
- if single:
132
- return [step_reference]
133
- return [step for step in steps_references if steps_references.index(step) <= steps_references.index(step_reference)]
127
+ if step_names:
128
+ found_steps = set()
129
+ filtered_step_refs = []
130
+
131
+ for step in steps_references:
132
+ if step.name in step_names:
133
+ found_steps.add(step.name)
134
+ if single:
135
+ filtered_step_refs.append(step)
136
+ break
137
+ else:
138
+ filtered_step_refs.append(step)
139
+
140
+ # Check if all input step names were found
141
+ missing_steps = set(step_names) - found_steps
142
+ if missing_steps:
143
+ raise UserNotificationException(f"Steps not found in pipeline configuration: {', '.join(missing_steps)}")
144
+
145
+ return filtered_step_refs
146
+
134
147
  return steps_references
135
148
 
136
149
  @staticmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pypeline-runner
3
- Version: 1.8.0
3
+ Version: 1.9.0
4
4
  Summary: Configure and execute pipelines with Python (similar to GitHub workflows or Jenkins pipelines).
5
5
  License: MIT
6
6
  Author: cuinixam
@@ -19,7 +19,7 @@ Classifier: Programming Language :: Python :: 3.13
19
19
  Classifier: Topic :: Software Development :: Libraries
20
20
  Requires-Dist: py-app-dev (>=2.5,<3.0)
21
21
  Requires-Dist: pyyaml (>=6.0,<7.0)
22
- Requires-Dist: typer (>=0.12,<0.13)
22
+ Requires-Dist: typer (>=0,<1)
23
23
  Project-URL: Bug Tracker, https://github.com/cuinixam/pypeline/issues
24
24
  Project-URL: Changelog, https://github.com/cuinixam/pypeline/blob/main/CHANGELOG.md
25
25
  Project-URL: Documentation, https://pypeline-runner.readthedocs.io
@@ -1,9 +1,9 @@
1
- pypeline/__init__.py,sha256=Oc_xF94AMAHKZkZlB5rBt1iO0TXWFalg65MP4T2qt-A,22
1
+ pypeline/__init__.py,sha256=ljy9wwnU6FSzJrHgJSWUcZ_nIboERJauUm7HTpNQfNg,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=5k7cVfHhLmvWXNuHKxXb9ca4Lxu0JytGQqazENCeKEU,1404
5
5
  pypeline/domain/config.py,sha256=AlavAaz5hSxa6yaKYnj-x71ClhOtA41yv5Qf2JIE47k,1650
6
- pypeline/domain/execution_context.py,sha256=ho-WvCVRMUfYo1532eQYabXCHtXDgvSNUkX8S3Cr7Xo,1278
6
+ pypeline/domain/execution_context.py,sha256=BwjKxkv5nBIc2htCzMgXwnBFCORHpWZYWSKQD5wpcMA,1424
7
7
  pypeline/domain/pipeline.py,sha256=2BsN2lw2znUxLH--Novyqe6SubVKs6XeHQSQf9yxirw,7788
8
8
  pypeline/domain/project_slurper.py,sha256=e3BLV88GvfW3efh0agUWKqMk3oWnL602P5u9jER_o9U,971
9
9
  pypeline/kickstart/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -14,19 +14,19 @@ pypeline/kickstart/templates/project/bootstrap.py,sha256=9cJp_sbU0SKvDjJluvyQfh0
14
14
  pypeline/kickstart/templates/project/poetry.toml,sha256=qgVxBdPcJZOHdHCTOBoZYna3cke4VGgRkNZ0bKgN6rs,32
15
15
  pypeline/kickstart/templates/project/pypeline.ps1,sha256=PjCJULG8XA3AHKbNt3oHrIgD04huvvpIue_gjSo3PMA,104
16
16
  pypeline/kickstart/templates/project/pypeline.yaml,sha256=7FeIu7OOqq7iToPVdP_a4MehIi9lUkBPbXnl8mYpxSo,279
17
- pypeline/kickstart/templates/project/pyproject.toml,sha256=frr2i_bresciD1LsW5_y65Mwh_QTHia5MVipwsrc1-Q,248
17
+ pypeline/kickstart/templates/project/pyproject.toml,sha256=A60HZ6Aqf8KTFLoC35SexuJ2Ze1I-khuYmYUKhphfNY,247
18
18
  pypeline/kickstart/templates/project/scoopfile.json,sha256=DcfZ8jYf9hmPHM-AWwnPKQJCzRG3fCuYtMeoY01nkag,219
19
19
  pypeline/kickstart/templates/project/steps/my_step.py,sha256=iZYTzWtL-qxEW_t7q079d-xpnRST_tumSzxqiQDW7sM,707
20
20
  pypeline/kickstart/templates/project/west.yaml,sha256=ZfVym7M4yzzC-Nm0vESdhqNYs6EaJuMQWGJBht_i0b4,188
21
- pypeline/main.py,sha256=54_-aINmJY6IILSp6swL2kYqNoBQqJw4W2duxY7gcQ4,3607
21
+ pypeline/main.py,sha256=yXgIjf8w8OUMD-u7ytVtRIiHtIkE2BD0XcNDNl75buI,3458
22
22
  pypeline/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
- pypeline/pypeline.py,sha256=FHGS2iNtiuiM4dZDHCbeL-UW1apdCtZeFzl1xZW9qBw,6482
23
+ pypeline/pypeline.py,sha256=X9Qd6pPS1wSN30Yav5AojydKWWJh7xbYYS-vW8EVbo0,6862
24
24
  pypeline/steps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  pypeline/steps/create_venv.py,sha256=xCc73Hk62bbuJIM3btvapuoWeQy_Se5MsgffokYc-r0,2429
26
26
  pypeline/steps/scoop_install.py,sha256=_YdoCMXLON0eIwck8PJOcNhayx_ka1krBAidw_oRuFE,3373
27
27
  pypeline/steps/west_install.py,sha256=hPyr28ksdKsQ0tv0gMNytzupgk1IgjN9CpmaBdX5zps,1947
28
- pypeline_runner-1.8.0.dist-info/LICENSE,sha256=sKxdoqSmW9ezvPvt0ZGJbneyA0SBcm0GiqzTv2jN230,1066
29
- pypeline_runner-1.8.0.dist-info/METADATA,sha256=PNVemc7HHUUK7pjR6pzw9EWlTfn-FFm506Ca798Y5Gs,7557
30
- pypeline_runner-1.8.0.dist-info/WHEEL,sha256=7dDg4QLnNKTvwIDR9Ac8jJaAmBC_owJrckbC0jjThyA,88
31
- pypeline_runner-1.8.0.dist-info/entry_points.txt,sha256=pe1u0uuhPI_yeQ0KjEw6jK-EvQfPcZwBSajgbAdKz1o,47
32
- pypeline_runner-1.8.0.dist-info/RECORD,,
28
+ pypeline_runner-1.9.0.dist-info/LICENSE,sha256=sKxdoqSmW9ezvPvt0ZGJbneyA0SBcm0GiqzTv2jN230,1066
29
+ pypeline_runner-1.9.0.dist-info/METADATA,sha256=KCTSZw20UqCq6_iL2p0TPe_BAsDfttHhzutN3aQbkSg,7551
30
+ pypeline_runner-1.9.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
31
+ pypeline_runner-1.9.0.dist-info/entry_points.txt,sha256=pe1u0uuhPI_yeQ0KjEw6jK-EvQfPcZwBSajgbAdKz1o,47
32
+ pypeline_runner-1.9.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.0
2
+ Generator: poetry-core 2.1.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any