2021.4.1 #11
@ -36,16 +36,20 @@ class InstallService(CommandABC):
|
|||||||
Error.error('Found invalid dependencies in cpl.json.')
|
Error.error('Found invalid dependencies in cpl.json.')
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Pip.set_executable(project.python_path)
|
||||||
for dependency in project.dependencies:
|
for dependency in project.dependencies:
|
||||||
Console.spinner(
|
Console.spinner(
|
||||||
f'Installing: {dependency}',
|
f'Installing: {dependency}',
|
||||||
Pip.install, dependency,
|
Pip.install, dependency,
|
||||||
|
source='https://pip.sh-edraft.de' if 'sh_cpl' in dependency else None,
|
||||||
stdout=subprocess.DEVNULL,
|
stdout=subprocess.DEVNULL,
|
||||||
stderr=subprocess.DEVNULL,
|
stderr=subprocess.DEVNULL,
|
||||||
text_foreground_color=ForegroundColorEnum.green,
|
text_foreground_color=ForegroundColorEnum.green,
|
||||||
spinner_foreground_color=ForegroundColorEnum.cyan
|
spinner_foreground_color=ForegroundColorEnum.cyan
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Pip.reset_executable()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_project_settings_dict(project: ProjectSettings) -> dict:
|
def _get_project_settings_dict(project: ProjectSettings) -> dict:
|
||||||
return {
|
return {
|
||||||
|
@ -21,22 +21,12 @@ class UpdateService(CommandABC):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _install_package(name: str):
|
def _install_package(name: str):
|
||||||
if 'sh_cpl' in name:
|
|
||||||
Pip.install(
|
|
||||||
name,
|
|
||||||
'--upgrade',
|
|
||||||
'--upgrade-strategy',
|
|
||||||
'eager',
|
|
||||||
source='https://pip.sh-edraft.de',
|
|
||||||
stdout=subprocess.DEVNULL,
|
|
||||||
stderr=subprocess.DEVNULL
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
Pip.install(
|
Pip.install(
|
||||||
name,
|
name,
|
||||||
'--upgrade',
|
'--upgrade',
|
||||||
'--upgrade-strategy',
|
'--upgrade-strategy',
|
||||||
'eager',
|
'eager',
|
||||||
|
source='https://pip.sh-edraft.de' if 'sh_cpl' in name else None,
|
||||||
stdout=subprocess.DEVNULL,
|
stdout=subprocess.DEVNULL,
|
||||||
stderr=subprocess.DEVNULL
|
stderr=subprocess.DEVNULL
|
||||||
)
|
)
|
||||||
|
@ -109,10 +109,8 @@ class ProjectSettings(ConfigurationModelABC):
|
|||||||
self._python_version = settings[ProjectSettingsNameEnum.python_version.value]
|
self._python_version = settings[ProjectSettingsNameEnum.python_version.value]
|
||||||
|
|
||||||
if ProjectSettingsNameEnum.python_path.value in settings:
|
if ProjectSettingsNameEnum.python_path.value in settings:
|
||||||
path = os.path.abspath(settings[ProjectSettingsNameEnum.python_path.value])
|
path = settings[ProjectSettingsNameEnum.python_path.value]
|
||||||
if os.path.isfile(path) or os.path.islink(path):
|
if not os.path.isfile(path) or not os.path.islink(path):
|
||||||
path = os.path.abspath(path)
|
|
||||||
else:
|
|
||||||
path = sys.executable
|
path = sys.executable
|
||||||
Error.warn(f'{ProjectSettingsNameEnum.python_path.value} not found')
|
Error.warn(f'{ProjectSettingsNameEnum.python_path.value} not found')
|
||||||
else:
|
else:
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
"sh_cpl==2021.4.1"
|
"sh_cpl==2021.4.1"
|
||||||
],
|
],
|
||||||
"PythonVersion": ">=3.8",
|
"PythonVersion": ">=3.8",
|
||||||
"PythonPath": "/home/sven/Nextcloud_Sven/Schreibtisch/git_sh-edraft_de/sh_common_py_lib/cpl-env/bin/python3.9",
|
"PythonPath": "../../../../cpl-env/bin/python3.9",
|
||||||
"Classifiers": []
|
"Classifiers": []
|
||||||
},
|
},
|
||||||
"BuildSettings": {
|
"BuildSettings": {
|
||||||
|
Loading…
Reference in New Issue
Block a user