From f69500418e631db167fed1cdce46ec0d9e0081fc Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 17 Mar 2021 08:12:56 +0100 Subject: [PATCH] Bugfixes in install command --- src/cpl_cli/command/install_service.py | 10 +++++----- src/tests/custom/general/cpl.json | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/cpl_cli/command/install_service.py b/src/cpl_cli/command/install_service.py index baf33b89..b228a157 100644 --- a/src/cpl_cli/command/install_service.py +++ b/src/cpl_cli/command/install_service.py @@ -92,8 +92,8 @@ class InstallService(CommandABC): if '==' in dependency: dependency_version = dependency.split('==')[1] - if package in dependency: - if version.parse(package_version) != version.parse(dependency_version): + if name in dependency: + if package_version != '' and version.parse(package_version) != version.parse(dependency_version): to_remove_list.append(dependency) break else: @@ -145,9 +145,9 @@ class InstallService(CommandABC): BuildSettings.__name__: SettingsHelper.get_build_settings_dict(self._build_settings) } - #with open(os.path.join(self._runtime.working_directory, 'cpl.json'), 'w') as project_file: - # project_file.write(json.dumps(config, indent=2)) - # project_file.close() + with open(os.path.join(self._runtime.working_directory, 'cpl.json'), 'w') as project_file: + project_file.write(json.dumps(config, indent=2)) + project_file.close() Pip.reset_executable() diff --git a/src/tests/custom/general/cpl.json b/src/tests/custom/general/cpl.json index 35241af0..92bfd4f1 100644 --- a/src/tests/custom/general/cpl.json +++ b/src/tests/custom/general/cpl.json @@ -16,7 +16,8 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "sh_cpl==2021.4.1.post11" + "sh_cpl==2021.4.1.post11", + "discord.py==1.6.0" ], "PythonVersion": ">=3.8", "PythonPath": "../../../../cpl-env/bin/python3.9",