From 8e12c72b077ec3b186d99959de0519b8d5c3410c Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Mon, 12 Jun 2023 20:45:22 +0200 Subject: [PATCH 1/2] Fixed cpl update dev deps bug #170 --- src/cpl_cli/command/update_service.py | 33 +++++++++++++++++++-------- src/cpl_cli/cpl-cli.json | 2 +- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/cpl_cli/command/update_service.py b/src/cpl_cli/command/update_service.py index 607de0d3..49554a43 100644 --- a/src/cpl_cli/command/update_service.py +++ b/src/cpl_cli/command/update_service.py @@ -154,6 +154,24 @@ class UpdateService(CommandABC): Console.write_line(f"\tUpdate with {Pip.get_executable()} -m pip install --upgrade ") Console.set_foreground_color(ForegroundColorEnum.default) + def _save_formatted_package_name_to_deps_collection(self, deps: [str], old_package: str, new_package: str): + if old_package not in deps: + return + + initial_package = new_package + + if "/" in new_package: + new_package = new_package.split("/")[0] + + if "\r" in new_package: + new_package = new_package.replace("\r", "") + + if new_package == initial_package: + return + + index = self._project_settings.dependencies.index(old_package) + deps[index] = new_package + def _project_json_update_dependency(self, old_package: str, new_package: str): """ Writes new package version to project.json @@ -164,15 +182,12 @@ class UpdateService(CommandABC): if self._is_simulation: return - if old_package in self._project_settings.dependencies: - index = self._project_settings.dependencies.index(old_package) - if "/" in new_package: - new_package = new_package.split("/")[0] - - if "\r" in new_package: - new_package = new_package.replace("\r", "") - - self._project_settings.dependencies[index] = new_package + self._save_formatted_package_name_to_deps_collection( + self._project_settings.dependencies, old_package, new_package + ) + self._save_formatted_package_name_to_deps_collection( + self._project_settings.dev_dependencies, old_package, new_package + ) config = { ProjectSettings.__name__: SettingsHelper.get_project_settings_dict(self._project_settings), diff --git a/src/cpl_cli/cpl-cli.json b/src/cpl_cli/cpl-cli.json index fedc4378..23a84eac 100644 --- a/src/cpl_cli/cpl-cli.json +++ b/src/cpl_cli/cpl-cli.json @@ -4,7 +4,7 @@ "Version": { "Major": "2023", "Minor": "4", - "Micro": "0" + "Micro": "0.post1" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", From ea968d94e4a5cb1868aef78aa86cfc31263d5463 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Mon, 12 Jun 2023 20:45:42 +0200 Subject: [PATCH 2/2] Build app --- src/cpl_cli/.cpl/__init__.py | 4 ++-- src/cpl_cli/__init__.py | 4 ++-- src/cpl_cli/_templates/__init__.py | 4 ++-- src/cpl_cli/_templates/build/__init__.py | 4 ++-- src/cpl_cli/_templates/publish/__init__.py | 4 ++-- src/cpl_cli/abc/__init__.py | 4 ++-- src/cpl_cli/command/__init__.py | 4 ++-- src/cpl_cli/configuration/__init__.py | 4 ++-- src/cpl_cli/helper/__init__.py | 4 ++-- src/cpl_cli/live_server/__init__.py | 4 ++-- src/cpl_cli/migrations/__init__.py | 4 ++-- src/cpl_cli/migrations/base/__init__.py | 4 ++-- src/cpl_cli/migrations/service/__init__.py | 4 ++-- src/cpl_cli/publish/__init__.py | 4 ++-- src/cpl_cli/source_creator/__init__.py | 4 ++-- src/cpl_cli/validators/__init__.py | 4 ++-- 16 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/cpl_cli/.cpl/__init__.py b/src/cpl_cli/.cpl/__init__.py index b89a974a..c58bda00 100644 --- a/src/cpl_cli/.cpl/__init__.py +++ b/src/cpl_cli/.cpl/__init__.py @@ -15,7 +15,7 @@ __title__ = "cpl_cli" __author__ = "Sven Heidemann" __license__ = "MIT" __copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" -__version__ = "2023.4.0" +__version__ = "2023.4.0.post1" from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple("VersionInfo", "major minor micro") -version_info = VersionInfo(major="2023", minor="4", micro="0") +version_info = VersionInfo(major="2023", minor="4", micro="0.post1") diff --git a/src/cpl_cli/__init__.py b/src/cpl_cli/__init__.py index daff2148..1711b0df 100644 --- a/src/cpl_cli/__init__.py +++ b/src/cpl_cli/__init__.py @@ -15,7 +15,7 @@ __title__ = "cpl_cli" __author__ = "Sven Heidemann" __license__ = "MIT" __copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" -__version__ = "2023.4.0" +__version__ = "2023.4.0.post1" from collections import namedtuple @@ -28,4 +28,4 @@ from .main import main from .startup import Startup VersionInfo = namedtuple("VersionInfo", "major minor micro") -version_info = VersionInfo(major="2023", minor="4", micro="0") +version_info = VersionInfo(major="2023", minor="4", micro="0.post1") diff --git a/src/cpl_cli/_templates/__init__.py b/src/cpl_cli/_templates/__init__.py index 7d78b8f1..6b51d213 100644 --- a/src/cpl_cli/_templates/__init__.py +++ b/src/cpl_cli/_templates/__init__.py @@ -15,7 +15,7 @@ __title__ = "cpl_cli._templates" __author__ = "Sven Heidemann" __license__ = "MIT" __copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" -__version__ = "2023.4.0" +__version__ = "2023.4.0.post1" from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple("VersionInfo", "major minor micro") -version_info = VersionInfo(major="2023", minor="4", micro="0") +version_info = VersionInfo(major="2023", minor="4", micro="0.post1") diff --git a/src/cpl_cli/_templates/build/__init__.py b/src/cpl_cli/_templates/build/__init__.py index 64f62b54..1824be41 100644 --- a/src/cpl_cli/_templates/build/__init__.py +++ b/src/cpl_cli/_templates/build/__init__.py @@ -15,7 +15,7 @@ __title__ = "cpl_cli._templates.build" __author__ = "Sven Heidemann" __license__ = "MIT" __copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" -__version__ = "2023.4.0" +__version__ = "2023.4.0.post1" from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple("VersionInfo", "major minor micro") -version_info = VersionInfo(major="2023", minor="4", micro="0") +version_info = VersionInfo(major="2023", minor="4", micro="0.post1") diff --git a/src/cpl_cli/_templates/publish/__init__.py b/src/cpl_cli/_templates/publish/__init__.py index 4e2340d9..09192f90 100644 --- a/src/cpl_cli/_templates/publish/__init__.py +++ b/src/cpl_cli/_templates/publish/__init__.py @@ -15,7 +15,7 @@ __title__ = "cpl_cli._templates.publish" __author__ = "Sven Heidemann" __license__ = "MIT" __copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" -__version__ = "2023.4.0" +__version__ = "2023.4.0.post1" from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple("VersionInfo", "major minor micro") -version_info = VersionInfo(major="2023", minor="4", micro="0") +version_info = VersionInfo(major="2023", minor="4", micro="0.post1") diff --git a/src/cpl_cli/abc/__init__.py b/src/cpl_cli/abc/__init__.py index 92f00d2f..9b1fab82 100644 --- a/src/cpl_cli/abc/__init__.py +++ b/src/cpl_cli/abc/__init__.py @@ -15,7 +15,7 @@ __title__ = "cpl_cli.abc" __author__ = "Sven Heidemann" __license__ = "MIT" __copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" -__version__ = "2023.4.0" +__version__ = "2023.4.0.post1" from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports VersionInfo = namedtuple("VersionInfo", "major minor micro") -version_info = VersionInfo(major="2023", minor="4", micro="0") +version_info = VersionInfo(major="2023", minor="4", micro="0.post1") diff --git a/src/cpl_cli/command/__init__.py b/src/cpl_cli/command/__init__.py index 8a33ad19..b29d24d9 100644 --- a/src/cpl_cli/command/__init__.py +++ b/src/cpl_cli/command/__init__.py @@ -15,7 +15,7 @@ __title__ = "cpl_cli.command" __author__ = "Sven Heidemann" __license__ = "MIT" __copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" -__version__ = "2023.4.0" +__version__ = "2023.4.0.post1" from collections import namedtuple @@ -29,4 +29,4 @@ from .publish_service import PublishService from .version_service import VersionService VersionInfo = namedtuple("VersionInfo", "major minor micro") -version_info = VersionInfo(major="2023", minor="4", micro="0") +version_info = VersionInfo(major="2023", minor="4", micro="0.post1") diff --git a/src/cpl_cli/configuration/__init__.py b/src/cpl_cli/configuration/__init__.py index facabf20..e8ca3033 100644 --- a/src/cpl_cli/configuration/__init__.py +++ b/src/cpl_cli/configuration/__init__.py @@ -15,7 +15,7 @@ __title__ = "cpl_cli.configuration" __author__ = "Sven Heidemann" __license__ = "MIT" __copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" -__version__ = "2023.4.0" +__version__ = "2023.4.0.post1" from collections import namedtuple @@ -31,4 +31,4 @@ from .workspace_settings import WorkspaceSettings from .workspace_settings_name_enum import WorkspaceSettingsNameEnum VersionInfo = namedtuple("VersionInfo", "major minor micro") -version_info = VersionInfo(major="2023", minor="4", micro="0") +version_info = VersionInfo(major="2023", minor="4", micro="0.post1") diff --git a/src/cpl_cli/helper/__init__.py b/src/cpl_cli/helper/__init__.py index 78ac4c3f..4b177678 100644 --- a/src/cpl_cli/helper/__init__.py +++ b/src/cpl_cli/helper/__init__.py @@ -15,7 +15,7 @@ __title__ = "cpl_cli.helper" __author__ = "Sven Heidemann" __license__ = "MIT" __copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" -__version__ = "2023.4.0" +__version__ = "2023.4.0.post1" from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple("VersionInfo", "major minor micro") -version_info = VersionInfo(major="2023", minor="4", micro="0") +version_info = VersionInfo(major="2023", minor="4", micro="0.post1") diff --git a/src/cpl_cli/live_server/__init__.py b/src/cpl_cli/live_server/__init__.py index ed81df4a..7fba1533 100644 --- a/src/cpl_cli/live_server/__init__.py +++ b/src/cpl_cli/live_server/__init__.py @@ -15,7 +15,7 @@ __title__ = "cpl_cli.live_server" __author__ = "Sven Heidemann" __license__ = "MIT" __copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" -__version__ = "2023.4.0" +__version__ = "2023.4.0.post1" from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple("VersionInfo", "major minor micro") -version_info = VersionInfo(major="2023", minor="4", micro="0") +version_info = VersionInfo(major="2023", minor="4", micro="0.post1") diff --git a/src/cpl_cli/migrations/__init__.py b/src/cpl_cli/migrations/__init__.py index f93b3ce8..57f94ee0 100644 --- a/src/cpl_cli/migrations/__init__.py +++ b/src/cpl_cli/migrations/__init__.py @@ -15,7 +15,7 @@ __title__ = "cpl_cli.migrations" __author__ = "Sven Heidemann" __license__ = "MIT" __copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" -__version__ = "2023.4.0" +__version__ = "2023.4.0.post1" from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports VersionInfo = namedtuple("VersionInfo", "major minor micro") -version_info = VersionInfo(major="2023", minor="4", micro="0") +version_info = VersionInfo(major="2023", minor="4", micro="0.post1") diff --git a/src/cpl_cli/migrations/base/__init__.py b/src/cpl_cli/migrations/base/__init__.py index 98ed351b..43a8dbd4 100644 --- a/src/cpl_cli/migrations/base/__init__.py +++ b/src/cpl_cli/migrations/base/__init__.py @@ -15,7 +15,7 @@ __title__ = "cpl_cli.migrations.base" __author__ = "Sven Heidemann" __license__ = "MIT" __copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" -__version__ = "2023.4.0" +__version__ = "2023.4.0.post1" from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple("VersionInfo", "major minor micro") -version_info = VersionInfo(major="2023", minor="4", micro="0") +version_info = VersionInfo(major="2023", minor="4", micro="0.post1") diff --git a/src/cpl_cli/migrations/service/__init__.py b/src/cpl_cli/migrations/service/__init__.py index 7c0e2c76..64bb8fae 100644 --- a/src/cpl_cli/migrations/service/__init__.py +++ b/src/cpl_cli/migrations/service/__init__.py @@ -15,7 +15,7 @@ __title__ = "cpl_cli.migrations.service" __author__ = "Sven Heidemann" __license__ = "MIT" __copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" -__version__ = "2023.4.0" +__version__ = "2023.4.0.post1" from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple("VersionInfo", "major minor micro") -version_info = VersionInfo(major="2023", minor="4", micro="0") +version_info = VersionInfo(major="2023", minor="4", micro="0.post1") diff --git a/src/cpl_cli/publish/__init__.py b/src/cpl_cli/publish/__init__.py index e27216bb..d5a15371 100644 --- a/src/cpl_cli/publish/__init__.py +++ b/src/cpl_cli/publish/__init__.py @@ -15,7 +15,7 @@ __title__ = "cpl_cli.publish" __author__ = "Sven Heidemann" __license__ = "MIT" __copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" -__version__ = "2023.4.0" +__version__ = "2023.4.0.post1" from collections import namedtuple @@ -25,4 +25,4 @@ from .publisher_abc import PublisherABC from .publisher_service import PublisherService VersionInfo = namedtuple("VersionInfo", "major minor micro") -version_info = VersionInfo(major="2023", minor="4", micro="0") +version_info = VersionInfo(major="2023", minor="4", micro="0.post1") diff --git a/src/cpl_cli/source_creator/__init__.py b/src/cpl_cli/source_creator/__init__.py index 4a700c0c..59fc89d5 100644 --- a/src/cpl_cli/source_creator/__init__.py +++ b/src/cpl_cli/source_creator/__init__.py @@ -15,7 +15,7 @@ __title__ = "cpl_cli.source_creator" __author__ = "Sven Heidemann" __license__ = "MIT" __copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" -__version__ = "2023.4.0" +__version__ = "2023.4.0.post1" from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple("VersionInfo", "major minor micro") -version_info = VersionInfo(major="2023", minor="4", micro="0") +version_info = VersionInfo(major="2023", minor="4", micro="0.post1") diff --git a/src/cpl_cli/validators/__init__.py b/src/cpl_cli/validators/__init__.py index 0d420638..ac1d3970 100644 --- a/src/cpl_cli/validators/__init__.py +++ b/src/cpl_cli/validators/__init__.py @@ -15,7 +15,7 @@ __title__ = "cpl_cli.validators" __author__ = "Sven Heidemann" __license__ = "MIT" __copyright__ = "Copyright (c) 2020 - 2023 sh-edraft.de" -__version__ = "2023.4.0" +__version__ = "2023.4.0.post1" from collections import namedtuple @@ -23,4 +23,4 @@ from collections import namedtuple # imports: VersionInfo = namedtuple("VersionInfo", "major minor micro") -version_info = VersionInfo(major="2023", minor="4", micro="0") +version_info = VersionInfo(major="2023", minor="4", micro="0.post1")