Added dev-deps support to cpl install without package

This commit is contained in:
Sven Heidemann 2022-06-27 20:05:34 +02:00
parent 0710b25317
commit db29ad36fe

View File

@ -1,10 +1,11 @@
import json import json
import os import os
import shutil
import subprocess import subprocess
import textwrap import textwrap
import time import time
from packaging import version
from cpl_cli.cli_settings import CLISettings from cpl_cli.cli_settings import CLISettings
from cpl_cli.command_abc import CommandABC from cpl_cli.command_abc import CommandABC
from cpl_cli.configuration.build_settings import BuildSettings 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.console.foreground_color_enum import ForegroundColorEnum
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
from cpl_core.utils.pip import Pip from cpl_core.utils.pip import Pip
from packaging import version
class InstallService(CommandABC): class InstallService(CommandABC):
@ -83,6 +83,17 @@ class InstallService(CommandABC):
spinner_foreground_color=ForegroundColorEnum.cyan 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: if not self._is_virtual:
Pip.reset_executable() Pip.reset_executable()