Merge pull request '#173' (#174) from #173 into master

Reviewed-on: #174
This commit is contained in:
Sven Heidemann 2023-06-12 20:48:34 +02:00
commit 08ba097aaa
18 changed files with 57 additions and 42 deletions

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -154,6 +154,24 @@ class UpdateService(CommandABC):
Console.write_line(f"\tUpdate with {Pip.get_executable()} -m pip install --upgrade <package>")
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),

View File

@ -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")

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "2023",
"Minor": "4",
"Micro": "0"
"Micro": "0.post1"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")