pypeline-runner 1.8.1__tar.gz → 1.9.1__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.
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/PKG-INFO +2 -2
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/pyproject.toml +2 -2
- pypeline_runner-1.9.1/src/pypeline/__init__.py +1 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/kickstart/templates/project/pyproject.toml +1 -1
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/main.py +6 -27
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/pypeline.py +33 -11
- pypeline_runner-1.8.1/src/pypeline/__init__.py +0 -1
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/LICENSE +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/README.md +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/__run.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/domain/__init__.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/domain/artifacts.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/domain/config.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/domain/execution_context.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/domain/pipeline.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/domain/project_slurper.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/kickstart/__init__.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/kickstart/create.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/kickstart/templates/project/.gitignore +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/kickstart/templates/project/bootstrap.ps1 +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/kickstart/templates/project/bootstrap.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/kickstart/templates/project/poetry.toml +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/kickstart/templates/project/pypeline.ps1 +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/kickstart/templates/project/pypeline.yaml +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/kickstart/templates/project/scoopfile.json +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/kickstart/templates/project/steps/my_step.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/kickstart/templates/project/west.yaml +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/py.typed +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/steps/__init__.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/steps/create_venv.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/steps/scoop_install.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/steps/west_install.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pypeline-runner
|
|
3
|
-
Version: 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
|
|
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,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "pypeline-runner"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.9.1"
|
|
4
4
|
description = "Configure and execute pipelines with Python (similar to GitHub workflows or Jenkins pipelines)."
|
|
5
5
|
authors = ["cuinixam <me@cuinixam.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -28,7 +28,7 @@ pypeline = "pypeline.main:main"
|
|
|
28
28
|
[tool.poetry.dependencies]
|
|
29
29
|
python = "^3.10"
|
|
30
30
|
py-app-dev = "^2.5"
|
|
31
|
-
typer = "^0
|
|
31
|
+
typer = "^0"
|
|
32
32
|
pyyaml = "^6.0"
|
|
33
33
|
|
|
34
34
|
[tool.poetry.group.dev.dependencies]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.9.1"
|
|
@@ -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
|
-
|
|
48
|
-
|
|
49
|
-
),
|
|
50
|
-
|
|
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
|
|
|
@@ -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,
|
|
119
|
-
return self.filter_steps_references(self.create_pipeline_loader(self.pipeline, self.project_root_dir).load_steps_references(),
|
|
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
|
-
|
|
124
|
+
step_names: Optional[List[str]],
|
|
125
125
|
single: Optional[bool],
|
|
126
126
|
) -> List[PipelineStepReference[PipelineStep[TExecutionContext]]]:
|
|
127
|
-
if
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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 +0,0 @@
|
|
|
1
|
-
__version__ = "1.8.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/kickstart/templates/project/.gitignore
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/kickstart/templates/project/poetry.toml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pypeline_runner-1.8.1 → pypeline_runner-1.9.1}/src/pypeline/kickstart/templates/project/west.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|