pypeline-runner 1.3.0__tar.gz → 1.5.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.
Files changed (30) hide show
  1. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/PKG-INFO +4 -5
  2. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/pyproject.toml +8 -8
  3. pypeline_runner-1.5.0/src/pypeline/__init__.py +1 -0
  4. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/domain/execution_context.py +3 -0
  5. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/domain/pipeline.py +2 -2
  6. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/pypeline.py +6 -3
  7. pypeline_runner-1.3.0/src/pypeline/__init__.py +0 -1
  8. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/LICENSE +0 -0
  9. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/README.md +0 -0
  10. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/__run.py +0 -0
  11. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/domain/__init__.py +0 -0
  12. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/domain/artifacts.py +0 -0
  13. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/domain/config.py +0 -0
  14. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/domain/project_slurper.py +0 -0
  15. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/kickstart/__init__.py +0 -0
  16. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/kickstart/create.py +0 -0
  17. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/kickstart/templates/project/.gitignore +0 -0
  18. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/kickstart/templates/project/bootstrap.ps1 +0 -0
  19. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/kickstart/templates/project/poetry.toml +0 -0
  20. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/kickstart/templates/project/pypeline.ps1 +0 -0
  21. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/kickstart/templates/project/pypeline.yaml +0 -0
  22. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/kickstart/templates/project/pyproject.toml +0 -0
  23. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/kickstart/templates/project/scoopfile.json +0 -0
  24. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/kickstart/templates/project/steps/my_step.py +0 -0
  25. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/main.py +0 -0
  26. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/py.typed +0 -0
  27. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/steps/__init__.py +0 -0
  28. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/steps/create_venv.py +0 -0
  29. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/steps/scoop_install.py +0 -0
  30. {pypeline_runner-1.3.0 → pypeline_runner-1.5.0}/src/pypeline/steps/west_install.py +0 -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.5.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
@@ -18,9 +17,9 @@ Classifier: Programming Language :: Python :: 3.11
18
17
  Classifier: Programming Language :: Python :: 3.12
19
18
  Classifier: Programming Language :: Python :: 3.13
20
19
  Classifier: Topic :: Software Development :: Libraries
21
- Requires-Dist: py-app-dev (>=2.3.3,<3.0.0)
20
+ Requires-Dist: py-app-dev (>=2.5,<3.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,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pypeline-runner"
3
- version = "1.3.0"
3
+ version = "1.5.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"
@@ -27,15 +27,15 @@ pypeline = "pypeline.main:main"
27
27
 
28
28
  [tool.poetry.dependencies]
29
29
  python = "^3.10"
30
- py-app-dev = "^2.3.3"
31
- typer = {extras = ["all"], version = "^0.12"}
30
+ py-app-dev = "^2.5"
31
+ typer = "^0.12"
32
32
  pyyaml = "^6.0"
33
33
 
34
34
  [tool.poetry.group.dev.dependencies]
35
- pytest = "^7.0"
36
- pytest-cov = "^4.0"
37
- pre-commit = "^3.1"
38
- ruff = "^0.3"
35
+ pytest = "^8.3"
36
+ pytest-cov = "^6.0"
37
+ pre-commit = "^4.0"
38
+ ruff = "^0.9"
39
39
 
40
40
  [tool.poetry.group.docs.dependencies]
41
41
  myst-parser = ">=0.16"
@@ -72,7 +72,7 @@ match = "(?!main$)"
72
72
  prerelease = true
73
73
 
74
74
  [tool.pytest.ini_options]
75
- addopts = "-vv -Wdefault --cov=pypeline --cov-report=term-missing:skip-covered"
75
+ addopts = "-vv -Wdefault --cov=pypeline --cov-report=term-missing:skip-covered --cov-branch"
76
76
  pythonpath = ["src"]
77
77
 
78
78
  [tool.coverage.run]
@@ -0,0 +1 @@
1
+ __version__ = "1.5.0"
@@ -3,6 +3,7 @@ from dataclasses import dataclass, field
3
3
  from pathlib import Path
4
4
  from typing import List, Optional
5
5
 
6
+ from py_app_dev.core.data_registry import DataRegistry
6
7
  from py_app_dev.core.subprocess import SubprocessExecutor
7
8
 
8
9
  from .artifacts import ProjectArtifactsLocator
@@ -13,6 +14,8 @@ class ExecutionContext:
13
14
  project_root_dir: Path
14
15
  # Keep track of all install directories, updated by any step for the subsequent steps
15
16
  install_dirs: List[Path] = field(default_factory=list)
17
+ # Data registry to exchange data of any type
18
+ data_registry: DataRegistry = field(default_factory=DataRegistry)
16
19
 
17
20
  def add_install_dirs(self, install_dirs: List[Path]) -> None:
18
21
  self.install_dirs.extend(install_dirs)
@@ -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
@@ -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 +0,0 @@
1
- __version__ = "1.3.0"
File without changes