pypeline-runner 1.21.0__tar.gz → 1.22.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 (32) hide show
  1. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/PKG-INFO +1 -1
  2. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/pyproject.toml +1 -1
  3. pypeline_runner-1.22.0/src/pypeline/__init__.py +1 -0
  4. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/bootstrap/run.py +30 -16
  5. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/steps/create_venv.py +29 -11
  6. pypeline_runner-1.21.0/src/pypeline/__init__.py +0 -1
  7. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/LICENSE +0 -0
  8. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/README.md +0 -0
  9. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/__run.py +0 -0
  10. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/bootstrap/__init__.py +0 -0
  11. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/domain/__init__.py +0 -0
  12. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/domain/artifacts.py +0 -0
  13. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/domain/config.py +0 -0
  14. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/domain/execution_context.py +0 -0
  15. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/domain/pipeline.py +0 -0
  16. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/domain/project_slurper.py +0 -0
  17. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/inputs_parser.py +0 -0
  18. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/kickstart/__init__.py +0 -0
  19. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/kickstart/create.py +0 -0
  20. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/kickstart/templates/project/.gitignore +0 -0
  21. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/kickstart/templates/project/pypeline.ps1 +0 -0
  22. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/kickstart/templates/project/pypeline.yaml +0 -0
  23. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/kickstart/templates/project/pyproject.toml +0 -0
  24. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/kickstart/templates/project/steps/my_step.py +0 -0
  25. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/kickstart/templates/project/west.yaml +0 -0
  26. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/main.py +0 -0
  27. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/py.typed +0 -0
  28. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/pypeline.py +0 -0
  29. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/steps/__init__.py +0 -0
  30. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/steps/env_setup_script.py +0 -0
  31. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/steps/scoop_install.py +0 -0
  32. {pypeline_runner-1.21.0 → pypeline_runner-1.22.0}/src/pypeline/steps/west_install.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pypeline-runner
3
- Version: 1.21.0
3
+ Version: 1.22.0
4
4
  Summary: Configure and execute pipelines with Python (similar to GitHub workflows or Jenkins pipelines).
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pypeline-runner"
3
- version = "1.21.0"
3
+ version = "1.22.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"
@@ -0,0 +1 @@
1
+ __version__ = "1.22.0"
@@ -692,22 +692,27 @@ class CreateVirtualEnvironment(Runnable):
692
692
  return "create-virtual-environment"
693
693
 
694
694
  def get_inputs(self) -> List[Path]:
695
- venv_relevant_files = [
696
- "uv.lock",
697
- "poetry.lock",
698
- "poetry.toml",
699
- "pyproject.toml",
700
- ".env",
701
- "Pipfile",
702
- "Pipfile.lock",
703
- "bootstrap.json",
704
- ".bootstrap/bootstrap.ps1",
705
- ".bootstrap/bootstrap.py",
706
- "bootstrap.ps1",
707
- "bootstrap.py",
708
- str(self.bootstrap_env.marker_file),
709
- ]
710
- return [self.root_dir / file for file in venv_relevant_files]
695
+ """Get input dependencies based on package manager and actual bootstrap configuration."""
696
+ inputs = []
697
+
698
+ # Add package manager specific lock/config files
699
+ package_manager_files = {
700
+ "uv": ["uv.lock", "pyproject.toml"],
701
+ "poetry": ["poetry.lock", "poetry.toml", "pyproject.toml"],
702
+ "pipenv": ["Pipfile", "Pipfile.lock", ".env"],
703
+ }
704
+
705
+ if self.package_manager_name in package_manager_files:
706
+ for file in package_manager_files[self.package_manager_name]:
707
+ inputs.append(self.root_dir / file)
708
+
709
+ # Add bootstrap script (always tracked since CreateVEnv creates it)
710
+ inputs.append(self.bootstrap_dir / "bootstrap.py")
711
+
712
+ # Add the bootstrap environment marker
713
+ inputs.append(self.bootstrap_env.marker_file)
714
+
715
+ return inputs
711
716
 
712
717
  def get_outputs(self) -> List[Path]:
713
718
  """
@@ -721,6 +726,15 @@ class CreateVirtualEnvironment(Runnable):
721
726
  self.bootstrap_env.virtual_env.scripts_path(),
722
727
  ]
723
728
 
729
+ def get_config(self) -> Optional[dict[str, Any]]:
730
+ """Return configuration that affects the project environment."""
731
+ return {
732
+ "package_manager": self.config.package_manager,
733
+ "package_manager_args": self.config.package_manager_args,
734
+ "venv_install_command": self.config.venv_install_command,
735
+ "python_version": self.config.python_version,
736
+ }
737
+
724
738
 
725
739
  def print_environment_info() -> None:
726
740
  str_bar = "".join(["-" for _ in range(80)])
@@ -16,9 +16,8 @@ from py_app_dev.core.logging import logger
16
16
 
17
17
  from pypeline import __version__
18
18
  from pypeline.bootstrap.run import get_bootstrap_script
19
-
20
- from ..domain.execution_context import ExecutionContext
21
- from ..domain.pipeline import PipelineStep
19
+ from pypeline.domain.execution_context import ExecutionContext
20
+ from pypeline.domain.pipeline import PipelineStep
22
21
 
23
22
 
24
23
  @dataclass
@@ -143,15 +142,27 @@ class CreateVEnv(PipelineStep[ExecutionContext]):
143
142
  Get python executable to use.
144
143
 
145
144
  Priority:
146
- 1. User-specified python_executable config
147
- 2. Auto-detect from python_version config
148
- 3. Current Python interpreter (sys.executable)
145
+ 1. Input from execution context (execution_context.get_input("python_version"))
146
+ 2. User-specified python_executable config
147
+ 3. Auto-detect from python_version config
148
+ 4. Current Python interpreter (sys.executable)
149
149
  """
150
- # Priority 1: User explicitly specified executable
150
+ # Priority 1: Check execution context inputs first
151
+ input_python_version = self.execution_context.get_input("python_version")
152
+ if input_python_version:
153
+ found_executable = self._find_python_executable(input_python_version)
154
+ if found_executable:
155
+ return found_executable
156
+ # If version specified via input but not found, fail with helpful error
157
+ raise UserNotificationException(
158
+ f"Could not find Python {input_python_version} in PATH. Please install Python {input_python_version} or specify python_executable explicitly."
159
+ )
160
+
161
+ # Priority 2: User explicitly specified executable
151
162
  if self.user_config.python_executable:
152
163
  return self.user_config.python_executable
153
164
 
154
- # Priority 2: Auto-detect from python_version
165
+ # Priority 3: Auto-detect from python_version config
155
166
  if self.user_config.python_version:
156
167
  found_executable = self._find_python_executable(self.user_config.python_version)
157
168
  if found_executable:
@@ -161,7 +172,7 @@ class CreateVEnv(PipelineStep[ExecutionContext]):
161
172
  f"Could not find Python {self.user_config.python_version} in PATH. Please install Python {self.user_config.python_version} or specify python_executable explicitly."
162
173
  )
163
174
 
164
- # Priority 3: Use current interpreter
175
+ # Priority 4: Use current interpreter
165
176
  return sys.executable
166
177
 
167
178
  @property
@@ -191,7 +202,7 @@ class CreateVEnv(PipelineStep[ExecutionContext]):
191
202
 
192
203
  @property
193
204
  def bootstrap_config_file(self) -> Path:
194
- return self.project_root_dir / "bootstrap.json"
205
+ return self.project_root_dir / ".bootstrap/bootstrap.json"
195
206
 
196
207
  def get_name(self) -> str:
197
208
  return self.__class__.__name__
@@ -220,8 +231,14 @@ class CreateVEnv(PipelineStep[ExecutionContext]):
220
231
  bootstrap_config = {}
221
232
  if self.user_config.package_manager:
222
233
  bootstrap_config["python_package_manager"] = self.user_config.package_manager
223
- if self.user_config.python_version:
234
+
235
+ # Priority: input python_version takes precedence over config python_version
236
+ input_python_version = self.execution_context.get_input("python_version")
237
+ if input_python_version:
238
+ bootstrap_config["python_version"] = input_python_version
239
+ elif self.user_config.python_version:
224
240
  bootstrap_config["python_version"] = self.user_config.python_version
241
+
225
242
  if self.user_config.package_manager_args:
226
243
  bootstrap_config["python_package_manager_args"] = self.user_config.package_manager_args
227
244
  if self.user_config.bootstrap_packages:
@@ -233,6 +250,7 @@ class CreateVEnv(PipelineStep[ExecutionContext]):
233
250
 
234
251
  # Write bootstrap.json if any configuration is provided
235
252
  if bootstrap_config:
253
+ self.bootstrap_config_file.parent.mkdir(exist_ok=True)
236
254
  self.bootstrap_config_file.write_text(json.dumps(bootstrap_config, indent=2))
237
255
  self.logger.info(f"Created bootstrap configuration at {self.bootstrap_config_file}")
238
256
 
@@ -1 +0,0 @@
1
- __version__ = "1.21.0"