Bugfixes for cli
This commit is contained in:
@@ -15,7 +15,7 @@ __title__ = 'cpl_cli.command'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.4.1.post7'
|
||||
__version__ = '2021.4.1.post8'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -28,4 +28,4 @@ from .publish_service import PublishService
|
||||
from .version_service import VersionService
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='04', micro='01-7')
|
||||
version_info = VersionInfo(major='2021', minor='04', micro='01-8')
|
||||
|
@@ -9,6 +9,7 @@ from cpl.configuration import ConfigurationABC
|
||||
from cpl.console.console import Console
|
||||
from cpl.console.foreground_color_enum import ForegroundColorEnum
|
||||
from cpl.utils.pip import Pip
|
||||
from cpl_cli.cli_settings import CLISettings
|
||||
from cpl_cli.command_abc import CommandABC
|
||||
from cpl_cli.configuration import ProjectSettingsNameEnum, VersionSettingsNameEnum, BuildSettingsNameEnum
|
||||
from cpl_cli.configuration.build_settings import BuildSettings
|
||||
@@ -18,7 +19,7 @@ from cpl_cli.error import Error
|
||||
|
||||
class InstallService(CommandABC):
|
||||
|
||||
def __init__(self, runtime: ApplicationRuntimeABC, configuration: ConfigurationABC):
|
||||
def __init__(self, runtime: ApplicationRuntimeABC, configuration: ConfigurationABC, cli_settings: CLISettings):
|
||||
"""
|
||||
Service for the CLI command install
|
||||
:param runtime:
|
||||
@@ -28,6 +29,7 @@ class InstallService(CommandABC):
|
||||
|
||||
self._runtime = runtime
|
||||
self._config = configuration
|
||||
self._cli_settings = cli_settings
|
||||
|
||||
def _install_project(self):
|
||||
"""
|
||||
@@ -50,7 +52,7 @@ class InstallService(CommandABC):
|
||||
Console.spinner(
|
||||
f'Installing: {dependency}',
|
||||
Pip.install, dependency,
|
||||
source='https://pip.sh-edraft.de' if 'sh_cpl' in dependency else None,
|
||||
source=self._cli_settings.pip_path if 'sh_cpl' in dependency else None,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
@@ -150,7 +152,7 @@ class InstallService(CommandABC):
|
||||
Console.spinner(
|
||||
f'Installing: {package}',
|
||||
Pip.install, package,
|
||||
source='https://pip.sh-edraft.de' if 'sh_cpl' in package else None,
|
||||
source=self._cli_settings.pip_path if 'sh_cpl' in package else None,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
|
@@ -6,13 +6,14 @@ from cpl.application import ApplicationRuntimeABC
|
||||
from cpl.console import ForegroundColorEnum
|
||||
from cpl.console.console import Console
|
||||
from cpl.utils.pip import Pip
|
||||
from cpl_cli.cli_settings import CLISettings
|
||||
from cpl_cli.command_abc import CommandABC
|
||||
from cpl_cli.configuration.project_settings import ProjectSettings
|
||||
|
||||
|
||||
class UpdateService(CommandABC):
|
||||
|
||||
def __init__(self, runtime: ApplicationRuntimeABC, project_settings: ProjectSettings):
|
||||
def __init__(self, runtime: ApplicationRuntimeABC, project_settings: ProjectSettings, cli_settings: CLISettings):
|
||||
"""
|
||||
Service for the CLI command update
|
||||
:param runtime:
|
||||
@@ -22,6 +23,7 @@ class UpdateService(CommandABC):
|
||||
|
||||
self._runtime = runtime
|
||||
self._project_settings = project_settings
|
||||
self._cli_settings = cli_settings
|
||||
|
||||
def _update_project_dependencies(self):
|
||||
"""
|
||||
@@ -38,7 +40,7 @@ class UpdateService(CommandABC):
|
||||
'--upgrade',
|
||||
'--upgrade-strategy',
|
||||
'eager',
|
||||
source='https://pip.sh-edraft.de' if 'sh_cpl' in name else None,
|
||||
source=self._cli_settings.pip_path if 'sh_cpl' in name else None,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL
|
||||
)
|
||||
|
Reference in New Issue
Block a user