pypeline-runner 1.8.1__tar.gz → 1.9.0__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.0}/PKG-INFO +2 -2
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/pyproject.toml +2 -2
- pypeline_runner-1.9.0/src/pypeline/__init__.py +1 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/kickstart/templates/project/pyproject.toml +1 -1
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/main.py +8 -27
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/pypeline.py +23 -10
- pypeline_runner-1.8.1/src/pypeline/__init__.py +0 -1
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/LICENSE +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/README.md +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/__run.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/domain/__init__.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/domain/artifacts.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/domain/config.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/domain/execution_context.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/domain/pipeline.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/domain/project_slurper.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/kickstart/__init__.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/kickstart/create.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/kickstart/templates/project/.gitignore +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/kickstart/templates/project/bootstrap.ps1 +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/kickstart/templates/project/bootstrap.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/kickstart/templates/project/poetry.toml +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/kickstart/templates/project/pypeline.ps1 +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/kickstart/templates/project/pypeline.yaml +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/kickstart/templates/project/scoopfile.json +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/kickstart/templates/project/steps/my_step.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/kickstart/templates/project/west.yaml +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/py.typed +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/steps/__init__.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/steps/create_venv.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/src/pypeline/steps/scoop_install.py +0 -0
- {pypeline_runner-1.8.1 → pypeline_runner-1.9.0}/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.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
|
|
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.0"
|
|
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.0"
|
|
@@ -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:
|
|
@@ -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
|
|
|
@@ -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,
|
|
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
|
-
|
|
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 +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.0}/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.0}/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.0}/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
|