pypeline-runner 1.17.0__py3-none-any.whl → 1.18.0__py3-none-any.whl
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/__init__.py +1 -1
- pypeline/bootstrap/run.py +14 -3
- pypeline/steps/create_venv.py +9 -0
- {pypeline_runner-1.17.0.dist-info → pypeline_runner-1.18.0.dist-info}/METADATA +1 -1
- {pypeline_runner-1.17.0.dist-info → pypeline_runner-1.18.0.dist-info}/RECORD +8 -8
- {pypeline_runner-1.17.0.dist-info → pypeline_runner-1.18.0.dist-info}/LICENSE +0 -0
- {pypeline_runner-1.17.0.dist-info → pypeline_runner-1.18.0.dist-info}/WHEEL +0 -0
- {pypeline_runner-1.17.0.dist-info → pypeline_runner-1.18.0.dist-info}/entry_points.txt +0 -0
pypeline/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.
|
|
1
|
+
__version__ = "1.18.0"
|
pypeline/bootstrap/run.py
CHANGED
|
@@ -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,7 +321,10 @@ class CreateVirtualEnvironment:
|
|
|
320
321
|
return "install"
|
|
321
322
|
|
|
322
323
|
def run(self) -> int:
|
|
323
|
-
self.
|
|
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)
|
|
@@ -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
|
pypeline/steps/create_venv.py
CHANGED
|
@@ -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,7 +1,7 @@
|
|
|
1
|
-
pypeline/__init__.py,sha256=
|
|
1
|
+
pypeline/__init__.py,sha256=eOdR8Sg_yEJg0qk8bqKXxy1LJBKxzo3fV50mKHzE9zE,23
|
|
2
2
|
pypeline/__run.py,sha256=TCdaX05Qm3g8T4QYryKB25Xxf0L5Km7hFOHe1mK9vI0,350
|
|
3
3
|
pypeline/bootstrap/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
pypeline/bootstrap/run.py,sha256=
|
|
4
|
+
pypeline/bootstrap/run.py,sha256=STvSIzl6KpJj2lXbTeFr6mJnJQcjPR-BXD7enoWUlto,16436
|
|
5
5
|
pypeline/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
pypeline/domain/artifacts.py,sha256=5k7cVfHhLmvWXNuHKxXb9ca4Lxu0JytGQqazENCeKEU,1404
|
|
7
7
|
pypeline/domain/config.py,sha256=6vWdHi7B6MA7NGi9wWXQE-YhSg1COSRmc3b1ji6AdAk,2053
|
|
@@ -21,12 +21,12 @@ pypeline/main.py,sha256=2mC2BDB1OWIXhaijBXG6Y1vfT8_yMZ4Dj55w5u7g7-w,4158
|
|
|
21
21
|
pypeline/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
22
|
pypeline/pypeline.py,sha256=-mquLfFlEvESk-HORhvjRMESIzdlVAgBLPjwUDOPLqg,7452
|
|
23
23
|
pypeline/steps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
|
-
pypeline/steps/create_venv.py,sha256=
|
|
24
|
+
pypeline/steps/create_venv.py,sha256=ioL59vC1GbEk_EpUFMRRkWXk8W7z7QCEV-zgcho_lSg,6292
|
|
25
25
|
pypeline/steps/env_setup_script.py,sha256=u08A6pvMccFQbcnU0xruFvpU30PbDrttnbOjl1gDqog,2340
|
|
26
26
|
pypeline/steps/scoop_install.py,sha256=DDXBD-5TVaT-u6Yf7A85uWoCgBVmLvj9nPGrZ8OQCz0,3853
|
|
27
27
|
pypeline/steps/west_install.py,sha256=hPyr28ksdKsQ0tv0gMNytzupgk1IgjN9CpmaBdX5zps,1947
|
|
28
|
-
pypeline_runner-1.
|
|
29
|
-
pypeline_runner-1.
|
|
30
|
-
pypeline_runner-1.
|
|
31
|
-
pypeline_runner-1.
|
|
32
|
-
pypeline_runner-1.
|
|
28
|
+
pypeline_runner-1.18.0.dist-info/LICENSE,sha256=sKxdoqSmW9ezvPvt0ZGJbneyA0SBcm0GiqzTv2jN230,1066
|
|
29
|
+
pypeline_runner-1.18.0.dist-info/METADATA,sha256=yNndVifPIjTKD-7CI8z2ccPLVgMnP-R4BZa_vDhtFQw,7553
|
|
30
|
+
pypeline_runner-1.18.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
31
|
+
pypeline_runner-1.18.0.dist-info/entry_points.txt,sha256=pe1u0uuhPI_yeQ0KjEw6jK-EvQfPcZwBSajgbAdKz1o,47
|
|
32
|
+
pypeline_runner-1.18.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|