pypeline-runner 1.17.0__tar.gz → 1.18.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.
Files changed (32) hide show
  1. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/PKG-INFO +1 -1
  2. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/pyproject.toml +1 -1
  3. pypeline_runner-1.18.1/src/pypeline/__init__.py +1 -0
  4. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/bootstrap/run.py +15 -4
  5. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/steps/create_venv.py +9 -0
  6. pypeline_runner-1.17.0/src/pypeline/__init__.py +0 -1
  7. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/LICENSE +0 -0
  8. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/README.md +0 -0
  9. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/__run.py +0 -0
  10. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/bootstrap/__init__.py +0 -0
  11. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/domain/__init__.py +0 -0
  12. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/domain/artifacts.py +0 -0
  13. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/domain/config.py +0 -0
  14. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/domain/execution_context.py +0 -0
  15. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/domain/pipeline.py +0 -0
  16. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/domain/project_slurper.py +0 -0
  17. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/inputs_parser.py +0 -0
  18. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/kickstart/__init__.py +0 -0
  19. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/kickstart/create.py +0 -0
  20. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/kickstart/templates/project/.gitignore +0 -0
  21. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/kickstart/templates/project/pypeline.ps1 +0 -0
  22. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/kickstart/templates/project/pypeline.yaml +0 -0
  23. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/kickstart/templates/project/pyproject.toml +0 -0
  24. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/kickstart/templates/project/steps/my_step.py +0 -0
  25. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/kickstart/templates/project/west.yaml +0 -0
  26. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/main.py +0 -0
  27. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/py.typed +0 -0
  28. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/pypeline.py +0 -0
  29. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/steps/__init__.py +0 -0
  30. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/steps/env_setup_script.py +0 -0
  31. {pypeline_runner-1.17.0 → pypeline_runner-1.18.1}/src/pypeline/steps/scoop_install.py +0 -0
  32. {pypeline_runner-1.17.0 → pypeline_runner-1.18.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.17.0
3
+ Version: 1.18.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
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pypeline-runner"
3
- version = "1.17.0"
3
+ version = "1.18.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"
@@ -0,0 +1 @@
1
+ __version__ = "1.18.1"
@@ -298,12 +298,13 @@ class UnixVirtualEnvironment(VirtualEnvironment):
298
298
 
299
299
 
300
300
  class CreateVirtualEnvironment:
301
- def __init__(self, root_dir: Path, package_manager: str) -> None:
301
+ def __init__(self, root_dir: Path, package_manager: str, skip_venv_creation: bool = False) -> None:
302
302
  self.root_dir = root_dir
303
303
  self.venv_dir = self.root_dir / ".venv"
304
304
  self.virtual_env = self.instantiate_os_specific_venv(self.venv_dir)
305
305
  self.package_manager = package_manager.replace('"', "").replace("'", "")
306
306
  self.execution_info_file = self.venv_dir / "virtual_env_exec_info.json"
307
+ self.skip_venv_creation = skip_venv_creation
307
308
 
308
309
  @property
309
310
  def package_manager_name(self) -> str:
@@ -320,14 +321,17 @@ class CreateVirtualEnvironment:
320
321
  return "install"
321
322
 
322
323
  def run(self) -> int:
323
- self.virtual_env.create()
324
+ if not self.skip_venv_creation:
325
+ self.virtual_env.create()
326
+ else:
327
+ logger.info("Skipping virtual environment creation as requested.")
324
328
 
325
329
  # Get the PyPi source from pyproject.toml or Pipfile if it is defined
326
330
  pypi_source = PyPiSourceParser.from_pyproject(self.root_dir)
327
331
  if pypi_source:
328
332
  self.virtual_env.pip_configure(index_url=pypi_source.url, verify_ssl=True)
329
333
  # We need pip-system-certs in venv to use certificates, that are stored in the system's trust store,
330
- pip_args = ["install", self.package_manager, "pip-system-certs"]
334
+ pip_args = ["install", self.package_manager, "pip-system-certs>=4.0,<5.0"]
331
335
  # but to install it, we need either a pip version with the trust store feature or to trust the host
332
336
  # (trust store feature enabled by default since 24.2)
333
337
  if Version(ensurepip.version()) < Version("24.2"):
@@ -377,9 +381,16 @@ def main() -> int:
377
381
  default=Path.cwd(),
378
382
  help="Specify the project directory (default: current working directory).",
379
383
  )
384
+ parser.add_argument(
385
+ "--skip-venv-creation",
386
+ action="store_true",
387
+ required=False,
388
+ default=False,
389
+ help="Skip the virtual environment creation process.",
390
+ )
380
391
  args = parser.parse_args()
381
392
 
382
- CreateVirtualEnvironment(args.project_dir, package_manager=args.package_manager).run()
393
+ CreateVirtualEnvironment(args.project_dir, package_manager=args.package_manager, skip_venv_creation=args.skip_venv_creation).run()
383
394
  except UserNotificationException as e:
384
395
  logger.error(e)
385
396
  return 1
@@ -1,4 +1,5 @@
1
1
  import re
2
+ import sys
2
3
  from dataclasses import dataclass
3
4
  from enum import Enum, auto
4
5
  from pathlib import Path
@@ -81,6 +82,12 @@ class CreateVEnv(PipelineStep[ExecutionContext]):
81
82
  cwd=self.project_root_dir,
82
83
  ).execute()
83
84
  else:
85
+ skip_venv_creation = False
86
+ python_executable = Path(sys.executable).absolute()
87
+ if python_executable.is_relative_to(self.project_root_dir):
88
+ self.logger.info(f"Detected that the python executable '{python_executable}' is from the virtual environment. Skip updating the virtual environment.")
89
+ skip_venv_creation = True
90
+
84
91
  # The internal bootstrap script supports arguments.
85
92
  bootstrap_args = [
86
93
  "--project-dir",
@@ -88,6 +95,8 @@ class CreateVEnv(PipelineStep[ExecutionContext]):
88
95
  "--package-manager",
89
96
  f'"{self.package_manager}"',
90
97
  ]
98
+ if skip_venv_creation:
99
+ bootstrap_args.append("--skip-venv-creation")
91
100
 
92
101
  # Copy the internal bootstrap script to the project root .bootstrap/bootstrap.py
93
102
  self.target_internal_bootstrap_script.parent.mkdir(exist_ok=True)
@@ -1 +0,0 @@
1
- __version__ = "1.17.0"