pypeline-runner 1.23.1__tar.gz → 1.23.2__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.23.1 → pypeline_runner-1.23.2}/PKG-INFO +1 -1
  2. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/pyproject.toml +1 -1
  3. pypeline_runner-1.23.2/src/pypeline/__init__.py +1 -0
  4. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/bootstrap/run.py +26 -17
  5. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/steps/create_venv.py +5 -5
  6. pypeline_runner-1.23.1/src/pypeline/__init__.py +0 -1
  7. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/LICENSE +0 -0
  8. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/README.md +0 -0
  9. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/__run.py +0 -0
  10. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/bootstrap/__init__.py +0 -0
  11. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/domain/__init__.py +0 -0
  12. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/domain/artifacts.py +0 -0
  13. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/domain/config.py +0 -0
  14. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/domain/execution_context.py +0 -0
  15. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/domain/pipeline.py +0 -0
  16. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/domain/project_slurper.py +0 -0
  17. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/inputs_parser.py +0 -0
  18. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/kickstart/__init__.py +0 -0
  19. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/kickstart/create.py +0 -0
  20. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/kickstart/templates/project/.gitignore +0 -0
  21. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/kickstart/templates/project/pypeline.ps1 +0 -0
  22. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/kickstart/templates/project/pypeline.yaml +0 -0
  23. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/kickstart/templates/project/pyproject.toml +0 -0
  24. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/kickstart/templates/project/steps/my_step.py +0 -0
  25. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/kickstart/templates/project/west.yaml +0 -0
  26. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/main.py +0 -0
  27. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/py.typed +0 -0
  28. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/pypeline.py +0 -0
  29. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/steps/__init__.py +0 -0
  30. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/steps/env_setup_script.py +0 -0
  31. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/src/pypeline/steps/scoop_install.py +0 -0
  32. {pypeline_runner-1.23.1 → pypeline_runner-1.23.2}/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.23.1
3
+ Version: 1.23.2
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.23.1"
3
+ version = "1.23.2"
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.23.2"
@@ -583,6 +583,7 @@ class CreateVirtualEnvironment(Runnable):
583
583
  self,
584
584
  root_dir: Path,
585
585
  bootstrap_env: CreateBootstrapEnvironment,
586
+ skip_venv_delete: bool = False,
586
587
  ) -> None:
587
588
  self.root_dir = root_dir
588
589
  self.venv_dir = self.root_dir / ".venv"
@@ -591,6 +592,7 @@ class CreateVirtualEnvironment(Runnable):
591
592
  self.bootstrap_env = bootstrap_env
592
593
  self.config = bootstrap_env.config
593
594
  self.python_version_marker = self.venv_dir / VENV_PYTHON_VERSION_MARKER
595
+ self.skip_venv_delete = skip_venv_delete
594
596
 
595
597
  @property
596
598
  def package_manager_name(self) -> str:
@@ -602,6 +604,7 @@ class CreateVirtualEnvironment(Runnable):
602
604
 
603
605
  If the Python version has changed (e.g., switching branches), delete the
604
606
  existing venv so it can be recreated by the package manager.
607
+ If skip_venv_delete is True, log a warning instead of deleting.
605
608
  """
606
609
  if not self.venv_dir.exists():
607
610
  return
@@ -609,19 +612,27 @@ class CreateVirtualEnvironment(Runnable):
609
612
  current_version = f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
610
613
 
611
614
  if not self.python_version_marker.exists():
612
- logger.info(
613
- f"No Python version marker found in {self.venv_dir}. "
614
- f"This venv may have been created before version tracking was added. "
615
- f"Deleting {self.venv_dir} to ensure clean state."
616
- )
617
- shutil.rmtree(self.venv_dir)
615
+ if self.skip_venv_delete:
616
+ logger.warning(f"No Python version marker found in {self.venv_dir}. Cannot verify venv compatibility, but skipping deletion as requested.")
617
+ else:
618
+ logger.info(
619
+ f"No Python version marker found in {self.venv_dir}. "
620
+ f"This venv may have been created before version tracking was added. "
621
+ f"Deleting {self.venv_dir} to ensure clean state."
622
+ )
623
+ shutil.rmtree(self.venv_dir)
618
624
  return
619
625
 
620
626
  try:
621
627
  stored_version = self.python_version_marker.read_text().strip()
622
628
  if stored_version != current_version:
623
- logger.info(f"Python version changed from {stored_version} to {current_version}. Deleting {self.venv_dir} for recreation.")
624
- shutil.rmtree(self.venv_dir)
629
+ if self.skip_venv_delete:
630
+ logger.warning(
631
+ f"Python version changed from {stored_version} to {current_version}. Skipping venv deletion as requested - dependencies will be updated in place."
632
+ )
633
+ else:
634
+ logger.info(f"Python version changed from {stored_version} to {current_version}. Deleting {self.venv_dir} for recreation.")
635
+ shutil.rmtree(self.venv_dir)
625
636
  except OSError as exc:
626
637
  logger.warning(f"Could not read Python version marker: {exc}")
627
638
 
@@ -772,11 +783,11 @@ def main() -> int:
772
783
  help="Specify the project directory (default: current working directory).",
773
784
  )
774
785
  parser.add_argument(
775
- "--skip-venv-creation",
786
+ "--skip-venv-delete",
776
787
  action="store_true",
777
788
  required=False,
778
789
  default=False,
779
- help="Skip the virtual environment creation process.",
790
+ help="Skip deleting the virtual environment (used when running from within the venv). Dependencies will still be updated.",
780
791
  )
781
792
  parser.add_argument(
782
793
  "--config",
@@ -804,13 +815,11 @@ def main() -> int:
804
815
  bootstrap_executor.execute(bootstrap_env)
805
816
 
806
817
  # Step 2: Create the project virtual environment using the bootstrap env
807
- # Skip if requested (e.g., when running from within the venv)
808
- if not args.skip_venv_creation:
809
- project_venv = CreateVirtualEnvironment(project_dir, bootstrap_env)
810
- project_executor = Executor(project_venv.venv_dir)
811
- project_executor.execute(project_venv)
812
- else:
813
- logger.info("Skipping virtual environment creation as requested.")
818
+ # When skip_venv_delete is True (e.g., running from within the venv),
819
+ # we still update dependencies but skip deleting the venv to avoid write access exceptions
820
+ project_venv = CreateVirtualEnvironment(project_dir, bootstrap_env, skip_venv_delete=args.skip_venv_delete)
821
+ project_executor = Executor(project_venv.venv_dir)
822
+ project_executor.execute(project_venv)
814
823
 
815
824
  except UserNotificationException as exc:
816
825
  logger.error(exc)
@@ -287,11 +287,11 @@ class CreateVEnv(PipelineStep[ExecutionContext]):
287
287
  ).execute()
288
288
  else:
289
289
  # Use internal bootstrap script
290
- skip_venv_creation = False
290
+ skip_venv_delete = False
291
291
  python_executable = Path(sys.executable).absolute()
292
292
  if python_executable.is_relative_to(self.project_root_dir):
293
- self.logger.info(f"Detected that the python executable '{python_executable}' is from the virtual environment. Skip updating the virtual environment.")
294
- skip_venv_creation = True
293
+ self.logger.info(f"Detected that the python executable '{python_executable}' is from the virtual environment. Will update dependencies but skip venv deletion.")
294
+ skip_venv_delete = True
295
295
 
296
296
  # Create bootstrap.json with all configuration
297
297
  bootstrap_config = {}
@@ -330,8 +330,8 @@ class CreateVEnv(PipelineStep[ExecutionContext]):
330
330
  if self.bootstrap_config_file.exists():
331
331
  bootstrap_args.extend(["--config", self.bootstrap_config_file.as_posix()])
332
332
 
333
- if skip_venv_creation:
334
- bootstrap_args.append("--skip-venv-creation")
333
+ if skip_venv_delete:
334
+ bootstrap_args.append("--skip-venv-delete")
335
335
 
336
336
  # Copy the internal bootstrap script to the project root .bootstrap/bootstrap.py
337
337
  self.target_internal_bootstrap_script.parent.mkdir(exist_ok=True)
@@ -1 +0,0 @@
1
- __version__ = "1.23.1"