From db29ad36fe86a21d383488c4053d0509bf4732eb Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Mon, 27 Jun 2022 20:05:34 +0200 Subject: [PATCH] Added dev-deps support to cpl install without package --- src/cpl_cli/command/install_service.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/cpl_cli/command/install_service.py b/src/cpl_cli/command/install_service.py index bc7ee764..b68c20dc 100644 --- a/src/cpl_cli/command/install_service.py +++ b/src/cpl_cli/command/install_service.py @@ -1,10 +1,11 @@ import json import os -import shutil import subprocess import textwrap import time +from packaging import version + from cpl_cli.cli_settings import CLISettings from cpl_cli.command_abc import CommandABC from cpl_cli.configuration.build_settings import BuildSettings @@ -17,7 +18,6 @@ from cpl_core.console.console import Console from cpl_core.console.foreground_color_enum import ForegroundColorEnum from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC from cpl_core.utils.pip import Pip -from packaging import version class InstallService(CommandABC): @@ -83,6 +83,17 @@ class InstallService(CommandABC): spinner_foreground_color=ForegroundColorEnum.cyan ) + for dependency in self._project_settings.dev_dependencies: + Console.spinner( + f'Installing dev: {dependency}', + Pip.install if not self._is_virtual else self._wait, dependency if not self._is_virtual else 2, + source=self._cli_settings.pip_path if 'cpl-' in dependency else None, + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + text_foreground_color=ForegroundColorEnum.green, + spinner_foreground_color=ForegroundColorEnum.cyan + ) + if not self._is_virtual: Pip.reset_executable()