pypeline-runner 1.8.1__py3-none-any.whl → 1.9.1__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.1"
1
+ __version__ = "1.9.1"
@@ -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:
@@ -82,8 +63,6 @@ def run(
82
63
  # Schedule the steps to run
83
64
  steps_references = PipelineScheduler[ExecutionContext](project_slurper.pipeline, project_dir).get_steps_to_run(step, single)
84
65
  if not steps_references:
85
- if step:
86
- raise UserNotificationException(f"Step '{step}' not found in the pipeline.")
87
66
  logger.info("No steps to run.")
88
67
  return
89
68
 
pypeline/pypeline.py CHANGED
@@ -115,23 +115,45 @@ 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)]
134
- return steps_references
127
+ if not step_names:
128
+ return steps_references
129
+
130
+ step_names_set = set(step_names)
131
+ filtered_steps = []
132
+ found_steps = set()
133
+
134
+ if single:
135
+ # Include only the explicitly named steps, preserving order
136
+ filtered_steps = [step for step in steps_references if step.name in step_names_set]
137
+ found_steps = {step.name for step in filtered_steps}
138
+ else:
139
+ # Include all steps until the last explicitly named step is found
140
+ for step in steps_references:
141
+ filtered_steps.append(step)
142
+ if step.name in step_names_set:
143
+ found_steps.add(step.name)
144
+ if found_steps == step_names_set:
145
+ # Once all named steps have been found, stop here
146
+ break
147
+ else:
148
+ # If loop completes without finding all named steps
149
+ missing_steps = step_names_set - found_steps
150
+ raise UserNotificationException(f"Steps not found in pipeline configuration: {', '.join(missing_steps)}")
151
+
152
+ missing_steps = step_names_set - found_steps
153
+ if missing_steps:
154
+ raise UserNotificationException(f"Steps not found in pipeline configuration: {', '.join(missing_steps)}")
155
+
156
+ return filtered_steps
135
157
 
136
158
  @staticmethod
137
159
  def create_pipeline_loader(pipeline: PipelineConfig, project_root_dir: Path) -> PipelineLoader[PipelineStep[TExecutionContext]]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pypeline-runner
3
- Version: 1.8.1
3
+ Version: 1.9.1
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,4 +1,4 @@
1
- pypeline/__init__.py,sha256=6cud5pVpwnMsz6fxZVA6qWcQVSpLQXd0ddN6ip-1M_8,22
1
+ pypeline/__init__.py,sha256=zLfYDL3qj0evR4WN5tYKfgr6-_YC5xhqrm09sbhWoQQ,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
@@ -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=Xk92H0z7z-WnrC6qdSrD5xHlTN65WDc64lSs6M4Jn_g,3324
22
22
  pypeline/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
- pypeline/pypeline.py,sha256=FHGS2iNtiuiM4dZDHCbeL-UW1apdCtZeFzl1xZW9qBw,6482
23
+ pypeline/pypeline.py,sha256=-mquLfFlEvESk-HORhvjRMESIzdlVAgBLPjwUDOPLqg,7452
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.1.dist-info/LICENSE,sha256=sKxdoqSmW9ezvPvt0ZGJbneyA0SBcm0GiqzTv2jN230,1066
29
- pypeline_runner-1.8.1.dist-info/METADATA,sha256=pKwvpV0VI-4HqWax-CHRQSmuxM_NH3WdQTBKfWnwQZc,7557
30
- pypeline_runner-1.8.1.dist-info/WHEEL,sha256=7dDg4QLnNKTvwIDR9Ac8jJaAmBC_owJrckbC0jjThyA,88
31
- pypeline_runner-1.8.1.dist-info/entry_points.txt,sha256=pe1u0uuhPI_yeQ0KjEw6jK-EvQfPcZwBSajgbAdKz1o,47
32
- pypeline_runner-1.8.1.dist-info/RECORD,,
28
+ pypeline_runner-1.9.1.dist-info/LICENSE,sha256=sKxdoqSmW9ezvPvt0ZGJbneyA0SBcm0GiqzTv2jN230,1066
29
+ pypeline_runner-1.9.1.dist-info/METADATA,sha256=5yd_A34BdGORIoURRoc4Oa743KDjVUk1dUPfQ_lY4ns,7551
30
+ pypeline_runner-1.9.1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
31
+ pypeline_runner-1.9.1.dist-info/entry_points.txt,sha256=pe1u0uuhPI_yeQ0KjEw6jK-EvQfPcZwBSajgbAdKz1o,47
32
+ pypeline_runner-1.9.1.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