From c1a1849ad2969f1c2bf3236ea9d3265964f32a64 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 13:12:35 +0200 Subject: [PATCH 01/51] Added logic to create new unittest project --- cpl-workspace.json | 12 +- .../_templates/new/unittest/__init__.py | 25 +++ .../_templates/new/unittest/license.py | 23 +++ .../_templates/new/unittest/readme_py.py | 23 +++ .../new/unittest/source/__init__.py | 25 +++ .../new/unittest/source/name/__init__.py | 25 +++ .../new/unittest/source/name/application.py | 74 ++++++++ .../new/unittest/source/name/init.py | 27 +++ .../new/unittest/source/name/main.py | 63 +++++++ .../new/unittest/source/name/test_case.py | 52 ++++++ src/cpl_cli/cli.py | 2 + src/cpl_cli/command/new_service.py | 60 +++++-- .../configuration/project_type_enum.py | 1 + .../source_creator/unittest_builder.py | 164 ++++++++++++++++++ src/cpl_cli/startup_argument_extension.py | 3 +- 15 files changed, 555 insertions(+), 24 deletions(-) create mode 100644 src/cpl_cli/_templates/new/unittest/__init__.py create mode 100644 src/cpl_cli/_templates/new/unittest/license.py create mode 100644 src/cpl_cli/_templates/new/unittest/readme_py.py create mode 100644 src/cpl_cli/_templates/new/unittest/source/__init__.py create mode 100644 src/cpl_cli/_templates/new/unittest/source/name/__init__.py create mode 100644 src/cpl_cli/_templates/new/unittest/source/name/application.py create mode 100644 src/cpl_cli/_templates/new/unittest/source/name/init.py create mode 100644 src/cpl_cli/_templates/new/unittest/source/name/main.py create mode 100644 src/cpl_cli/_templates/new/unittest/source/name/test_case.py create mode 100644 src/cpl_cli/source_creator/unittest_builder.py diff --git a/cpl-workspace.json b/cpl-workspace.json index 00e7534a..edd91281 100644 --- a/cpl-workspace.json +++ b/cpl-workspace.json @@ -6,22 +6,19 @@ "cpl-cli": "src/cpl_cli/cpl-cli.json", "cpl-query": "src/cpl_query/cpl-query.json", "set-version": "tools/set_version/set-version.json", - "set-pip-urls": "tools/set_pip_urls/set-pip-urls.json" + "set-pip-urls": "tools/set_pip_urls/set-pip-urls.json", + "unittests": "src/unittests/unittests.json" }, "Scripts": { "hello-world": "echo 'Hello World'", - "sv": "cpl set-version", "set-version": "cpl run set-version $ARGS; echo '';", - "spu": "cpl set-pip-urls", "set-pip-urls": "cpl run set-pip-urls $ARGS; echo '';", - "docs-build": "echo 'Build Documentation'; cd docs/; sphinx-apidoc -o source/ ../src/cpl_core; sphinx-apidoc -o source/ ../src/cpl_query; make clean; make html; rm source/cpl_query.tests.rst;", "db": "cpl build-docs", "docs-open": "xdg-open $PWD/docs/build/html/index.html &", "do": "cpl docs-open", - "pre-build-all": "cpl sv $ARGS; cpl spu $ARGS;", "build-all": "cpl build-cli; cpl build-core; cpl build-query; cpl build-set-pip-urls; cpl build-set-version", "ba": "cpl build-all $ARGS", @@ -30,14 +27,12 @@ "build-query": "echo 'Build cpl-query'; cd ./src/cpl_query; cpl build; cd ../../;", "build-set-pip-urls": "echo 'Build set-pip-urls'; cd ./tools/set_pip_urls; cpl build; cd ../../;", "build-set-version": "echo 'Build set-version'; cd ./tools/set_version; cpl build; cd ../../;", - "pre-publish-all": "cpl sv $ARGS; cpl spu $ARGS;", "publish-all": "cpl publish-cli; cpl publish-core; cpl publish-query;", "pa": "cpl build-all $ARGS", "publish-cli": "echo 'Publish cpl-cli'; cd ./src/cpl_cli; cpl publish; cd ../../;", "publish-core": "echo 'Publish cpl-core'; cd ./src/cpl_core; cpl publish; cd ../../;", "publish-query": "echo 'Publish cpl_query'; cd ./src/cpl_query; cpl publish; cd ../../;", - "upload-prod-cli": "echo 'PROD Upload cpl-cli'; cpl upl-prod-cli;", "upl-prod-cli": "twine upload -r pip.sh-edraft.de dist/cpl-cli/publish/setup/*", "upload-prod-core": "echo 'PROD Upload cpl-core'; cpl upl-prod-core;", @@ -56,21 +51,18 @@ "upl-dev-core": "twine upload -r pip-dev.sh-edraft.de dist/cpl-core/publish/setup/*", "upload-dev-query": "echo 'DEV Upload cpl_query'; cpl upl-dev-query;", "upl-dev-query": "twine upload -r pip-dev.sh-edraft.de dist/cpl-query/publish/setup/*", - "pre-deploy-prod": "cpl sv $ARGS; cpl spu --environment=production;", "deploy-prod": "cpl deploy-prod-cli; cpl deploy-prod-core; cpl deploy-prod-query;", "dp": "cpl deploy-prod $ARGS", "deploy-prod-cli": "cpl publish-cli; cpl upload-prod-cli", "deploy-prod-core": "cpl publish-core; cpl upload-prod-core", "deploy-prod-query": "cpl publish-query; cpl upload-prod-query", - "pre-deploy-exp": "cpl sv $ARGS; cpl spu --environment=staging;", "deploy-exp": "cpl deploy-exp-cli; cpl deploy-exp-core; cpl deploy-exp-query;", "de": "cpl deploy-exp $ARGS", "deploy-exp-cli": "cpl publish-cli; cpl upload-exp-cli", "deploy-exp-core": "cpl publish-core; cpl upload-exp-core", "deploy-exp-query": "cpl publish-query; cpl upload-exp-query", - "pre-deploy-dev": "cpl sv $ARGS; cpl spu --environment=development;", "deploy-dev": "cpl deploy-dev-cli; cpl deploy-dev-core; cpl deploy-dev-query;", "dd": "cpl deploy-dev $ARGS", diff --git a/src/cpl_cli/_templates/new/unittest/__init__.py b/src/cpl_cli/_templates/new/unittest/__init__.py new file mode 100644 index 00000000..d88df923 --- /dev/null +++ b/src/cpl_cli/_templates/new/unittest/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +cpl-cli sh-edraft Common Python library CLI +~~~~~~~~~~~~~~~~~~~ + +sh-edraft Common Python library Command Line Interface + +:copyright: (c) 2020 - 2022 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'cpl_cli._templates.new.console' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' +__version__ = '2022.6.16.dev2' + +from collections import namedtuple + +# imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') diff --git a/src/cpl_cli/_templates/new/unittest/license.py b/src/cpl_cli/_templates/new/unittest/license.py new file mode 100644 index 00000000..fb586904 --- /dev/null +++ b/src/cpl_cli/_templates/new/unittest/license.py @@ -0,0 +1,23 @@ +from cpl_cli._templates.template_file_abc import TemplateFileABC + + +class LicenseTemplate(TemplateFileABC): + + def __init__(self): + TemplateFileABC.__init__(self) + + self._name = 'LICENSE' + self._path = '' + self._value = """""" + + @property + def name(self) -> str: + return self._name + + @property + def path(self) -> str: + return self._path + + @property + def value(self) -> str: + return self._value diff --git a/src/cpl_cli/_templates/new/unittest/readme_py.py b/src/cpl_cli/_templates/new/unittest/readme_py.py new file mode 100644 index 00000000..a40286a8 --- /dev/null +++ b/src/cpl_cli/_templates/new/unittest/readme_py.py @@ -0,0 +1,23 @@ +from cpl_cli._templates.template_file_abc import TemplateFileABC + + +class ReadmeTemplate(TemplateFileABC): + + def __init__(self): + TemplateFileABC.__init__(self) + + self._name = 'README.md' + self._path = '' + self._value = """""" + + @property + def name(self) -> str: + return self._name + + @property + def path(self) -> str: + return self._path + + @property + def value(self) -> str: + return self._value diff --git a/src/cpl_cli/_templates/new/unittest/source/__init__.py b/src/cpl_cli/_templates/new/unittest/source/__init__.py new file mode 100644 index 00000000..7d9d4f31 --- /dev/null +++ b/src/cpl_cli/_templates/new/unittest/source/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +cpl-cli sh-edraft Common Python library CLI +~~~~~~~~~~~~~~~~~~~ + +sh-edraft Common Python library Command Line Interface + +:copyright: (c) 2020 - 2022 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'cpl_cli._templates.new.console.source' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' +__version__ = '2022.6.16.dev2' + +from collections import namedtuple + +# imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') diff --git a/src/cpl_cli/_templates/new/unittest/source/name/__init__.py b/src/cpl_cli/_templates/new/unittest/source/name/__init__.py new file mode 100644 index 00000000..bcf07bec --- /dev/null +++ b/src/cpl_cli/_templates/new/unittest/source/name/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +cpl-cli sh-edraft Common Python library CLI +~~~~~~~~~~~~~~~~~~~ + +sh-edraft Common Python library Command Line Interface + +:copyright: (c) 2020 - 2022 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'cpl_cli._templates.new.console.source.name' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' +__version__ = '2022.6.16.dev2' + +from collections import namedtuple + +# imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') diff --git a/src/cpl_cli/_templates/new/unittest/source/name/application.py b/src/cpl_cli/_templates/new/unittest/source/name/application.py new file mode 100644 index 00000000..6c40e867 --- /dev/null +++ b/src/cpl_cli/_templates/new/unittest/source/name/application.py @@ -0,0 +1,74 @@ +import textwrap + +from cpl_cli._templates.template_file_abc import TemplateFileABC + + +class ApplicationTemplate(TemplateFileABC): + + def __init__(self, name: str, path: str, use_async: bool): + TemplateFileABC.__init__(self) + + self._name = 'application.py' + self._path = path + self._use_async = use_async + + if self._use_async: + self._value = textwrap.dedent("""\ + import unittest + from unittest import TestSuite + + from cpl_core.application import ApplicationABC + from cpl_core.configuration import ConfigurationABC + from cpl_core.dependency_injection import ServiceProviderABC + from unittests.test_case import TestCase + + + class Application(ApplicationABC): + + def __init__(self, config: ConfigurationABC, services: ServiceProviderABC): + ApplicationABC.__init__(self, config, services) + self._suite: TestSuite = unittest.TestSuite() + + async def configure(self): + self._suite.addTest(TestCase('test_equal')) + + async def main(self): + runner = unittest.TextTestRunner() + runner.run(self._suite) + """) + else: + self._value = textwrap.dedent("""\ + import unittest + from unittest import TestSuite + + from cpl_core.application import ApplicationABC + from cpl_core.configuration import ConfigurationABC + from cpl_core.dependency_injection import ServiceProviderABC + from unittests.test_case import TestCase + + + class Application(ApplicationABC): + + def __init__(self, config: ConfigurationABC, services: ServiceProviderABC): + ApplicationABC.__init__(self, config, services) + self._suite: TestSuite = unittest.TestSuite() + + def configure(self): + self._suite.addTest(TestCase('test_equal')) + + def main(self): + runner = unittest.TextTestRunner() + runner.run(self._suite) + """) + + @property + def name(self) -> str: + return self._name + + @property + def path(self) -> str: + return self._path + + @property + def value(self) -> str: + return self._value diff --git a/src/cpl_cli/_templates/new/unittest/source/name/init.py b/src/cpl_cli/_templates/new/unittest/source/name/init.py new file mode 100644 index 00000000..b3cbdecb --- /dev/null +++ b/src/cpl_cli/_templates/new/unittest/source/name/init.py @@ -0,0 +1,27 @@ +import textwrap + +from cpl_cli._templates.template_file_abc import TemplateFileABC + + +class MainInitTemplate(TemplateFileABC): + + def __init__(self, name: str, path: str): + TemplateFileABC.__init__(self) + + self._name = '__init__.py' + self._path = path + self._value = textwrap.dedent("""\ + # imports: + """) + + @property + def name(self) -> str: + return self._name + + @property + def path(self) -> str: + return self._path + + @property + def value(self) -> str: + return self._value diff --git a/src/cpl_cli/_templates/new/unittest/source/name/main.py b/src/cpl_cli/_templates/new/unittest/source/name/main.py new file mode 100644 index 00000000..81f0a251 --- /dev/null +++ b/src/cpl_cli/_templates/new/unittest/source/name/main.py @@ -0,0 +1,63 @@ +import textwrap + +from cpl_core.utils.string import String +from cpl_cli._templates.template_file_abc import TemplateFileABC + + +class MainWithApplicationBaseTemplate(TemplateFileABC): + + def __init__(self, name: str, path: str, use_async: bool): + TemplateFileABC.__init__(self) + + name = String.convert_to_snake_case(name) + self._name = 'main.py' + self._path = path + + import_pkg = f'{name}.' + + if use_async: + self._value = textwrap.dedent(f"""\ + import asyncio + + from cpl_core.application import ApplicationBuilder + + from {import_pkg}application import Application + + + async def main(): + app_builder = ApplicationBuilder(Application) + app: Application = await app_builder.build_async() + await app.run_async() + + + if __name__ == '__main__': + ml = asyncio.get_event_loop() + ml.run_until_complete(main()) + """) + else: + self._value = textwrap.dedent(f"""\ + from cpl_core.application import ApplicationBuilder + + from {import_pkg}application import Application + + + def main(): + app_builder = ApplicationBuilder(Application) + app_builder.build().run() + + + if __name__ == '__main__': + main() + """) + + @property + def name(self) -> str: + return self._name + + @property + def path(self) -> str: + return self._path + + @property + def value(self) -> str: + return self._value diff --git a/src/cpl_cli/_templates/new/unittest/source/name/test_case.py b/src/cpl_cli/_templates/new/unittest/source/name/test_case.py new file mode 100644 index 00000000..096518bd --- /dev/null +++ b/src/cpl_cli/_templates/new/unittest/source/name/test_case.py @@ -0,0 +1,52 @@ +import textwrap + +from cpl_cli._templates.template_file_abc import TemplateFileABC + + +class TestCaseTemplate(TemplateFileABC): + + def __init__(self, name: str, path: str, use_async: bool): + TemplateFileABC.__init__(self) + + self._name = 'test_case.py' + self._path = path + self._use_async = use_async + + if self._use_async: + self._value = textwrap.dedent("""\ + import unittest + + + class TestCase(unittest.TestCase): + + async def setUp(self) -> None: + pass + + async def test_equal(self): + self.assertEqual(True, True) + """) + else: + self._value = textwrap.dedent("""\ + import unittest + + + class TestCase(unittest.TestCase): + + def setUp(self) -> None: + pass + + def test_equal(self): + self.assertEqual(True, True) + """) + + @property + def name(self) -> str: + return self._name + + @property + def path(self) -> str: + return self._path + + @property + def value(self) -> str: + return self._value diff --git a/src/cpl_cli/cli.py b/src/cpl_cli/cli.py index 499a5939..d70a777a 100644 --- a/src/cpl_cli/cli.py +++ b/src/cpl_cli/cli.py @@ -29,6 +29,7 @@ class CLI(ApplicationABC): try: result = self._configuration.parse_console_arguments(self._services) if result: + Console.write_line() return if len(self._configuration.additional_arguments) == 0: @@ -37,6 +38,7 @@ class CLI(ApplicationABC): unexpected_arguments = ', '.join(self._configuration.additional_arguments) Error.error(f'Unexpected argument(s): {unexpected_arguments}') + Console.write_line() except KeyboardInterrupt: Console.write_line() sys.exit() diff --git a/src/cpl_cli/command/new_service.py b/src/cpl_cli/command/new_service.py index 916abec3..0f6ccac5 100644 --- a/src/cpl_cli/command/new_service.py +++ b/src/cpl_cli/command/new_service.py @@ -6,6 +6,7 @@ from typing import Optional from packaging import version import cpl_core +from cpl_cli.source_creator.unittest_builder import UnittestBuilder from cpl_core.configuration.configuration_abc import ConfigurationABC from cpl_core.console.foreground_color_enum import ForegroundColorEnum @@ -163,22 +164,23 @@ class NewService(CommandABC): return project_path - def _get_project_information(self): + def _get_project_information(self, is_unittest=False): """ Gets project information's from user :return: """ - result = Console.read('Do you want to use application base? (y/n) ') - if result.lower() == 'y': - self._use_application_api = True + if not is_unittest: + result = Console.read('Do you want to use application base? (y/n) ') + if result.lower() == 'y': + self._use_application_api = True - result = Console.read('Do you want to use startup? (y/n) ') - if result.lower() == 'y': - self._use_startup = True - else: - result = Console.read('Do you want to use service providing? (y/n) ') - if result.lower() == 'y': - self._use_service_providing = True + result = Console.read('Do you want to use startup? (y/n) ') + if result.lower() == 'y': + self._use_startup = True + else: + result = Console.read('Do you want to use service providing? (y/n) ') + if result.lower() == 'y': + self._use_service_providing = True result = Console.read('Do you want to use async? (y/n) ') if result.lower() == 'y': @@ -214,6 +216,32 @@ class NewService(CommandABC): except Exception as e: Console.error('Could not create project', str(e)) + def _unittest(self, args: list[str]): + """ + Generates new unittest project + :param args: + :return: + """ + self._create_project_settings(self._name) + self._create_build_settings() + self._create_project_json() + path = self._get_project_path() + if path is None: + return + + self._get_project_information(is_unittest=True) + try: + UnittestBuilder.build( + path, + self._use_application_api, + self._use_async, + self._project.name, + self._project_json, + self._workspace + ) + except Exception as e: + Console.error('Could not create project', str(e)) + def _library(self, args: list[str]): """ Generates new library project @@ -250,16 +278,22 @@ class NewService(CommandABC): """ console = self._config.get_configuration(ProjectTypeEnum.console.value) library = self._config.get_configuration(ProjectTypeEnum.library.value) - if console is not None and library is None: + unittest = self._config.get_configuration(ProjectTypeEnum.unittest.value) + if console is not None and library is None and unittest is None: self._name = console self._schematic = ProjectTypeEnum.console.value self._console(args) - elif console is None and library is not None: + elif console is None and library is not None and unittest is None: self._name = library self._schematic = ProjectTypeEnum.library.value self._library(args) + elif console is None and library is None and unittest is not None: + self._name = unittest + self._schematic = ProjectTypeEnum.unittest.value + self._unittest(args) + else: self._help('Usage: cpl new [options]') return diff --git a/src/cpl_cli/configuration/project_type_enum.py b/src/cpl_cli/configuration/project_type_enum.py index 9471c59c..235e59c2 100644 --- a/src/cpl_cli/configuration/project_type_enum.py +++ b/src/cpl_cli/configuration/project_type_enum.py @@ -5,3 +5,4 @@ class ProjectTypeEnum(Enum): console = 'console' library = 'library' + unittest = 'unittest' diff --git a/src/cpl_cli/source_creator/unittest_builder.py b/src/cpl_cli/source_creator/unittest_builder.py new file mode 100644 index 00000000..805c6363 --- /dev/null +++ b/src/cpl_cli/source_creator/unittest_builder.py @@ -0,0 +1,164 @@ +import json +import os +from typing import Optional + +from cpl_cli._templates.new.unittest.license import LicenseTemplate +from cpl_cli._templates.new.unittest.readme_py import ReadmeTemplate +from cpl_cli._templates.new.unittest.source.name.application import ApplicationTemplate +from cpl_cli._templates.new.unittest.source.name.init import MainInitTemplate +from cpl_cli._templates.new.unittest.source.name.main import MainWithApplicationBaseTemplate +from cpl_cli._templates.new.unittest.source.name.test_case import TestCaseTemplate +from cpl_cli._templates.template_file_abc import TemplateFileABC +from cpl_cli.configuration.workspace_settings import WorkspaceSettings +from cpl_cli.configuration.workspace_settings_name_enum import WorkspaceSettingsNameEnum +from cpl_cli.source_creator.template_builder import TemplateBuilder +from cpl_core.console.console import Console +from cpl_core.console.foreground_color_enum import ForegroundColorEnum +from cpl_core.utils.string import String + + +class UnittestBuilder: + + def __init__(self): + pass + + @staticmethod + def _create_file(file_name: str, content: dict): + if not os.path.isabs(file_name): + file_name = os.path.abspath(file_name) + + path = os.path.dirname(file_name) + if not os.path.isdir(path): + os.makedirs(path) + + with open(file_name, 'w') as project_json: + project_json.write(json.dumps(content, indent=2)) + project_json.close() + + @classmethod + def _create_workspace(cls, path: str, project_name, projects: dict, scripts: dict): + ws_dict = { + WorkspaceSettings.__name__: { + WorkspaceSettingsNameEnum.default_project.value: project_name, + WorkspaceSettingsNameEnum.projects.value: projects, + WorkspaceSettingsNameEnum.scripts.value: scripts + } + } + + Console.spinner( + f'Creating {path}', + cls._create_file, + path, + ws_dict, + text_foreground_color=ForegroundColorEnum.green, + spinner_foreground_color=ForegroundColorEnum.cyan + ) + + @classmethod + def build(cls, project_path: str, use_application_api: bool, + use_async: bool, project_name: str, project_settings: dict, workspace: Optional[WorkspaceSettings]): + """ + Builds the console project files + :param project_path: + :param use_application_api: + :param use_async: + :param project_name: + :param project_settings: + :param workspace: + :return: + """ + pj_name = project_name + if '/' in pj_name: + pj_name = pj_name.split('/')[len(pj_name.split('/')) - 1] + + project_name_snake = String.convert_to_snake_case(pj_name) + + if workspace is None: + templates: list[TemplateFileABC] = [ + LicenseTemplate(), + ReadmeTemplate(), + MainInitTemplate(project_name, os.path.join('src/', project_name_snake)) + ] + else: + project_path = os.path.join( + os.path.dirname(project_path), + project_name_snake + ) + + templates: list[TemplateFileABC] = [ + MainInitTemplate('', '') + ] + + if not os.path.isdir(project_path): + os.makedirs(project_path) + + py_src_rel_path = '' + src_name = project_name_snake + if workspace is None: + py_src_rel_path = f'src/{src_name}' + + templates.append(ApplicationTemplate(src_name, py_src_rel_path, use_async)) + templates.append(MainWithApplicationBaseTemplate(src_name, py_src_rel_path, use_async)) + templates.append(TestCaseTemplate(src_name, py_src_rel_path, use_async)) + + src_rel_path = '' + if '/' in project_name: + old_pj_name = project_name + parts = project_name.split('/') + project_name = parts[len(parts) - 1] + src_rel_path = old_pj_name.split(project_name)[0] + + proj_name = project_name + if src_rel_path.endswith('/'): + src_rel_path = src_rel_path[:len(src_rel_path) - 1] + + if src_rel_path != '': + proj_name = f'{src_rel_path}/{project_name}' + if workspace is not None: + proj_name = project_name_snake + + if src_rel_path != '': + project_file_path = f'{src_rel_path}/{project_name_snake}/{project_name}.json' + else: + project_file_path = f'{project_name_snake}/{project_name}.json' + + if workspace is None: + src_path = f'src/{project_name_snake}' + workspace_file_path = f'{proj_name}/cpl-workspace.json' + project_file_rel_path = f'{src_path}/{project_name}.json' + project_file_path = f'{proj_name}/{src_path}/{project_name}.json' + cls._create_workspace( + workspace_file_path, + project_name, + { + project_name: project_file_rel_path + }, + {} + ) + + else: + workspace.projects[project_name] = f'src/{project_file_path}' + cls._create_workspace('cpl-workspace.json', workspace.default_project, workspace.projects, workspace.scripts) + + Console.spinner( + f'Creating {project_file_path}', + cls._create_file, + project_file_path if workspace is None else f'src/{project_file_path}', + project_settings, + text_foreground_color=ForegroundColorEnum.green, + spinner_foreground_color=ForegroundColorEnum.cyan + ) + + for template in templates: + divider = '' + if template.path != '' and not template.path.endswith('/'): + divider = '/' + + Console.spinner( + f'Creating {proj_name}/{template.path}{divider}{template.name}', + TemplateBuilder.build, + project_path, + template, + text_foreground_color=ForegroundColorEnum.green, + spinner_foreground_color=ForegroundColorEnum.cyan + ) diff --git a/src/cpl_cli/startup_argument_extension.py b/src/cpl_cli/startup_argument_extension.py index eaa1d899..ae6ef0a3 100644 --- a/src/cpl_cli/startup_argument_extension.py +++ b/src/cpl_cli/startup_argument_extension.py @@ -84,7 +84,8 @@ class StartupArgumentExtension(StartupExtensionABC): .add_console_argument(ArgumentTypeEnum.Flag, '--', 'simulate', ['s', 'S']) config.create_console_argument(ArgumentTypeEnum.Executable, '', 'new', ['n', 'N'], NewService, True) \ .add_console_argument(ArgumentTypeEnum.Variable, '', 'console', ['c', 'C'], ' ') \ - .add_console_argument(ArgumentTypeEnum.Variable, '', 'library', ['l', 'L'], ' ') + .add_console_argument(ArgumentTypeEnum.Variable, '', 'library', ['l', 'L'], ' ') \ + .add_console_argument(ArgumentTypeEnum.Variable, '', 'unittest', ['ut', 'UT'], ' ') config.create_console_argument(ArgumentTypeEnum.Executable, '', 'publish', ['p', 'P'], PublishService, True, validators=[ProjectValidator]) config.create_console_argument(ArgumentTypeEnum.Executable, '', 'remove', ['r', 'R'], RemoveService, True, validators=[WorkspaceValidator]) \ .add_console_argument(ArgumentTypeEnum.Flag, '--', 'simulate', ['s', 'S']) From d0e66d24bd0d3debaad942366dd61921066df746 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 13:17:58 +0200 Subject: [PATCH 02/51] Added logic to generate test cases --- .../_templates/generate/test_case_template.py | 41 +++++++++++++++++++ src/cpl_cli/command/generate_service.py | 23 +++++++---- src/cpl_cli/startup_argument_extension.py | 1 + 3 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 src/cpl_cli/_templates/generate/test_case_template.py diff --git a/src/cpl_cli/_templates/generate/test_case_template.py b/src/cpl_cli/_templates/generate/test_case_template.py new file mode 100644 index 00000000..7fa9a4a7 --- /dev/null +++ b/src/cpl_cli/_templates/generate/test_case_template.py @@ -0,0 +1,41 @@ +import textwrap +from string import Template + +from cpl_core.utils.string import String +from cpl_cli._templates.template_file_abc import TemplateFileABC + + +class TestCaseTemplate(TemplateFileABC): + + def __init__(self, name: str, schematic: str, schematic_upper: str, path: str): + TemplateFileABC.__init__(self) + + self._name = f'{String.convert_to_snake_case(name)}_{schematic}.py' + self._class_name = f'{String.first_to_upper(name)}{schematic_upper}' + self._path = path + self._value = textwrap.dedent("""\ + import unittest + + + class $Name(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass + """) + + @property + def name(self) -> str: + return self._name + + @property + def path(self) -> str: + return self._path + + @property + def value(self) -> str: + return Template(self._value).substitute( + Name=self._class_name + ) diff --git a/src/cpl_cli/command/generate_service.py b/src/cpl_cli/command/generate_service.py index 6c9861a8..4fb25a04 100644 --- a/src/cpl_cli/command/generate_service.py +++ b/src/cpl_cli/command/generate_service.py @@ -2,21 +2,22 @@ import os import sys import textwrap -from cpl_cli._templates.generate.pipe_template import PipeTemplate -from cpl_cli._templates.generate.validator_template import ValidatorTemplate -from cpl_core.configuration.configuration_abc import ConfigurationABC -from cpl_core.console.foreground_color_enum import ForegroundColorEnum -from cpl_core.console.console import Console -from cpl_core.utils.string import String -from cpl_cli.command_abc import CommandABC -from cpl_cli._templates.generate.init_template import InitTemplate from cpl_cli._templates.generate.abc_template import ABCTemplate from cpl_cli._templates.generate.class_template import ClassTemplate from cpl_cli._templates.generate.configmodel_template import ConfigModelTemplate from cpl_cli._templates.generate.enum_template import EnumTemplate +from cpl_cli._templates.generate.init_template import InitTemplate +from cpl_cli._templates.generate.pipe_template import PipeTemplate from cpl_cli._templates.generate.service_template import ServiceTemplate +from cpl_cli._templates.generate.test_case_template import TestCaseTemplate from cpl_cli._templates.generate.thread_template import ThreadTemplate +from cpl_cli._templates.generate.validator_template import ValidatorTemplate from cpl_cli._templates.template_file_abc import TemplateFileABC +from cpl_cli.command_abc import CommandABC +from cpl_core.configuration.configuration_abc import ConfigurationABC +from cpl_core.console.console import Console +from cpl_core.console.foreground_color_enum import ForegroundColorEnum +from cpl_core.utils.string import String class GenerateService(CommandABC): @@ -53,6 +54,10 @@ class GenerateService(CommandABC): "Upper": "Settings", "Template": ConfigModelTemplate }, + "test_case": { + "Upper": "TestCase", + "Template": TestCaseTemplate + }, "thread": { "Upper": "Thread", "Template": ThreadTemplate @@ -83,6 +88,7 @@ class GenerateService(CommandABC): pipe service settings + test_case thread validator """) @@ -103,6 +109,7 @@ class GenerateService(CommandABC): 'pipe (p|P)', 'service (s|S)', 'settings (st|ST)', + 'test-case (tc|TC)', 'thread (t|T)', 'validator (v|V)' ] diff --git a/src/cpl_cli/startup_argument_extension.py b/src/cpl_cli/startup_argument_extension.py index ae6ef0a3..92287027 100644 --- a/src/cpl_cli/startup_argument_extension.py +++ b/src/cpl_cli/startup_argument_extension.py @@ -77,6 +77,7 @@ class StartupArgumentExtension(StartupExtensionABC): .add_console_argument(ArgumentTypeEnum.Variable, '', 'pipe', ['p', 'P'], ' ') \ .add_console_argument(ArgumentTypeEnum.Variable, '', 'service', ['s', 'S'], ' ') \ .add_console_argument(ArgumentTypeEnum.Variable, '', 'settings', ['st', 'ST'], ' ') \ + .add_console_argument(ArgumentTypeEnum.Variable, '', 'test_case', ['tc', 'TC'], ' ') \ .add_console_argument(ArgumentTypeEnum.Variable, '', 'thread', ['t', 'T'], ' ') \ .add_console_argument(ArgumentTypeEnum.Variable, '', 'validator', ['v', 'V'], ' ') config.create_console_argument(ArgumentTypeEnum.Executable, '', 'install', ['i', 'I'], InstallService, True, validators=[ProjectValidator]) \ From c2706c7737cfe753d1ddd8bde522c2e778a6cfb2 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 13:37:15 +0200 Subject: [PATCH 03/51] Added unittest projects --- cpl-workspace.json | 6 ++- 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/generate/__init__.py | 4 +- src/cpl_cli/_templates/new/__init__.py | 4 +- .../_templates/new/console/__init__.py | 4 +- .../_templates/new/console/source/__init__.py | 4 +- .../new/console/source/name/__init__.py | 4 +- .../new/console/source/tests/__init__.py | 4 +- .../_templates/new/library/__init__.py | 4 +- .../_templates/new/library/source/__init__.py | 4 +- .../new/library/source/name/__init__.py | 4 +- .../new/library/source/tests/__init__.py | 4 +- .../_templates/new/unittest/__init__.py | 6 +-- .../new/unittest/source/__init__.py | 6 +-- .../new/unittest/source/name/__init__.py | 6 +-- src/cpl_cli/_templates/publish/__init__.py | 4 +- src/cpl_cli/command/__init__.py | 4 +- src/cpl_cli/configuration/__init__.py | 4 +- src/cpl_cli/cpl-cli.json | 4 +- src/cpl_cli/live_server/__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 +- src/cpl_core/__init__.py | 4 +- src/cpl_core/application/__init__.py | 4 +- src/cpl_core/configuration/__init__.py | 4 +- src/cpl_core/console/__init__.py | 4 +- src/cpl_core/cpl-core.json | 2 +- src/cpl_core/database/__init__.py | 4 +- src/cpl_core/database/connection/__init__.py | 4 +- src/cpl_core/database/context/__init__.py | 4 +- src/cpl_core/dependency_injection/__init__.py | 4 +- src/cpl_core/environment/__init__.py | 4 +- src/cpl_core/logging/__init__.py | 4 +- src/cpl_core/mailing/__init__.py | 4 +- src/cpl_core/pipes/__init__.py | 4 +- src/cpl_core/time/__init__.py | 4 +- src/cpl_core/utils/__init__.py | 4 +- src/cpl_query/__init__.py | 4 +- src/cpl_query/_query/__init__.py | 4 +- src/cpl_query/cpl-query.json | 4 +- src/cpl_query/extension/__init__.py | 4 +- src/tests/unittests/__init__.py | 1 + src/tests/unittests/application.py | 21 +++++++++ src/tests/unittests/main.py | 11 +++++ src/tests/unittests/test_case.py | 10 +++++ src/tests/unittests/unittests.json | 43 +++++++++++++++++++ src/tests/unittests_cli/__init__.py | 1 + src/tests/unittests_cli/unittests_cli.json | 43 +++++++++++++++++++ src/tests/unittests_core/__init__.py | 1 + src/tests/unittests_core/unittests_core.json | 43 +++++++++++++++++++ src/tests/unittests_query/__init__.py | 1 + .../unittests_query/unittests_query.json | 43 +++++++++++++++++++ src/tests/unittests_shared/__init__.py | 1 + .../unittests_shared/unittests_shared.json | 43 +++++++++++++++++++ tools/set_pip_urls/set-pip-urls.json | 2 +- tools/set_version/set-version.json | 2 +- 59 files changed, 357 insertions(+), 91 deletions(-) create mode 100644 src/tests/unittests/__init__.py create mode 100644 src/tests/unittests/application.py create mode 100644 src/tests/unittests/main.py create mode 100644 src/tests/unittests/test_case.py create mode 100644 src/tests/unittests/unittests.json create mode 100644 src/tests/unittests_cli/__init__.py create mode 100644 src/tests/unittests_cli/unittests_cli.json create mode 100644 src/tests/unittests_core/__init__.py create mode 100644 src/tests/unittests_core/unittests_core.json create mode 100644 src/tests/unittests_query/__init__.py create mode 100644 src/tests/unittests_query/unittests_query.json create mode 100644 src/tests/unittests_shared/__init__.py create mode 100644 src/tests/unittests_shared/unittests_shared.json diff --git a/cpl-workspace.json b/cpl-workspace.json index edd91281..3413e861 100644 --- a/cpl-workspace.json +++ b/cpl-workspace.json @@ -7,7 +7,11 @@ "cpl-query": "src/cpl_query/cpl-query.json", "set-version": "tools/set_version/set-version.json", "set-pip-urls": "tools/set_pip_urls/set-pip-urls.json", - "unittests": "src/unittests/unittests.json" + "unittests": "src/tests/unittests/unittests.json", + "unittests_cli": "src/tests/unittests_cli/unittests_cli.json", + "unittests_core": "src/tests/unittests_core/unittests_core.json", + "unittests_query": "src/tests/unittests_query/unittests_query.json", + "unittests_shared": "src/tests/unittests_shared/unittests_shared.json" }, "Scripts": { "hello-world": "echo 'Hello World'", diff --git a/src/cpl_cli/__init__.py b/src/cpl_cli/__init__.py index 05e52eb0..b5854530 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 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple @@ -27,4 +27,4 @@ from .main import main from .startup import Startup VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/_templates/__init__.py b/src/cpl_cli/_templates/__init__.py index 2f05b3a2..d0e69d94 100644 --- a/src/cpl_cli/_templates/__init__.py +++ b/src/cpl_cli/_templates/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/_templates/build/__init__.py b/src/cpl_cli/_templates/build/__init__.py index 4d15c7c4..eb709e22 100644 --- a/src/cpl_cli/_templates/build/__init__.py +++ b/src/cpl_cli/_templates/build/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.build' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/_templates/generate/__init__.py b/src/cpl_cli/_templates/generate/__init__.py index f623a461..d59b88a9 100644 --- a/src/cpl_cli/_templates/generate/__init__.py +++ b/src/cpl_cli/_templates/generate/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.generate' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/_templates/new/__init__.py b/src/cpl_cli/_templates/new/__init__.py index 87792c02..0afadb75 100644 --- a/src/cpl_cli/_templates/new/__init__.py +++ b/src/cpl_cli/_templates/new/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/_templates/new/console/__init__.py b/src/cpl_cli/_templates/new/console/__init__.py index d88df923..7c9cd418 100644 --- a/src/cpl_cli/_templates/new/console/__init__.py +++ b/src/cpl_cli/_templates/new/console/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/_templates/new/console/source/__init__.py b/src/cpl_cli/_templates/new/console/source/__init__.py index 7d9d4f31..2a2a0da7 100644 --- a/src/cpl_cli/_templates/new/console/source/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/_templates/new/console/source/name/__init__.py b/src/cpl_cli/_templates/new/console/source/name/__init__.py index bcf07bec..167b3efa 100644 --- a/src/cpl_cli/_templates/new/console/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/_templates/new/console/source/tests/__init__.py b/src/cpl_cli/_templates/new/console/source/tests/__init__.py index e6f97f7d..401c97da 100644 --- a/src/cpl_cli/_templates/new/console/source/tests/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/tests/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/_templates/new/library/__init__.py b/src/cpl_cli/_templates/new/library/__init__.py index 983bda70..6a6e2590 100644 --- a/src/cpl_cli/_templates/new/library/__init__.py +++ b/src/cpl_cli/_templates/new/library/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/_templates/new/library/source/__init__.py b/src/cpl_cli/_templates/new/library/source/__init__.py index 05c73fef..f2e65272 100644 --- a/src/cpl_cli/_templates/new/library/source/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/_templates/new/library/source/name/__init__.py b/src/cpl_cli/_templates/new/library/source/name/__init__.py index cff20c14..879dd8a9 100644 --- a/src/cpl_cli/_templates/new/library/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/_templates/new/library/source/tests/__init__.py b/src/cpl_cli/_templates/new/library/source/tests/__init__.py index b5b21f5f..2797b086 100644 --- a/src/cpl_cli/_templates/new/library/source/tests/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/tests/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/_templates/new/unittest/__init__.py b/src/cpl_cli/_templates/new/unittest/__init__.py index d88df923..5bea2565 100644 --- a/src/cpl_cli/_templates/new/unittest/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/__init__.py @@ -11,15 +11,15 @@ sh-edraft Common Python library Command Line Interface """ -__title__ = 'cpl_cli._templates.new.console' +__title__ = 'cpl_cli._templates.new.unittest' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/_templates/new/unittest/source/__init__.py b/src/cpl_cli/_templates/new/unittest/source/__init__.py index 7d9d4f31..5e46b11a 100644 --- a/src/cpl_cli/_templates/new/unittest/source/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/source/__init__.py @@ -11,15 +11,15 @@ sh-edraft Common Python library Command Line Interface """ -__title__ = 'cpl_cli._templates.new.console.source' +__title__ = 'cpl_cli._templates.new.unittest.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/_templates/new/unittest/source/name/__init__.py b/src/cpl_cli/_templates/new/unittest/source/name/__init__.py index bcf07bec..d180c55d 100644 --- a/src/cpl_cli/_templates/new/unittest/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/source/name/__init__.py @@ -11,15 +11,15 @@ sh-edraft Common Python library Command Line Interface """ -__title__ = 'cpl_cli._templates.new.console.source.name' +__title__ = 'cpl_cli._templates.new.unittest.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/_templates/publish/__init__.py b/src/cpl_cli/_templates/publish/__init__.py index 2b81167c..48d067e4 100644 --- a/src/cpl_cli/_templates/publish/__init__.py +++ b/src/cpl_cli/_templates/publish/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.publish' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/command/__init__.py b/src/cpl_cli/command/__init__.py index 57edb0da..5306254f 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 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' 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='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/configuration/__init__.py b/src/cpl_cli/configuration/__init__.py index 1661d5d3..fe0d188b 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 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple @@ -30,4 +30,4 @@ from .workspace_settings import WorkspaceSettings from .workspace_settings_name_enum import WorkspaceSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/cpl-cli.json b/src/cpl_cli/cpl-cli.json index c82b9c2d..fc6feec3 100644 --- a/src/cpl_cli/cpl-cli.json +++ b/src/cpl_cli/cpl-cli.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "16.dev2" + "Micro": "17.dev1" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.16.dev2" + "cpl-core>=2022.6.17.dev1" ], "PythonVersion": ">=3.10", "PythonPath": {}, diff --git a/src/cpl_cli/live_server/__init__.py b/src/cpl_cli/live_server/__init__.py index 15e8c430..873f47da 100644 --- a/src/cpl_cli/live_server/__init__.py +++ b/src/cpl_cli/live_server/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.live_server' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/publish/__init__.py b/src/cpl_cli/publish/__init__.py index 5e21f69d..79d59622 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 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple @@ -24,4 +24,4 @@ from .publisher_abc import PublisherABC from .publisher_service import PublisherService VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/source_creator/__init__.py b/src/cpl_cli/source_creator/__init__.py index c4195351..ab94ef52 100644 --- a/src/cpl_cli/source_creator/__init__.py +++ b/src/cpl_cli/source_creator/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.source_creator' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_cli/validators/__init__.py b/src/cpl_cli/validators/__init__.py index 8d8bd93f..a6c766fd 100644 --- a/src/cpl_cli/validators/__init__.py +++ b/src/cpl_cli/validators/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.validators' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_core/__init__.py b/src/cpl_core/__init__.py index 808bef50..2ce9ccd9 100644 --- a/src/cpl_core/__init__.py +++ b/src/cpl_core/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_core' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_core/application/__init__.py b/src/cpl_core/application/__init__.py index 068828c5..420de028 100644 --- a/src/cpl_core/application/__init__.py +++ b/src/cpl_core/application/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.application' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple @@ -28,4 +28,4 @@ from .startup_abc import StartupABC from .startup_extension_abc import StartupExtensionABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_core/configuration/__init__.py b/src/cpl_core/configuration/__init__.py index 6942e603..ff10e540 100644 --- a/src/cpl_core/configuration/__init__.py +++ b/src/cpl_core/configuration/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.configuration' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple @@ -34,4 +34,4 @@ from .validator_abc import ValidatorABC from .variable_argument import VariableArgument VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_core/console/__init__.py b/src/cpl_core/console/__init__.py index 563b63f7..2e7ef059 100644 --- a/src/cpl_core/console/__init__.py +++ b/src/cpl_core/console/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.console' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple @@ -27,4 +27,4 @@ from .foreground_color_enum import ForegroundColorEnum from .spinner_thread import SpinnerThread VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_core/cpl-core.json b/src/cpl_core/cpl-core.json index 572e5760..506659fd 100644 --- a/src/cpl_core/cpl-core.json +++ b/src/cpl_core/cpl-core.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "16.dev2" + "Micro": "17.dev1" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", diff --git a/src/cpl_core/database/__init__.py b/src/cpl_core/database/__init__.py index 0a98c239..d757b8c8 100644 --- a/src/cpl_core/database/__init__.py +++ b/src/cpl_core/database/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple @@ -25,4 +25,4 @@ from .database_settings import DatabaseSettings from .table_abc import TableABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_core/database/connection/__init__.py b/src/cpl_core/database/connection/__init__.py index fdce501a..27688ef0 100644 --- a/src/cpl_core/database/connection/__init__.py +++ b/src/cpl_core/database/connection/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database.connection' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple @@ -24,4 +24,4 @@ from .database_connection import DatabaseConnection from .database_connection_abc import DatabaseConnectionABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_core/database/context/__init__.py b/src/cpl_core/database/context/__init__.py index 1be8611e..f03c170d 100644 --- a/src/cpl_core/database/context/__init__.py +++ b/src/cpl_core/database/context/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database.context' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple @@ -24,4 +24,4 @@ from .database_context import DatabaseContext from .database_context_abc import DatabaseContextABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_core/dependency_injection/__init__.py b/src/cpl_core/dependency_injection/__init__.py index 4685b513..cce15295 100644 --- a/src/cpl_core/dependency_injection/__init__.py +++ b/src/cpl_core/dependency_injection/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.dependency_injection' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple @@ -30,4 +30,4 @@ from .service_provider import ServiceProvider from .service_provider_abc import ServiceProviderABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_core/environment/__init__.py b/src/cpl_core/environment/__init__.py index 327a383e..d25e7291 100644 --- a/src/cpl_core/environment/__init__.py +++ b/src/cpl_core/environment/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.environment' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple @@ -25,4 +25,4 @@ from .environment_name_enum import EnvironmentNameEnum from .application_environment import ApplicationEnvironment VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_core/logging/__init__.py b/src/cpl_core/logging/__init__.py index e25ff2ce..76ca8eb1 100644 --- a/src/cpl_core/logging/__init__.py +++ b/src/cpl_core/logging/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.logging' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple @@ -27,4 +27,4 @@ from .logging_settings import LoggingSettings from .logging_settings_name_enum import LoggingSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_core/mailing/__init__.py b/src/cpl_core/mailing/__init__.py index 36170fa8..b9c9c0a3 100644 --- a/src/cpl_core/mailing/__init__.py +++ b/src/cpl_core/mailing/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.mailing' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple @@ -27,4 +27,4 @@ from .email_client_settings import EMailClientSettings from .email_client_settings_name_enum import EMailClientSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_core/pipes/__init__.py b/src/cpl_core/pipes/__init__.py index 11fb1b38..5fc6e056 100644 --- a/src/cpl_core/pipes/__init__.py +++ b/src/cpl_core/pipes/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.pipes' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple @@ -29,4 +29,4 @@ from .to_camel_case_pipe import ToCamelCasePipe from .to_snake_case_pipe import ToSnakeCasePipe VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_core/time/__init__.py b/src/cpl_core/time/__init__.py index 7f72b984..e9c8aa2b 100644 --- a/src/cpl_core/time/__init__.py +++ b/src/cpl_core/time/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.time' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple @@ -24,4 +24,4 @@ from .time_format_settings import TimeFormatSettings from .time_format_settings_names_enum import TimeFormatSettingsNamesEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_core/utils/__init__.py b/src/cpl_core/utils/__init__.py index 99a83653..85b0aafe 100644 --- a/src/cpl_core/utils/__init__.py +++ b/src/cpl_core/utils/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.utils' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple @@ -25,4 +25,4 @@ from .string import String from .pip import Pip VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_query/__init__.py b/src/cpl_query/__init__.py index d1767b45..04485c7d 100644 --- a/src/cpl_query/__init__.py +++ b/src/cpl_query/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_query' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_query/_query/__init__.py b/src/cpl_query/_query/__init__.py index 77edb5f1..ebc23ce0 100644 --- a/src/cpl_query/_query/__init__.py +++ b/src/cpl_query/_query/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_query._query' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/cpl_query/cpl-query.json b/src/cpl_query/cpl-query.json index 97472344..e1aa0430 100644 --- a/src/cpl_query/cpl-query.json +++ b/src/cpl_query/cpl-query.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "16.dev2" + "Micro": "17.dev1" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.16.dev2" + "cpl-core>=2022.6.17.dev1" ], "PythonVersion": ">=3.10", "PythonPath": {}, diff --git a/src/cpl_query/extension/__init__.py b/src/cpl_query/extension/__init__.py index de7ba7dd..b3c24dc9 100644 --- a/src/cpl_query/extension/__init__.py +++ b/src/cpl_query/extension/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_query.extension' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.16.dev2' +__version__ = '2022.6.17.dev1' from collections import namedtuple @@ -27,4 +27,4 @@ from .ordered_iterable_abc import OrderedIterableABC from .ordered_iterable import OrderedIterable VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='16.dev2') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') diff --git a/src/tests/unittests/__init__.py b/src/tests/unittests/__init__.py new file mode 100644 index 00000000..ad5eca30 --- /dev/null +++ b/src/tests/unittests/__init__.py @@ -0,0 +1 @@ +# imports: diff --git a/src/tests/unittests/application.py b/src/tests/unittests/application.py new file mode 100644 index 00000000..a3bd8cdb --- /dev/null +++ b/src/tests/unittests/application.py @@ -0,0 +1,21 @@ +import unittest +from unittest import TestSuite + +from cpl_core.application import ApplicationABC +from cpl_core.configuration import ConfigurationABC +from cpl_core.dependency_injection import ServiceProviderABC +from unittests.test_case import TestCase + + +class Application(ApplicationABC): + + def __init__(self, config: ConfigurationABC, services: ServiceProviderABC): + ApplicationABC.__init__(self, config, services) + self._suite: TestSuite = unittest.TestSuite() + + def configure(self): + self._suite.addTest(TestCase('test_equal')) + + def main(self): + runner = unittest.TextTestRunner() + runner.run(self._suite) diff --git a/src/tests/unittests/main.py b/src/tests/unittests/main.py new file mode 100644 index 00000000..5fae2bbb --- /dev/null +++ b/src/tests/unittests/main.py @@ -0,0 +1,11 @@ +from cpl_core.application import ApplicationBuilder +from unittests.application import Application + + +def main(): + app_builder = ApplicationBuilder(Application) + app_builder.build().run() + + +if __name__ == '__main__': + main() diff --git a/src/tests/unittests/test_case.py b/src/tests/unittests/test_case.py new file mode 100644 index 00000000..0e4dad56 --- /dev/null +++ b/src/tests/unittests/test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class TestCase(unittest.TestCase): + + def setUp(self) -> None: + pass + + def test_equal(self): + self.assertEqual(True, True) diff --git a/src/tests/unittests/unittests.json b/src/tests/unittests/unittests.json new file mode 100644 index 00000000..5b8bd202 --- /dev/null +++ b/src/tests/unittests/unittests.json @@ -0,0 +1,43 @@ +{ + "ProjectSettings": { + "Name": "unittests", + "Version": { + "Major": "0", + "Minor": "0", + "Micro": "0" + }, + "Author": "", + "AuthorEmail": "", + "Description": "", + "LongDescription": "", + "URL": "", + "CopyrightDate": "", + "CopyrightName": "", + "LicenseName": "", + "LicenseDescription": "", + "Dependencies": [ + "cpl-core>=2022.6.17.dev1" + ], + "PythonVersion": ">=3.10.4", + "PythonPath": { + "linux": "" + }, + "Classifiers": [] + }, + "BuildSettings": { + "ProjectType": "unittest", + "SourcePath": "", + "OutputPath": "../../dist", + "Main": "tests/unittest.main", + "EntryPoint": "tests/unittest", + "IncludePackageData": false, + "Included": [], + "Excluded": [ + "*/__pycache__", + "*/logs", + "*/tests" + ], + "PackageData": {}, + "ProjectReferences": [] + } +} \ No newline at end of file diff --git a/src/tests/unittests_cli/__init__.py b/src/tests/unittests_cli/__init__.py new file mode 100644 index 00000000..ad5eca30 --- /dev/null +++ b/src/tests/unittests_cli/__init__.py @@ -0,0 +1 @@ +# imports: diff --git a/src/tests/unittests_cli/unittests_cli.json b/src/tests/unittests_cli/unittests_cli.json new file mode 100644 index 00000000..2288876a --- /dev/null +++ b/src/tests/unittests_cli/unittests_cli.json @@ -0,0 +1,43 @@ +{ + "ProjectSettings": { + "Name": "unittest_cli", + "Version": { + "Major": "0", + "Minor": "0", + "Micro": "0" + }, + "Author": "", + "AuthorEmail": "", + "Description": "", + "LongDescription": "", + "URL": "", + "CopyrightDate": "", + "CopyrightName": "", + "LicenseName": "", + "LicenseDescription": "", + "Dependencies": [ + "cpl-core>=2022.6.17.dev1" + ], + "PythonVersion": ">=3.10.4", + "PythonPath": { + "linux": "" + }, + "Classifiers": [] + }, + "BuildSettings": { + "ProjectType": "library", + "SourcePath": "", + "OutputPath": "../../dist", + "Main": "tests/unittest_cli.main", + "EntryPoint": "tests/unittest_cli", + "IncludePackageData": false, + "Included": [], + "Excluded": [ + "*/__pycache__", + "*/logs", + "*/tests" + ], + "PackageData": {}, + "ProjectReferences": [] + } +} \ No newline at end of file diff --git a/src/tests/unittests_core/__init__.py b/src/tests/unittests_core/__init__.py new file mode 100644 index 00000000..ad5eca30 --- /dev/null +++ b/src/tests/unittests_core/__init__.py @@ -0,0 +1 @@ +# imports: diff --git a/src/tests/unittests_core/unittests_core.json b/src/tests/unittests_core/unittests_core.json new file mode 100644 index 00000000..99fd0717 --- /dev/null +++ b/src/tests/unittests_core/unittests_core.json @@ -0,0 +1,43 @@ +{ + "ProjectSettings": { + "Name": "unittest_core", + "Version": { + "Major": "0", + "Minor": "0", + "Micro": "0" + }, + "Author": "", + "AuthorEmail": "", + "Description": "", + "LongDescription": "", + "URL": "", + "CopyrightDate": "", + "CopyrightName": "", + "LicenseName": "", + "LicenseDescription": "", + "Dependencies": [ + "cpl-core>=2022.6.17.dev1" + ], + "PythonVersion": ">=3.10.4", + "PythonPath": { + "linux": "" + }, + "Classifiers": [] + }, + "BuildSettings": { + "ProjectType": "library", + "SourcePath": "", + "OutputPath": "../../dist", + "Main": "tests/unittest_core.main", + "EntryPoint": "tests/unittest_core", + "IncludePackageData": false, + "Included": [], + "Excluded": [ + "*/__pycache__", + "*/logs", + "*/tests" + ], + "PackageData": {}, + "ProjectReferences": [] + } +} \ No newline at end of file diff --git a/src/tests/unittests_query/__init__.py b/src/tests/unittests_query/__init__.py new file mode 100644 index 00000000..ad5eca30 --- /dev/null +++ b/src/tests/unittests_query/__init__.py @@ -0,0 +1 @@ +# imports: diff --git a/src/tests/unittests_query/unittests_query.json b/src/tests/unittests_query/unittests_query.json new file mode 100644 index 00000000..655d4a42 --- /dev/null +++ b/src/tests/unittests_query/unittests_query.json @@ -0,0 +1,43 @@ +{ + "ProjectSettings": { + "Name": "unittest_query", + "Version": { + "Major": "0", + "Minor": "0", + "Micro": "0" + }, + "Author": "", + "AuthorEmail": "", + "Description": "", + "LongDescription": "", + "URL": "", + "CopyrightDate": "", + "CopyrightName": "", + "LicenseName": "", + "LicenseDescription": "", + "Dependencies": [ + "cpl-core>=2022.6.17.dev1" + ], + "PythonVersion": ">=3.10.4", + "PythonPath": { + "linux": "" + }, + "Classifiers": [] + }, + "BuildSettings": { + "ProjectType": "library", + "SourcePath": "", + "OutputPath": "../../dist", + "Main": "tests/unittest_query.main", + "EntryPoint": "tests/unittest_query", + "IncludePackageData": false, + "Included": [], + "Excluded": [ + "*/__pycache__", + "*/logs", + "*/tests" + ], + "PackageData": {}, + "ProjectReferences": [] + } +} \ No newline at end of file diff --git a/src/tests/unittests_shared/__init__.py b/src/tests/unittests_shared/__init__.py new file mode 100644 index 00000000..ad5eca30 --- /dev/null +++ b/src/tests/unittests_shared/__init__.py @@ -0,0 +1 @@ +# imports: diff --git a/src/tests/unittests_shared/unittests_shared.json b/src/tests/unittests_shared/unittests_shared.json new file mode 100644 index 00000000..907ab2ec --- /dev/null +++ b/src/tests/unittests_shared/unittests_shared.json @@ -0,0 +1,43 @@ +{ + "ProjectSettings": { + "Name": "unittest_shared", + "Version": { + "Major": "0", + "Minor": "0", + "Micro": "0" + }, + "Author": "", + "AuthorEmail": "", + "Description": "", + "LongDescription": "", + "URL": "", + "CopyrightDate": "", + "CopyrightName": "", + "LicenseName": "", + "LicenseDescription": "", + "Dependencies": [ + "cpl-core>=2022.6.17.dev1" + ], + "PythonVersion": ">=3.10.4", + "PythonPath": { + "linux": "" + }, + "Classifiers": [] + }, + "BuildSettings": { + "ProjectType": "library", + "SourcePath": "", + "OutputPath": "../../dist", + "Main": "tests/unittest_shared.main", + "EntryPoint": "tests/unittest_shared", + "IncludePackageData": false, + "Included": [], + "Excluded": [ + "*/__pycache__", + "*/logs", + "*/tests" + ], + "PackageData": {}, + "ProjectReferences": [] + } +} \ No newline at end of file diff --git a/tools/set_pip_urls/set-pip-urls.json b/tools/set_pip_urls/set-pip-urls.json index 4a56be00..d35bf734 100644 --- a/tools/set_pip_urls/set-pip-urls.json +++ b/tools/set_pip_urls/set-pip-urls.json @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.16.dev2" + "cpl-core>=2022.6.17.dev1" ], "PythonVersion": ">=3.10.4", "PythonPath": {}, diff --git a/tools/set_version/set-version.json b/tools/set_version/set-version.json index 27374888..fad80aad 100644 --- a/tools/set_version/set-version.json +++ b/tools/set_version/set-version.json @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.16.dev2" + "cpl-core>=2022.6.17.dev1" ], "PythonVersion": ">=3.10.4", "PythonPath": {}, From e74e39c1894019029d5988d3b2a14c0c9234a222 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 13:49:31 +0200 Subject: [PATCH 04/51] Added CLI command test cases --- src/tests/unittests/application.py | 7 ++-- src/tests/unittests/test_case.py | 10 ------ src/tests/unittests_cli/add_test_case.py | 10 ++++++ src/tests/unittests_cli/build_test_case.py | 10 ++++++ src/tests/unittests_cli/cli_test_suite.py | 34 +++++++++++++++++++ src/tests/unittests_cli/custom_test_case.py | 10 ++++++ src/tests/unittests_cli/generate_test_case.py | 10 ++++++ src/tests/unittests_cli/install_test_case.py | 10 ++++++ src/tests/unittests_cli/new_test_case.py | 10 ++++++ src/tests/unittests_cli/publish_test_case.py | 10 ++++++ src/tests/unittests_cli/remove_test_case.py | 10 ++++++ src/tests/unittests_cli/run_test_case.py | 10 ++++++ src/tests/unittests_cli/start_test_case.py | 10 ++++++ .../unittests_cli/uninstall_test_case.py | 10 ++++++ src/tests/unittests_cli/update_test_case.py | 10 ++++++ src/tests/unittests_cli/version_test_case.py | 10 ++++++ 16 files changed, 167 insertions(+), 14 deletions(-) delete mode 100644 src/tests/unittests/test_case.py create mode 100644 src/tests/unittests_cli/add_test_case.py create mode 100644 src/tests/unittests_cli/build_test_case.py create mode 100644 src/tests/unittests_cli/cli_test_suite.py create mode 100644 src/tests/unittests_cli/custom_test_case.py create mode 100644 src/tests/unittests_cli/generate_test_case.py create mode 100644 src/tests/unittests_cli/install_test_case.py create mode 100644 src/tests/unittests_cli/new_test_case.py create mode 100644 src/tests/unittests_cli/publish_test_case.py create mode 100644 src/tests/unittests_cli/remove_test_case.py create mode 100644 src/tests/unittests_cli/run_test_case.py create mode 100644 src/tests/unittests_cli/start_test_case.py create mode 100644 src/tests/unittests_cli/uninstall_test_case.py create mode 100644 src/tests/unittests_cli/update_test_case.py create mode 100644 src/tests/unittests_cli/version_test_case.py diff --git a/src/tests/unittests/application.py b/src/tests/unittests/application.py index a3bd8cdb..105f0a8c 100644 --- a/src/tests/unittests/application.py +++ b/src/tests/unittests/application.py @@ -4,18 +4,17 @@ from unittest import TestSuite from cpl_core.application import ApplicationABC from cpl_core.configuration import ConfigurationABC from cpl_core.dependency_injection import ServiceProviderABC -from unittests.test_case import TestCase +from unittests_cli.cli_test_suite import CLITestSuite class Application(ApplicationABC): def __init__(self, config: ConfigurationABC, services: ServiceProviderABC): ApplicationABC.__init__(self, config, services) - self._suite: TestSuite = unittest.TestSuite() def configure(self): - self._suite.addTest(TestCase('test_equal')) + pass def main(self): runner = unittest.TextTestRunner() - runner.run(self._suite) + runner.run(CLITestSuite()) diff --git a/src/tests/unittests/test_case.py b/src/tests/unittests/test_case.py deleted file mode 100644 index 0e4dad56..00000000 --- a/src/tests/unittests/test_case.py +++ /dev/null @@ -1,10 +0,0 @@ -import unittest - - -class TestCase(unittest.TestCase): - - def setUp(self) -> None: - pass - - def test_equal(self): - self.assertEqual(True, True) diff --git a/src/tests/unittests_cli/add_test_case.py b/src/tests/unittests_cli/add_test_case.py new file mode 100644 index 00000000..c2f493b3 --- /dev/null +++ b/src/tests/unittests_cli/add_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class AddTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/build_test_case.py b/src/tests/unittests_cli/build_test_case.py new file mode 100644 index 00000000..2456c099 --- /dev/null +++ b/src/tests/unittests_cli/build_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class BuildTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/cli_test_suite.py b/src/tests/unittests_cli/cli_test_suite.py new file mode 100644 index 00000000..eda27da3 --- /dev/null +++ b/src/tests/unittests_cli/cli_test_suite.py @@ -0,0 +1,34 @@ +import unittest + +from unittests_cli.add_test_case import AddTestCase +from unittests_cli.build_test_case import BuildTestCase +from unittests_cli.generate_test_case import GenerateTestCase +from unittests_cli.install_test_case import InstallTestCase +from unittests_cli.new_test_case import NewTestCase +from unittests_cli.publish_test_case import PublishTestCase +from unittests_cli.remove_test_case import RemoveTestCase +from unittests_cli.run_test_case import RunTestCase +from unittests_cli.start_test_case import StartTestCase +from unittests_cli.uninstall_test_case import UninstallTestCase +from unittests_cli.update_test_case import UpdateTestCase +from unittests_cli.version_test_case import VersionTestCase + + +class CLITestSuite(unittest.TestSuite): + + def __init__(self): + unittest.TestSuite.__init__(self) + + loader = unittest.TestLoader() + self.addTests(loader.loadTestsFromTestCase(AddTestCase)) + self.addTests(loader.loadTestsFromTestCase(BuildTestCase)) + self.addTests(loader.loadTestsFromTestCase(GenerateTestCase)) + self.addTests(loader.loadTestsFromTestCase(InstallTestCase)) + self.addTests(loader.loadTestsFromTestCase(NewTestCase)) + self.addTests(loader.loadTestsFromTestCase(PublishTestCase)) + self.addTests(loader.loadTestsFromTestCase(RemoveTestCase)) + self.addTests(loader.loadTestsFromTestCase(RunTestCase)) + self.addTests(loader.loadTestsFromTestCase(StartTestCase)) + self.addTests(loader.loadTestsFromTestCase(UninstallTestCase)) + self.addTests(loader.loadTestsFromTestCase(UpdateTestCase)) + self.addTests(loader.loadTestsFromTestCase(VersionTestCase)) diff --git a/src/tests/unittests_cli/custom_test_case.py b/src/tests/unittests_cli/custom_test_case.py new file mode 100644 index 00000000..db59be7d --- /dev/null +++ b/src/tests/unittests_cli/custom_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class CustomTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/generate_test_case.py b/src/tests/unittests_cli/generate_test_case.py new file mode 100644 index 00000000..e525695a --- /dev/null +++ b/src/tests/unittests_cli/generate_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class GenerateTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/install_test_case.py b/src/tests/unittests_cli/install_test_case.py new file mode 100644 index 00000000..0271f37b --- /dev/null +++ b/src/tests/unittests_cli/install_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class InstallTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/new_test_case.py b/src/tests/unittests_cli/new_test_case.py new file mode 100644 index 00000000..d902e011 --- /dev/null +++ b/src/tests/unittests_cli/new_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class NewTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/publish_test_case.py b/src/tests/unittests_cli/publish_test_case.py new file mode 100644 index 00000000..bad55d55 --- /dev/null +++ b/src/tests/unittests_cli/publish_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class PublishTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/remove_test_case.py b/src/tests/unittests_cli/remove_test_case.py new file mode 100644 index 00000000..a600c283 --- /dev/null +++ b/src/tests/unittests_cli/remove_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class RemoveTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/run_test_case.py b/src/tests/unittests_cli/run_test_case.py new file mode 100644 index 00000000..7ace1dd2 --- /dev/null +++ b/src/tests/unittests_cli/run_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class RunTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/start_test_case.py b/src/tests/unittests_cli/start_test_case.py new file mode 100644 index 00000000..8da691da --- /dev/null +++ b/src/tests/unittests_cli/start_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class StartTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/uninstall_test_case.py b/src/tests/unittests_cli/uninstall_test_case.py new file mode 100644 index 00000000..f3d1ae15 --- /dev/null +++ b/src/tests/unittests_cli/uninstall_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class UninstallTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/update_test_case.py b/src/tests/unittests_cli/update_test_case.py new file mode 100644 index 00000000..35e6d8f3 --- /dev/null +++ b/src/tests/unittests_cli/update_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class UpdateTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass diff --git a/src/tests/unittests_cli/version_test_case.py b/src/tests/unittests_cli/version_test_case.py new file mode 100644 index 00000000..cd7e75e9 --- /dev/null +++ b/src/tests/unittests_cli/version_test_case.py @@ -0,0 +1,10 @@ +import unittest + + +class VersionTestCase(unittest.TestCase): + + def setUp(self): + pass + + def test_equal(self): + pass From 46cceb0910c4af5e27f9a77c2c8167551d085f9d Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 13:59:46 +0200 Subject: [PATCH 05/51] Registered CLI test cases --- src/tests/unittests_cli/cli_test_suite.py | 40 ++++++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/src/tests/unittests_cli/cli_test_suite.py b/src/tests/unittests_cli/cli_test_suite.py index eda27da3..91d3e05b 100644 --- a/src/tests/unittests_cli/cli_test_suite.py +++ b/src/tests/unittests_cli/cli_test_suite.py @@ -1,3 +1,5 @@ +import os +import traceback import unittest from unittests_cli.add_test_case import AddTestCase @@ -19,16 +21,44 @@ class CLITestSuite(unittest.TestSuite): def __init__(self): unittest.TestSuite.__init__(self) + self._setup() + loader = unittest.TestLoader() - self.addTests(loader.loadTestsFromTestCase(AddTestCase)) - self.addTests(loader.loadTestsFromTestCase(BuildTestCase)) + # nothing needed self.addTests(loader.loadTestsFromTestCase(GenerateTestCase)) - self.addTests(loader.loadTestsFromTestCase(InstallTestCase)) self.addTests(loader.loadTestsFromTestCase(NewTestCase)) + self.addTests(loader.loadTestsFromTestCase(VersionTestCase)) + + # project needed + self.addTests(loader.loadTestsFromTestCase(BuildTestCase)) + self.addTests(loader.loadTestsFromTestCase(InstallTestCase)) self.addTests(loader.loadTestsFromTestCase(PublishTestCase)) - self.addTests(loader.loadTestsFromTestCase(RemoveTestCase)) self.addTests(loader.loadTestsFromTestCase(RunTestCase)) self.addTests(loader.loadTestsFromTestCase(StartTestCase)) self.addTests(loader.loadTestsFromTestCase(UninstallTestCase)) self.addTests(loader.loadTestsFromTestCase(UpdateTestCase)) - self.addTests(loader.loadTestsFromTestCase(VersionTestCase)) + + # workspace needed + self.addTests(loader.loadTestsFromTestCase(AddTestCase)) + self.addTests(loader.loadTestsFromTestCase(RemoveTestCase)) + + self._cleanup() + + def _setup(self): + try: + playground = os.path.abspath(os.path.join(os.getcwd(), 'test_cli_playground')) + if os.path.exists(playground): + os.rmdir(playground) + + os.mkdir(playground) + os.chdir(playground) + except Exception as e: + print(f'Setup of {__name__} failed: {traceback.format_exc()}') + + def _cleanup(self): + try: + playground = os.path.abspath(os.path.join(os.getcwd(), 'test_cli_playground')) + if os.path.exists(playground): + os.rmdir(playground) + except Exception as e: + print(f'Cleanup of {__name__} failed: {traceback.format_exc()}') From d937c4c0e67841003e67f0f1a23f14d89b0b5ff6 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 14:47:36 +0200 Subject: [PATCH 06/51] Added tests for generate command --- src/tests/unittests/application.py | 2 +- src/tests/unittests/unittests.json | 4 +- src/tests/unittests_cli/cli_test_suite.py | 27 +++++++------ src/tests/unittests_cli/constants.py | 3 ++ src/tests/unittests_cli/generate_test_case.py | 39 ++++++++++++++++++- src/tests/unittests_cli/unittests_cli.json | 4 +- src/tests/unittests_core/unittests_core.json | 4 +- .../unittests_query/unittests_query.json | 4 +- src/tests/unittests_shared/cli_commands.py | 23 +++++++++++ .../unittests_shared/unittests_shared.json | 4 +- 10 files changed, 89 insertions(+), 25 deletions(-) create mode 100644 src/tests/unittests_cli/constants.py create mode 100644 src/tests/unittests_shared/cli_commands.py diff --git a/src/tests/unittests/application.py b/src/tests/unittests/application.py index 105f0a8c..2b7af5c8 100644 --- a/src/tests/unittests/application.py +++ b/src/tests/unittests/application.py @@ -1,5 +1,5 @@ +import time import unittest -from unittest import TestSuite from cpl_core.application import ApplicationABC from cpl_core.configuration import ConfigurationABC diff --git a/src/tests/unittests/unittests.json b/src/tests/unittests/unittests.json index 5b8bd202..3229906b 100644 --- a/src/tests/unittests/unittests.json +++ b/src/tests/unittests/unittests.json @@ -28,8 +28,8 @@ "ProjectType": "unittest", "SourcePath": "", "OutputPath": "../../dist", - "Main": "tests/unittest.main", - "EntryPoint": "tests/unittest", + "Main": "unittest.main", + "EntryPoint": "unittest", "IncludePackageData": false, "Included": [], "Excluded": [ diff --git a/src/tests/unittests_cli/cli_test_suite.py b/src/tests/unittests_cli/cli_test_suite.py index 91d3e05b..eb82349a 100644 --- a/src/tests/unittests_cli/cli_test_suite.py +++ b/src/tests/unittests_cli/cli_test_suite.py @@ -1,9 +1,11 @@ import os +import shutil import traceback import unittest from unittests_cli.add_test_case import AddTestCase from unittests_cli.build_test_case import BuildTestCase +from unittests_cli.constants import PLAYGROUND from unittests_cli.generate_test_case import GenerateTestCase from unittests_cli.install_test_case import InstallTestCase from unittests_cli.new_test_case import NewTestCase @@ -21,8 +23,6 @@ class CLITestSuite(unittest.TestSuite): def __init__(self): unittest.TestSuite.__init__(self) - self._setup() - loader = unittest.TestLoader() # nothing needed self.addTests(loader.loadTestsFromTestCase(GenerateTestCase)) @@ -42,23 +42,26 @@ class CLITestSuite(unittest.TestSuite): self.addTests(loader.loadTestsFromTestCase(AddTestCase)) self.addTests(loader.loadTestsFromTestCase(RemoveTestCase)) - self._cleanup() - def _setup(self): + print(f'Setup {__name__}') try: - playground = os.path.abspath(os.path.join(os.getcwd(), 'test_cli_playground')) - if os.path.exists(playground): - os.rmdir(playground) + if os.path.exists(PLAYGROUND): + shutil.rmtree(PLAYGROUND) - os.mkdir(playground) - os.chdir(playground) + os.mkdir(PLAYGROUND) + os.chdir(PLAYGROUND) except Exception as e: print(f'Setup of {__name__} failed: {traceback.format_exc()}') def _cleanup(self): + print(f'Cleanup {__name__}') try: - playground = os.path.abspath(os.path.join(os.getcwd(), 'test_cli_playground')) - if os.path.exists(playground): - os.rmdir(playground) + if os.path.exists(PLAYGROUND): + shutil.rmtree(PLAYGROUND) except Exception as e: print(f'Cleanup of {__name__} failed: {traceback.format_exc()}') + + def run(self, *args): + self._setup() + super().run(*args) + self._cleanup() diff --git a/src/tests/unittests_cli/constants.py b/src/tests/unittests_cli/constants.py new file mode 100644 index 00000000..272a19e0 --- /dev/null +++ b/src/tests/unittests_cli/constants.py @@ -0,0 +1,3 @@ +import os + +PLAYGROUND = os.path.abspath(os.path.join(os.getcwd(), '../generated/test_cli_playground')) \ No newline at end of file diff --git a/src/tests/unittests_cli/generate_test_case.py b/src/tests/unittests_cli/generate_test_case.py index e525695a..5530ccba 100644 --- a/src/tests/unittests_cli/generate_test_case.py +++ b/src/tests/unittests_cli/generate_test_case.py @@ -1,10 +1,45 @@ +import os.path import unittest +from unittests_cli.constants import PLAYGROUND +from unittests_shared.cli_commands import CLICommands + class GenerateTestCase(unittest.TestCase): def setUp(self): pass - def test_equal(self): - pass + def _test_file(self, schematic: str, suffix: str): + CLICommands.generate(schematic, 'GeneratedFile') + file_path = os.path.abspath(os.path.join(PLAYGROUND, f'generated_file{suffix}.py')) + file_exists = os.path.exists(file_path) + self.assertTrue(file_exists) + os.remove(file_path) + + def test_abc(self): + self._test_file('abc', '_abc') + + def test_class(self): + self._test_file('class', '') + + def test_enum(self): + self._test_file('enum', '_enum') + + def test_pipe(self): + self._test_file('pipe', '_pipe') + + def test_service(self): + self._test_file('service', '_service') + + def test_settings(self): + self._test_file('settings', '_settings') + + def test_test_case(self): + self._test_file('test_case', '_test_case') + + def test_thread(self): + self._test_file('thread', '_thread') + + def test_validator(self): + self._test_file('validator', '_validator') diff --git a/src/tests/unittests_cli/unittests_cli.json b/src/tests/unittests_cli/unittests_cli.json index 2288876a..44b9eb9f 100644 --- a/src/tests/unittests_cli/unittests_cli.json +++ b/src/tests/unittests_cli/unittests_cli.json @@ -28,8 +28,8 @@ "ProjectType": "library", "SourcePath": "", "OutputPath": "../../dist", - "Main": "tests/unittest_cli.main", - "EntryPoint": "tests/unittest_cli", + "Main": "unittest_cli.main", + "EntryPoint": "unittest_cli", "IncludePackageData": false, "Included": [], "Excluded": [ diff --git a/src/tests/unittests_core/unittests_core.json b/src/tests/unittests_core/unittests_core.json index 99fd0717..33e28883 100644 --- a/src/tests/unittests_core/unittests_core.json +++ b/src/tests/unittests_core/unittests_core.json @@ -28,8 +28,8 @@ "ProjectType": "library", "SourcePath": "", "OutputPath": "../../dist", - "Main": "tests/unittest_core.main", - "EntryPoint": "tests/unittest_core", + "Main": "unittest_core.main", + "EntryPoint": "unittest_core", "IncludePackageData": false, "Included": [], "Excluded": [ diff --git a/src/tests/unittests_query/unittests_query.json b/src/tests/unittests_query/unittests_query.json index 655d4a42..ae2b1bd4 100644 --- a/src/tests/unittests_query/unittests_query.json +++ b/src/tests/unittests_query/unittests_query.json @@ -28,8 +28,8 @@ "ProjectType": "library", "SourcePath": "", "OutputPath": "../../dist", - "Main": "tests/unittest_query.main", - "EntryPoint": "tests/unittest_query", + "Main": "unittest_query.main", + "EntryPoint": "unittest_query", "IncludePackageData": false, "Included": [], "Excluded": [ diff --git a/src/tests/unittests_shared/cli_commands.py b/src/tests/unittests_shared/cli_commands.py new file mode 100644 index 00000000..23cb5589 --- /dev/null +++ b/src/tests/unittests_shared/cli_commands.py @@ -0,0 +1,23 @@ +import os +import subprocess + + +class CLICommands: + + @staticmethod + def _run(cmd: str, *args): + env_vars = os.environ + command = ['python', os.path.abspath(os.path.join(os.getcwd(), '../../../cpl_cli/main.py')), cmd] + for arg in args: + command.append(arg) + + print(f'Running {command}') + subprocess.run(command, env=env_vars) + + @classmethod + def generate(cls, *args): + cls._run('generate', *args) + + @classmethod + def new(cls, *args): + cls._run('new', *args) diff --git a/src/tests/unittests_shared/unittests_shared.json b/src/tests/unittests_shared/unittests_shared.json index 907ab2ec..d1914479 100644 --- a/src/tests/unittests_shared/unittests_shared.json +++ b/src/tests/unittests_shared/unittests_shared.json @@ -28,8 +28,8 @@ "ProjectType": "library", "SourcePath": "", "OutputPath": "../../dist", - "Main": "tests/unittest_shared.main", - "EntryPoint": "tests/unittest_shared", + "Main": "unittest_shared.main", + "EntryPoint": "unittest_shared", "IncludePackageData": false, "Included": [], "Excluded": [ From a72dd0dc2e9edc355159253537da4e916f0d3424 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 15:29:49 +0200 Subject: [PATCH 07/51] Improved tests --- cpl-workspace.json | 11 +++++++++++ src/tests/unittests/application.py | 1 - src/tests/unittests_cli/cli_test_suite.py | 14 +++++++------- src/tests/unittests_cli/constants.py | 3 ++- src/tests/unittests_cli/generate_test_case.py | 7 ++----- src/tests/unittests_shared/cli_commands.py | 4 +++- 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/cpl-workspace.json b/cpl-workspace.json index 3413e861..cf6608bf 100644 --- a/cpl-workspace.json +++ b/cpl-workspace.json @@ -15,14 +15,20 @@ }, "Scripts": { "hello-world": "echo 'Hello World'", + "sv": "cpl set-version", "set-version": "cpl run set-version $ARGS; echo '';", + "spu": "cpl set-pip-urls", "set-pip-urls": "cpl run set-pip-urls $ARGS; echo '';", + "docs-build": "echo 'Build Documentation'; cd docs/; sphinx-apidoc -o source/ ../src/cpl_core; sphinx-apidoc -o source/ ../src/cpl_query; make clean; make html; rm source/cpl_query.tests.rst;", "db": "cpl build-docs", "docs-open": "xdg-open $PWD/docs/build/html/index.html &", "do": "cpl docs-open", + + "test": "cpl run unittests", + "pre-build-all": "cpl sv $ARGS; cpl spu $ARGS;", "build-all": "cpl build-cli; cpl build-core; cpl build-query; cpl build-set-pip-urls; cpl build-set-version", "ba": "cpl build-all $ARGS", @@ -31,12 +37,14 @@ "build-query": "echo 'Build cpl-query'; cd ./src/cpl_query; cpl build; cd ../../;", "build-set-pip-urls": "echo 'Build set-pip-urls'; cd ./tools/set_pip_urls; cpl build; cd ../../;", "build-set-version": "echo 'Build set-version'; cd ./tools/set_version; cpl build; cd ../../;", + "pre-publish-all": "cpl sv $ARGS; cpl spu $ARGS;", "publish-all": "cpl publish-cli; cpl publish-core; cpl publish-query;", "pa": "cpl build-all $ARGS", "publish-cli": "echo 'Publish cpl-cli'; cd ./src/cpl_cli; cpl publish; cd ../../;", "publish-core": "echo 'Publish cpl-core'; cd ./src/cpl_core; cpl publish; cd ../../;", "publish-query": "echo 'Publish cpl_query'; cd ./src/cpl_query; cpl publish; cd ../../;", + "upload-prod-cli": "echo 'PROD Upload cpl-cli'; cpl upl-prod-cli;", "upl-prod-cli": "twine upload -r pip.sh-edraft.de dist/cpl-cli/publish/setup/*", "upload-prod-core": "echo 'PROD Upload cpl-core'; cpl upl-prod-core;", @@ -55,18 +63,21 @@ "upl-dev-core": "twine upload -r pip-dev.sh-edraft.de dist/cpl-core/publish/setup/*", "upload-dev-query": "echo 'DEV Upload cpl_query'; cpl upl-dev-query;", "upl-dev-query": "twine upload -r pip-dev.sh-edraft.de dist/cpl-query/publish/setup/*", + "pre-deploy-prod": "cpl sv $ARGS; cpl spu --environment=production;", "deploy-prod": "cpl deploy-prod-cli; cpl deploy-prod-core; cpl deploy-prod-query;", "dp": "cpl deploy-prod $ARGS", "deploy-prod-cli": "cpl publish-cli; cpl upload-prod-cli", "deploy-prod-core": "cpl publish-core; cpl upload-prod-core", "deploy-prod-query": "cpl publish-query; cpl upload-prod-query", + "pre-deploy-exp": "cpl sv $ARGS; cpl spu --environment=staging;", "deploy-exp": "cpl deploy-exp-cli; cpl deploy-exp-core; cpl deploy-exp-query;", "de": "cpl deploy-exp $ARGS", "deploy-exp-cli": "cpl publish-cli; cpl upload-exp-cli", "deploy-exp-core": "cpl publish-core; cpl upload-exp-core", "deploy-exp-query": "cpl publish-query; cpl upload-exp-query", + "pre-deploy-dev": "cpl sv $ARGS; cpl spu --environment=development;", "deploy-dev": "cpl deploy-dev-cli; cpl deploy-dev-core; cpl deploy-dev-query;", "dd": "cpl deploy-dev $ARGS", diff --git a/src/tests/unittests/application.py b/src/tests/unittests/application.py index 2b7af5c8..9af5ad57 100644 --- a/src/tests/unittests/application.py +++ b/src/tests/unittests/application.py @@ -1,4 +1,3 @@ -import time import unittest from cpl_core.application import ApplicationABC diff --git a/src/tests/unittests_cli/cli_test_suite.py b/src/tests/unittests_cli/cli_test_suite.py index eb82349a..9532fe0c 100644 --- a/src/tests/unittests_cli/cli_test_suite.py +++ b/src/tests/unittests_cli/cli_test_suite.py @@ -5,7 +5,7 @@ import unittest from unittests_cli.add_test_case import AddTestCase from unittests_cli.build_test_case import BuildTestCase -from unittests_cli.constants import PLAYGROUND +from unittests_cli.constants import PLAYGROUND_PATH from unittests_cli.generate_test_case import GenerateTestCase from unittests_cli.install_test_case import InstallTestCase from unittests_cli.new_test_case import NewTestCase @@ -45,19 +45,19 @@ class CLITestSuite(unittest.TestSuite): def _setup(self): print(f'Setup {__name__}') try: - if os.path.exists(PLAYGROUND): - shutil.rmtree(PLAYGROUND) + if os.path.exists(PLAYGROUND_PATH): + shutil.rmtree(PLAYGROUND_PATH) - os.mkdir(PLAYGROUND) - os.chdir(PLAYGROUND) + os.mkdir(PLAYGROUND_PATH) + os.chdir(PLAYGROUND_PATH) except Exception as e: print(f'Setup of {__name__} failed: {traceback.format_exc()}') def _cleanup(self): print(f'Cleanup {__name__}') try: - if os.path.exists(PLAYGROUND): - shutil.rmtree(PLAYGROUND) + if os.path.exists(PLAYGROUND_PATH): + shutil.rmtree(PLAYGROUND_PATH) except Exception as e: print(f'Cleanup of {__name__} failed: {traceback.format_exc()}') diff --git a/src/tests/unittests_cli/constants.py b/src/tests/unittests_cli/constants.py index 272a19e0..bcaa9d93 100644 --- a/src/tests/unittests_cli/constants.py +++ b/src/tests/unittests_cli/constants.py @@ -1,3 +1,4 @@ import os -PLAYGROUND = os.path.abspath(os.path.join(os.getcwd(), '../generated/test_cli_playground')) \ No newline at end of file +PLAYGROUND_PATH = os.path.abspath(os.path.join(os.getcwd(), '../generated/test_cli_playground')) +CLI_PATH = os.path.abspath(os.path.join(os.getcwd(), '../../cpl_cli/main.py')) diff --git a/src/tests/unittests_cli/generate_test_case.py b/src/tests/unittests_cli/generate_test_case.py index 5530ccba..ecc11e68 100644 --- a/src/tests/unittests_cli/generate_test_case.py +++ b/src/tests/unittests_cli/generate_test_case.py @@ -1,18 +1,15 @@ import os.path import unittest -from unittests_cli.constants import PLAYGROUND +from unittests_cli.constants import PLAYGROUND_PATH from unittests_shared.cli_commands import CLICommands class GenerateTestCase(unittest.TestCase): - def setUp(self): - pass - def _test_file(self, schematic: str, suffix: str): CLICommands.generate(schematic, 'GeneratedFile') - file_path = os.path.abspath(os.path.join(PLAYGROUND, f'generated_file{suffix}.py')) + file_path = os.path.abspath(os.path.join(PLAYGROUND_PATH, f'generated_file{suffix}.py')) file_exists = os.path.exists(file_path) self.assertTrue(file_exists) os.remove(file_path) diff --git a/src/tests/unittests_shared/cli_commands.py b/src/tests/unittests_shared/cli_commands.py index 23cb5589..8903bf28 100644 --- a/src/tests/unittests_shared/cli_commands.py +++ b/src/tests/unittests_shared/cli_commands.py @@ -1,13 +1,15 @@ import os import subprocess +from unittests_cli.constants import CLI_PATH + class CLICommands: @staticmethod def _run(cmd: str, *args): env_vars = os.environ - command = ['python', os.path.abspath(os.path.join(os.getcwd(), '../../../cpl_cli/main.py')), cmd] + command = ['python', CLI_PATH, cmd] for arg in args: command.append(arg) From 79b51cf8c50f77a30b210cab69ef5ce3897c8c0a Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 15:41:47 +0200 Subject: [PATCH 08/51] Build dev4 & added unittest support to console --- 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/generate/__init__.py | 4 ++-- src/cpl_cli/_templates/new/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/__init__.py | 4 ++-- .../_templates/new/console/source/__init__.py | 4 ++-- .../_templates/new/console/source/name/__init__.py | 4 ++-- .../_templates/new/console/source/tests/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/__init__.py | 4 ++-- .../_templates/new/library/source/__init__.py | 4 ++-- .../_templates/new/library/source/name/__init__.py | 4 ++-- .../_templates/new/library/source/tests/__init__.py | 4 ++-- src/cpl_cli/_templates/new/unittest/__init__.py | 4 ++-- .../_templates/new/unittest/source/__init__.py | 4 ++-- .../_templates/new/unittest/source/name/__init__.py | 4 ++-- src/cpl_cli/_templates/publish/__init__.py | 4 ++-- src/cpl_cli/command/__init__.py | 4 ++-- src/cpl_cli/configuration/__init__.py | 4 ++-- src/cpl_cli/cpl-cli.json | 4 ++-- src/cpl_cli/live_server/__init__.py | 4 ++-- src/cpl_cli/publish/__init__.py | 4 ++-- src/cpl_cli/source_creator/__init__.py | 4 ++-- src/cpl_cli/startup.py | 7 +++++++ src/cpl_cli/validators/__init__.py | 4 ++-- src/cpl_core/__init__.py | 4 ++-- src/cpl_core/application/__init__.py | 4 ++-- src/cpl_core/configuration/__init__.py | 4 ++-- src/cpl_core/console/__init__.py | 4 ++-- src/cpl_core/console/console.py | 12 ++++++++---- src/cpl_core/cpl-core.json | 2 +- src/cpl_core/database/__init__.py | 4 ++-- src/cpl_core/database/connection/__init__.py | 4 ++-- src/cpl_core/database/context/__init__.py | 4 ++-- src/cpl_core/dependency_injection/__init__.py | 4 ++-- src/cpl_core/environment/__init__.py | 4 ++-- src/cpl_core/logging/__init__.py | 4 ++-- src/cpl_core/mailing/__init__.py | 4 ++-- src/cpl_core/pipes/__init__.py | 4 ++-- src/cpl_core/time/__init__.py | 4 ++-- src/cpl_core/utils/__init__.py | 4 ++-- src/cpl_query/__init__.py | 4 ++-- src/cpl_query/_query/__init__.py | 4 ++-- src/cpl_query/cpl-query.json | 4 ++-- src/cpl_query/extension/__init__.py | 4 ++-- src/tests/unittests/unittests.json | 2 +- src/tests/unittests_cli/unittests_cli.json | 2 +- src/tests/unittests_core/unittests_core.json | 2 +- src/tests/unittests_query/unittests_query.json | 2 +- src/tests/unittests_shared/cli_commands.py | 1 + src/tests/unittests_shared/unittests_shared.json | 2 +- tools/set_pip_urls/set-pip-urls.json | 2 +- tools/set_version/set-version.json | 2 +- 53 files changed, 108 insertions(+), 96 deletions(-) diff --git a/src/cpl_cli/__init__.py b/src/cpl_cli/__init__.py index b5854530..4453a344 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple @@ -27,4 +27,4 @@ from .main import main from .startup import Startup VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/_templates/__init__.py b/src/cpl_cli/_templates/__init__.py index d0e69d94..9114e571 100644 --- a/src/cpl_cli/_templates/__init__.py +++ b/src/cpl_cli/_templates/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/_templates/build/__init__.py b/src/cpl_cli/_templates/build/__init__.py index eb709e22..5a37043e 100644 --- a/src/cpl_cli/_templates/build/__init__.py +++ b/src/cpl_cli/_templates/build/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.build' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/_templates/generate/__init__.py b/src/cpl_cli/_templates/generate/__init__.py index d59b88a9..a41e4be1 100644 --- a/src/cpl_cli/_templates/generate/__init__.py +++ b/src/cpl_cli/_templates/generate/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.generate' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/_templates/new/__init__.py b/src/cpl_cli/_templates/new/__init__.py index 0afadb75..2f826888 100644 --- a/src/cpl_cli/_templates/new/__init__.py +++ b/src/cpl_cli/_templates/new/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/_templates/new/console/__init__.py b/src/cpl_cli/_templates/new/console/__init__.py index 7c9cd418..639774f0 100644 --- a/src/cpl_cli/_templates/new/console/__init__.py +++ b/src/cpl_cli/_templates/new/console/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/_templates/new/console/source/__init__.py b/src/cpl_cli/_templates/new/console/source/__init__.py index 2a2a0da7..3d59f643 100644 --- a/src/cpl_cli/_templates/new/console/source/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/_templates/new/console/source/name/__init__.py b/src/cpl_cli/_templates/new/console/source/name/__init__.py index 167b3efa..f3d64b65 100644 --- a/src/cpl_cli/_templates/new/console/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/_templates/new/console/source/tests/__init__.py b/src/cpl_cli/_templates/new/console/source/tests/__init__.py index 401c97da..f19d8cb1 100644 --- a/src/cpl_cli/_templates/new/console/source/tests/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/tests/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/_templates/new/library/__init__.py b/src/cpl_cli/_templates/new/library/__init__.py index 6a6e2590..ad2fb302 100644 --- a/src/cpl_cli/_templates/new/library/__init__.py +++ b/src/cpl_cli/_templates/new/library/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/_templates/new/library/source/__init__.py b/src/cpl_cli/_templates/new/library/source/__init__.py index f2e65272..881aa9eb 100644 --- a/src/cpl_cli/_templates/new/library/source/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/_templates/new/library/source/name/__init__.py b/src/cpl_cli/_templates/new/library/source/name/__init__.py index 879dd8a9..78dde8dd 100644 --- a/src/cpl_cli/_templates/new/library/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/_templates/new/library/source/tests/__init__.py b/src/cpl_cli/_templates/new/library/source/tests/__init__.py index 2797b086..83dcfa8e 100644 --- a/src/cpl_cli/_templates/new/library/source/tests/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/tests/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/_templates/new/unittest/__init__.py b/src/cpl_cli/_templates/new/unittest/__init__.py index 5bea2565..45a18338 100644 --- a/src/cpl_cli/_templates/new/unittest/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/_templates/new/unittest/source/__init__.py b/src/cpl_cli/_templates/new/unittest/source/__init__.py index 5e46b11a..7a0fa976 100644 --- a/src/cpl_cli/_templates/new/unittest/source/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/_templates/new/unittest/source/name/__init__.py b/src/cpl_cli/_templates/new/unittest/source/name/__init__.py index d180c55d..f574f941 100644 --- a/src/cpl_cli/_templates/new/unittest/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/_templates/publish/__init__.py b/src/cpl_cli/_templates/publish/__init__.py index 48d067e4..ea19fe0b 100644 --- a/src/cpl_cli/_templates/publish/__init__.py +++ b/src/cpl_cli/_templates/publish/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.publish' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/command/__init__.py b/src/cpl_cli/command/__init__.py index 5306254f..832f98dd 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' 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='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/configuration/__init__.py b/src/cpl_cli/configuration/__init__.py index fe0d188b..1c91e504 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple @@ -30,4 +30,4 @@ from .workspace_settings import WorkspaceSettings from .workspace_settings_name_enum import WorkspaceSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/cpl-cli.json b/src/cpl_cli/cpl-cli.json index fc6feec3..f703ce15 100644 --- a/src/cpl_cli/cpl-cli.json +++ b/src/cpl_cli/cpl-cli.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev1" + "Micro": "17.dev4" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17.dev1" + "cpl-core>=2022.6.17.dev4" ], "PythonVersion": ">=3.10", "PythonPath": {}, diff --git a/src/cpl_cli/live_server/__init__.py b/src/cpl_cli/live_server/__init__.py index 873f47da..1ffe1b09 100644 --- a/src/cpl_cli/live_server/__init__.py +++ b/src/cpl_cli/live_server/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.live_server' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/publish/__init__.py b/src/cpl_cli/publish/__init__.py index 79d59622..4dc0d603 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple @@ -24,4 +24,4 @@ from .publisher_abc import PublisherABC from .publisher_service import PublisherService VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/source_creator/__init__.py b/src/cpl_cli/source_creator/__init__.py index ab94ef52..812c7731 100644 --- a/src/cpl_cli/source_creator/__init__.py +++ b/src/cpl_cli/source_creator/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.source_creator' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_cli/startup.py b/src/cpl_cli/startup.py index 25aebea5..48d2f0bd 100644 --- a/src/cpl_cli/startup.py +++ b/src/cpl_cli/startup.py @@ -1,5 +1,7 @@ import os +from cpl_core.console import Console + from cpl_cli.error import Error from cpl_cli.live_server.live_server_service import LiveServerService from cpl_cli.publish.publisher_abc import PublisherABC @@ -22,6 +24,11 @@ class Startup(StartupABC): configuration.add_environment_variables('PYTHON_') configuration.add_environment_variables('CPL_') + + is_unittest = configuration.get_configuration('IS_UNITTEST') + if is_unittest == 'YES': + Console.disable() + configuration.add_json_file('appsettings.json', path=environment.runtime_directory, optional=False, output=False) return configuration diff --git a/src/cpl_cli/validators/__init__.py b/src/cpl_cli/validators/__init__.py index a6c766fd..29cb394b 100644 --- a/src/cpl_cli/validators/__init__.py +++ b/src/cpl_cli/validators/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.validators' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_core/__init__.py b/src/cpl_core/__init__.py index 2ce9ccd9..a8ab174f 100644 --- a/src/cpl_core/__init__.py +++ b/src/cpl_core/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_core' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_core/application/__init__.py b/src/cpl_core/application/__init__.py index 420de028..fed05ec0 100644 --- a/src/cpl_core/application/__init__.py +++ b/src/cpl_core/application/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.application' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple @@ -28,4 +28,4 @@ from .startup_abc import StartupABC from .startup_extension_abc import StartupExtensionABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_core/configuration/__init__.py b/src/cpl_core/configuration/__init__.py index ff10e540..f317fa21 100644 --- a/src/cpl_core/configuration/__init__.py +++ b/src/cpl_core/configuration/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.configuration' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple @@ -34,4 +34,4 @@ from .validator_abc import ValidatorABC from .variable_argument import VariableArgument VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_core/console/__init__.py b/src/cpl_core/console/__init__.py index 2e7ef059..f255ae1c 100644 --- a/src/cpl_core/console/__init__.py +++ b/src/cpl_core/console/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.console' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple @@ -27,4 +27,4 @@ from .foreground_color_enum import ForegroundColorEnum from .spinner_thread import SpinnerThread VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_core/console/console.py b/src/cpl_core/console/console.py index f7a06291..43f9e044 100644 --- a/src/cpl_core/console/console.py +++ b/src/cpl_core/console/console.py @@ -456,17 +456,21 @@ class Console: cls.write_line(message) cls.set_hold_back(True) - spinner = SpinnerThread(len(message), spinner_foreground_color, spinner_background_color) - spinner.start() + spinner = None + if not cls._disabled: + spinner = SpinnerThread(len(message), spinner_foreground_color, spinner_background_color) + spinner.start() return_value = None try: return_value = call(*args, **kwargs) except KeyboardInterrupt: - spinner.exit() + if spinner is not None: + spinner.exit() cls.close() - spinner.stop_spinning() + if spinner is not None: + spinner.stop_spinning() cls.set_hold_back(False) cls.set_foreground_color(ForegroundColorEnum.default) diff --git a/src/cpl_core/cpl-core.json b/src/cpl_core/cpl-core.json index 506659fd..984d3554 100644 --- a/src/cpl_core/cpl-core.json +++ b/src/cpl_core/cpl-core.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev1" + "Micro": "17.dev4" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", diff --git a/src/cpl_core/database/__init__.py b/src/cpl_core/database/__init__.py index d757b8c8..ed634d68 100644 --- a/src/cpl_core/database/__init__.py +++ b/src/cpl_core/database/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple @@ -25,4 +25,4 @@ from .database_settings import DatabaseSettings from .table_abc import TableABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_core/database/connection/__init__.py b/src/cpl_core/database/connection/__init__.py index 27688ef0..03ecf658 100644 --- a/src/cpl_core/database/connection/__init__.py +++ b/src/cpl_core/database/connection/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database.connection' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple @@ -24,4 +24,4 @@ from .database_connection import DatabaseConnection from .database_connection_abc import DatabaseConnectionABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_core/database/context/__init__.py b/src/cpl_core/database/context/__init__.py index f03c170d..30c24743 100644 --- a/src/cpl_core/database/context/__init__.py +++ b/src/cpl_core/database/context/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database.context' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple @@ -24,4 +24,4 @@ from .database_context import DatabaseContext from .database_context_abc import DatabaseContextABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_core/dependency_injection/__init__.py b/src/cpl_core/dependency_injection/__init__.py index cce15295..b03e27c4 100644 --- a/src/cpl_core/dependency_injection/__init__.py +++ b/src/cpl_core/dependency_injection/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.dependency_injection' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple @@ -30,4 +30,4 @@ from .service_provider import ServiceProvider from .service_provider_abc import ServiceProviderABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_core/environment/__init__.py b/src/cpl_core/environment/__init__.py index d25e7291..5194a6e1 100644 --- a/src/cpl_core/environment/__init__.py +++ b/src/cpl_core/environment/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.environment' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple @@ -25,4 +25,4 @@ from .environment_name_enum import EnvironmentNameEnum from .application_environment import ApplicationEnvironment VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_core/logging/__init__.py b/src/cpl_core/logging/__init__.py index 76ca8eb1..7a040367 100644 --- a/src/cpl_core/logging/__init__.py +++ b/src/cpl_core/logging/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.logging' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple @@ -27,4 +27,4 @@ from .logging_settings import LoggingSettings from .logging_settings_name_enum import LoggingSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_core/mailing/__init__.py b/src/cpl_core/mailing/__init__.py index b9c9c0a3..f2b7dc73 100644 --- a/src/cpl_core/mailing/__init__.py +++ b/src/cpl_core/mailing/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.mailing' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple @@ -27,4 +27,4 @@ from .email_client_settings import EMailClientSettings from .email_client_settings_name_enum import EMailClientSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_core/pipes/__init__.py b/src/cpl_core/pipes/__init__.py index 5fc6e056..89a8e972 100644 --- a/src/cpl_core/pipes/__init__.py +++ b/src/cpl_core/pipes/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.pipes' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple @@ -29,4 +29,4 @@ from .to_camel_case_pipe import ToCamelCasePipe from .to_snake_case_pipe import ToSnakeCasePipe VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_core/time/__init__.py b/src/cpl_core/time/__init__.py index e9c8aa2b..2800356a 100644 --- a/src/cpl_core/time/__init__.py +++ b/src/cpl_core/time/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.time' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple @@ -24,4 +24,4 @@ from .time_format_settings import TimeFormatSettings from .time_format_settings_names_enum import TimeFormatSettingsNamesEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_core/utils/__init__.py b/src/cpl_core/utils/__init__.py index 85b0aafe..78050380 100644 --- a/src/cpl_core/utils/__init__.py +++ b/src/cpl_core/utils/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.utils' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple @@ -25,4 +25,4 @@ from .string import String from .pip import Pip VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_query/__init__.py b/src/cpl_query/__init__.py index 04485c7d..7311ca67 100644 --- a/src/cpl_query/__init__.py +++ b/src/cpl_query/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_query' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_query/_query/__init__.py b/src/cpl_query/_query/__init__.py index ebc23ce0..19c9ce97 100644 --- a/src/cpl_query/_query/__init__.py +++ b/src/cpl_query/_query/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_query._query' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/cpl_query/cpl-query.json b/src/cpl_query/cpl-query.json index e1aa0430..e3d23065 100644 --- a/src/cpl_query/cpl-query.json +++ b/src/cpl_query/cpl-query.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev1" + "Micro": "17.dev4" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17.dev1" + "cpl-core>=2022.6.17.dev4" ], "PythonVersion": ">=3.10", "PythonPath": {}, diff --git a/src/cpl_query/extension/__init__.py b/src/cpl_query/extension/__init__.py index b3c24dc9..e63bccea 100644 --- a/src/cpl_query/extension/__init__.py +++ b/src/cpl_query/extension/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_query.extension' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev1' +__version__ = '2022.6.17.dev4' from collections import namedtuple @@ -27,4 +27,4 @@ from .ordered_iterable_abc import OrderedIterableABC from .ordered_iterable import OrderedIterable VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev1') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') diff --git a/src/tests/unittests/unittests.json b/src/tests/unittests/unittests.json index 3229906b..3549aa94 100644 --- a/src/tests/unittests/unittests.json +++ b/src/tests/unittests/unittests.json @@ -16,7 +16,7 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev1" + "cpl-core>=2022.6.17.dev4" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/src/tests/unittests_cli/unittests_cli.json b/src/tests/unittests_cli/unittests_cli.json index 44b9eb9f..be9b35a9 100644 --- a/src/tests/unittests_cli/unittests_cli.json +++ b/src/tests/unittests_cli/unittests_cli.json @@ -16,7 +16,7 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev1" + "cpl-core>=2022.6.17.dev4" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/src/tests/unittests_core/unittests_core.json b/src/tests/unittests_core/unittests_core.json index 33e28883..98e8b50d 100644 --- a/src/tests/unittests_core/unittests_core.json +++ b/src/tests/unittests_core/unittests_core.json @@ -16,7 +16,7 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev1" + "cpl-core>=2022.6.17.dev4" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/src/tests/unittests_query/unittests_query.json b/src/tests/unittests_query/unittests_query.json index ae2b1bd4..0b6a6597 100644 --- a/src/tests/unittests_query/unittests_query.json +++ b/src/tests/unittests_query/unittests_query.json @@ -16,7 +16,7 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev1" + "cpl-core>=2022.6.17.dev4" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/src/tests/unittests_shared/cli_commands.py b/src/tests/unittests_shared/cli_commands.py index 8903bf28..fd4af8ce 100644 --- a/src/tests/unittests_shared/cli_commands.py +++ b/src/tests/unittests_shared/cli_commands.py @@ -9,6 +9,7 @@ class CLICommands: @staticmethod def _run(cmd: str, *args): env_vars = os.environ + env_vars['CPL_IS_UNITTEST'] = 'YES' command = ['python', CLI_PATH, cmd] for arg in args: command.append(arg) diff --git a/src/tests/unittests_shared/unittests_shared.json b/src/tests/unittests_shared/unittests_shared.json index d1914479..babe5a4f 100644 --- a/src/tests/unittests_shared/unittests_shared.json +++ b/src/tests/unittests_shared/unittests_shared.json @@ -16,7 +16,7 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev1" + "cpl-core>=2022.6.17.dev4" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/tools/set_pip_urls/set-pip-urls.json b/tools/set_pip_urls/set-pip-urls.json index d35bf734..be77c6ed 100644 --- a/tools/set_pip_urls/set-pip-urls.json +++ b/tools/set_pip_urls/set-pip-urls.json @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17.dev1" + "cpl-core>=2022.6.17.dev4" ], "PythonVersion": ">=3.10.4", "PythonPath": {}, diff --git a/tools/set_version/set-version.json b/tools/set_version/set-version.json index fad80aad..e1498a4d 100644 --- a/tools/set_version/set-version.json +++ b/tools/set_version/set-version.json @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17.dev1" + "cpl-core>=2022.6.17.dev4" ], "PythonVersion": ">=3.10.4", "PythonPath": {}, From df32978a31437435e41d81b7bc3e53ec89ee738d Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 15:49:52 +0200 Subject: [PATCH 09/51] Moved unittests --- cpl-workspace.json | 10 ++++---- src/tests/__init__.py | 25 ------------------- .../tests => unittests}/unittests/__init__.py | 0 .../unittests/application.py | 0 {src/tests => unittests}/unittests/main.py | 0 .../unittests/unittests.json | 0 .../unittests_cli/__init__.py | 0 .../unittests_cli/add_test_case.py | 0 .../unittests_cli/build_test_case.py | 0 .../unittests_cli/cli_test_suite.py | 6 ++--- .../unittests_cli/constants.py | 2 +- .../unittests_cli/custom_test_case.py | 0 .../unittests_cli/generate_test_case.py | 0 .../unittests_cli/install_test_case.py | 0 .../unittests_cli/new_test_case.py | 0 .../unittests_cli/publish_test_case.py | 0 .../unittests_cli/remove_test_case.py | 0 .../unittests_cli/run_test_case.py | 0 .../unittests_cli/start_test_case.py | 0 .../unittests_cli/uninstall_test_case.py | 0 .../unittests_cli/unittests_cli.json | 0 .../unittests_cli/update_test_case.py | 0 .../unittests_cli/version_test_case.py | 0 .../unittests_core/__init__.py | 0 .../unittests_core/unittests_core.json | 0 .../unittests_query/__init__.py | 0 .../unittests_query/unittests_query.json | 0 .../unittests_shared/__init__.py | 0 .../unittests_shared/cli_commands.py | 0 .../unittests_shared/unittests_shared.json | 0 30 files changed, 9 insertions(+), 34 deletions(-) delete mode 100644 src/tests/__init__.py rename {src/tests => unittests}/unittests/__init__.py (100%) rename {src/tests => unittests}/unittests/application.py (100%) rename {src/tests => unittests}/unittests/main.py (100%) rename {src/tests => unittests}/unittests/unittests.json (100%) rename {src/tests => unittests}/unittests_cli/__init__.py (100%) rename {src/tests => unittests}/unittests_cli/add_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/build_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/cli_test_suite.py (92%) rename {src/tests => unittests}/unittests_cli/constants.py (56%) rename {src/tests => unittests}/unittests_cli/custom_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/generate_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/install_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/new_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/publish_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/remove_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/run_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/start_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/uninstall_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/unittests_cli.json (100%) rename {src/tests => unittests}/unittests_cli/update_test_case.py (100%) rename {src/tests => unittests}/unittests_cli/version_test_case.py (100%) rename {src/tests => unittests}/unittests_core/__init__.py (100%) rename {src/tests => unittests}/unittests_core/unittests_core.json (100%) rename {src/tests => unittests}/unittests_query/__init__.py (100%) rename {src/tests => unittests}/unittests_query/unittests_query.json (100%) rename {src/tests => unittests}/unittests_shared/__init__.py (100%) rename {src/tests => unittests}/unittests_shared/cli_commands.py (100%) rename {src/tests => unittests}/unittests_shared/unittests_shared.json (100%) diff --git a/cpl-workspace.json b/cpl-workspace.json index cf6608bf..8d2d7423 100644 --- a/cpl-workspace.json +++ b/cpl-workspace.json @@ -7,11 +7,11 @@ "cpl-query": "src/cpl_query/cpl-query.json", "set-version": "tools/set_version/set-version.json", "set-pip-urls": "tools/set_pip_urls/set-pip-urls.json", - "unittests": "src/tests/unittests/unittests.json", - "unittests_cli": "src/tests/unittests_cli/unittests_cli.json", - "unittests_core": "src/tests/unittests_core/unittests_core.json", - "unittests_query": "src/tests/unittests_query/unittests_query.json", - "unittests_shared": "src/tests/unittests_shared/unittests_shared.json" + "unittests": "unittests/unittests/unittests.json", + "unittests_cli": "unittests/unittests_cli/unittests_cli.json", + "unittests_core": "unittests/unittests_core/unittests_core.json", + "unittests_query": "unittests/unittests_query/unittests_query.json", + "unittests_shared": "unittests/unittests_shared/unittests_shared.json" }, "Scripts": { "hello-world": "echo 'Hello World'", diff --git a/src/tests/__init__.py b/src/tests/__init__.py deleted file mode 100644 index 71ee2167..00000000 --- a/src/tests/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -sh_cpl sh-edraft Common Python library -~~~~~~~~~~~~~~~~~~~ - -sh-edraft Common Python library - -:copyright: (c) 2020 - 2021 sh-edraft.de -:license: MIT, see LICENSE for more details. - -""" - -__title__ = 'sh_cpl.tests' -__author__ = 'Sven Heidemann' -__license__ = 'MIT' -__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de' -__version__ = '2021.4.1' - -from collections import namedtuple - -# imports: - -VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2021, minor=4, micro=1) diff --git a/src/tests/unittests/__init__.py b/unittests/unittests/__init__.py similarity index 100% rename from src/tests/unittests/__init__.py rename to unittests/unittests/__init__.py diff --git a/src/tests/unittests/application.py b/unittests/unittests/application.py similarity index 100% rename from src/tests/unittests/application.py rename to unittests/unittests/application.py diff --git a/src/tests/unittests/main.py b/unittests/unittests/main.py similarity index 100% rename from src/tests/unittests/main.py rename to unittests/unittests/main.py diff --git a/src/tests/unittests/unittests.json b/unittests/unittests/unittests.json similarity index 100% rename from src/tests/unittests/unittests.json rename to unittests/unittests/unittests.json diff --git a/src/tests/unittests_cli/__init__.py b/unittests/unittests_cli/__init__.py similarity index 100% rename from src/tests/unittests_cli/__init__.py rename to unittests/unittests_cli/__init__.py diff --git a/src/tests/unittests_cli/add_test_case.py b/unittests/unittests_cli/add_test_case.py similarity index 100% rename from src/tests/unittests_cli/add_test_case.py rename to unittests/unittests_cli/add_test_case.py diff --git a/src/tests/unittests_cli/build_test_case.py b/unittests/unittests_cli/build_test_case.py similarity index 100% rename from src/tests/unittests_cli/build_test_case.py rename to unittests/unittests_cli/build_test_case.py diff --git a/src/tests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py similarity index 92% rename from src/tests/unittests_cli/cli_test_suite.py rename to unittests/unittests_cli/cli_test_suite.py index 9532fe0c..06a30252 100644 --- a/src/tests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -46,9 +46,9 @@ class CLITestSuite(unittest.TestSuite): print(f'Setup {__name__}') try: if os.path.exists(PLAYGROUND_PATH): - shutil.rmtree(PLAYGROUND_PATH) + shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, '../'))) - os.mkdir(PLAYGROUND_PATH) + os.makedirs(PLAYGROUND_PATH) os.chdir(PLAYGROUND_PATH) except Exception as e: print(f'Setup of {__name__} failed: {traceback.format_exc()}') @@ -57,7 +57,7 @@ class CLITestSuite(unittest.TestSuite): print(f'Cleanup {__name__}') try: if os.path.exists(PLAYGROUND_PATH): - shutil.rmtree(PLAYGROUND_PATH) + shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, '../'))) except Exception as e: print(f'Cleanup of {__name__} failed: {traceback.format_exc()}') diff --git a/src/tests/unittests_cli/constants.py b/unittests/unittests_cli/constants.py similarity index 56% rename from src/tests/unittests_cli/constants.py rename to unittests/unittests_cli/constants.py index bcaa9d93..917dda78 100644 --- a/src/tests/unittests_cli/constants.py +++ b/unittests/unittests_cli/constants.py @@ -1,4 +1,4 @@ import os PLAYGROUND_PATH = os.path.abspath(os.path.join(os.getcwd(), '../generated/test_cli_playground')) -CLI_PATH = os.path.abspath(os.path.join(os.getcwd(), '../../cpl_cli/main.py')) +CLI_PATH = os.path.abspath(os.path.join(os.getcwd(), '../../src/cpl_cli/main.py')) diff --git a/src/tests/unittests_cli/custom_test_case.py b/unittests/unittests_cli/custom_test_case.py similarity index 100% rename from src/tests/unittests_cli/custom_test_case.py rename to unittests/unittests_cli/custom_test_case.py diff --git a/src/tests/unittests_cli/generate_test_case.py b/unittests/unittests_cli/generate_test_case.py similarity index 100% rename from src/tests/unittests_cli/generate_test_case.py rename to unittests/unittests_cli/generate_test_case.py diff --git a/src/tests/unittests_cli/install_test_case.py b/unittests/unittests_cli/install_test_case.py similarity index 100% rename from src/tests/unittests_cli/install_test_case.py rename to unittests/unittests_cli/install_test_case.py diff --git a/src/tests/unittests_cli/new_test_case.py b/unittests/unittests_cli/new_test_case.py similarity index 100% rename from src/tests/unittests_cli/new_test_case.py rename to unittests/unittests_cli/new_test_case.py diff --git a/src/tests/unittests_cli/publish_test_case.py b/unittests/unittests_cli/publish_test_case.py similarity index 100% rename from src/tests/unittests_cli/publish_test_case.py rename to unittests/unittests_cli/publish_test_case.py diff --git a/src/tests/unittests_cli/remove_test_case.py b/unittests/unittests_cli/remove_test_case.py similarity index 100% rename from src/tests/unittests_cli/remove_test_case.py rename to unittests/unittests_cli/remove_test_case.py diff --git a/src/tests/unittests_cli/run_test_case.py b/unittests/unittests_cli/run_test_case.py similarity index 100% rename from src/tests/unittests_cli/run_test_case.py rename to unittests/unittests_cli/run_test_case.py diff --git a/src/tests/unittests_cli/start_test_case.py b/unittests/unittests_cli/start_test_case.py similarity index 100% rename from src/tests/unittests_cli/start_test_case.py rename to unittests/unittests_cli/start_test_case.py diff --git a/src/tests/unittests_cli/uninstall_test_case.py b/unittests/unittests_cli/uninstall_test_case.py similarity index 100% rename from src/tests/unittests_cli/uninstall_test_case.py rename to unittests/unittests_cli/uninstall_test_case.py diff --git a/src/tests/unittests_cli/unittests_cli.json b/unittests/unittests_cli/unittests_cli.json similarity index 100% rename from src/tests/unittests_cli/unittests_cli.json rename to unittests/unittests_cli/unittests_cli.json diff --git a/src/tests/unittests_cli/update_test_case.py b/unittests/unittests_cli/update_test_case.py similarity index 100% rename from src/tests/unittests_cli/update_test_case.py rename to unittests/unittests_cli/update_test_case.py diff --git a/src/tests/unittests_cli/version_test_case.py b/unittests/unittests_cli/version_test_case.py similarity index 100% rename from src/tests/unittests_cli/version_test_case.py rename to unittests/unittests_cli/version_test_case.py diff --git a/src/tests/unittests_core/__init__.py b/unittests/unittests_core/__init__.py similarity index 100% rename from src/tests/unittests_core/__init__.py rename to unittests/unittests_core/__init__.py diff --git a/src/tests/unittests_core/unittests_core.json b/unittests/unittests_core/unittests_core.json similarity index 100% rename from src/tests/unittests_core/unittests_core.json rename to unittests/unittests_core/unittests_core.json diff --git a/src/tests/unittests_query/__init__.py b/unittests/unittests_query/__init__.py similarity index 100% rename from src/tests/unittests_query/__init__.py rename to unittests/unittests_query/__init__.py diff --git a/src/tests/unittests_query/unittests_query.json b/unittests/unittests_query/unittests_query.json similarity index 100% rename from src/tests/unittests_query/unittests_query.json rename to unittests/unittests_query/unittests_query.json diff --git a/src/tests/unittests_shared/__init__.py b/unittests/unittests_shared/__init__.py similarity index 100% rename from src/tests/unittests_shared/__init__.py rename to unittests/unittests_shared/__init__.py diff --git a/src/tests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py similarity index 100% rename from src/tests/unittests_shared/cli_commands.py rename to unittests/unittests_shared/cli_commands.py diff --git a/src/tests/unittests_shared/unittests_shared.json b/unittests/unittests_shared/unittests_shared.json similarity index 100% rename from src/tests/unittests_shared/unittests_shared.json rename to unittests/unittests_shared/unittests_shared.json From 8f8a9f7dd7b8e891c66b3f83faf20382d0e307d2 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 15:53:23 +0200 Subject: [PATCH 10/51] Moved query unittests --- src/cpl_query/tests/__init__.py | 0 src/cpl_query/tests/tester.py | 25 ------------------- unittests/unittests/application.py | 2 ++ .../unittests_query/iterable_test_case.py | 2 +- .../unittests_query}/models.py | 0 .../unittests_query/query_test_case.py | 4 +-- unittests/unittests_query/query_test_suite.py | 17 +++++++++++++ 7 files changed, 22 insertions(+), 28 deletions(-) delete mode 100644 src/cpl_query/tests/__init__.py delete mode 100644 src/cpl_query/tests/tester.py rename src/cpl_query/tests/iterable_test.py => unittests/unittests_query/iterable_test_case.py (91%) rename {src/cpl_query/tests => unittests/unittests_query}/models.py (100%) rename src/cpl_query/tests/query_test.py => unittests/unittests_query/query_test_case.py (99%) create mode 100644 unittests/unittests_query/query_test_suite.py diff --git a/src/cpl_query/tests/__init__.py b/src/cpl_query/tests/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/cpl_query/tests/tester.py b/src/cpl_query/tests/tester.py deleted file mode 100644 index 084071c3..00000000 --- a/src/cpl_query/tests/tester.py +++ /dev/null @@ -1,25 +0,0 @@ -import unittest - -from cpl_query.tests.iterable_test import IterableTest -from cpl_query.tests.query_test import QueryTest - - -class Tester: - - def __init__(self): - self._suite = unittest.TestSuite() - - def create(self): - loader = unittest.TestLoader() - self._suite.addTests(loader.loadTestsFromTestCase(QueryTest)) - self._suite.addTests(loader.loadTestsFromTestCase(IterableTest)) - - def start(self): - runner = unittest.TextTestRunner() - runner.run(self._suite) - - -if __name__ == '__main__': - tester = Tester() - tester.create() - tester.start() diff --git a/unittests/unittests/application.py b/unittests/unittests/application.py index 9af5ad57..9ec49cc6 100644 --- a/unittests/unittests/application.py +++ b/unittests/unittests/application.py @@ -4,6 +4,7 @@ from cpl_core.application import ApplicationABC from cpl_core.configuration import ConfigurationABC from cpl_core.dependency_injection import ServiceProviderABC from unittests_cli.cli_test_suite import CLITestSuite +from unittests_query.query_test_suite import QueryTestSuite class Application(ApplicationABC): @@ -17,3 +18,4 @@ class Application(ApplicationABC): def main(self): runner = unittest.TextTestRunner() runner.run(CLITestSuite()) + runner.run(QueryTestSuite()) diff --git a/src/cpl_query/tests/iterable_test.py b/unittests/unittests_query/iterable_test_case.py similarity index 91% rename from src/cpl_query/tests/iterable_test.py rename to unittests/unittests_query/iterable_test_case.py index a8936a88..2523f500 100644 --- a/src/cpl_query/tests/iterable_test.py +++ b/unittests/unittests_query/iterable_test_case.py @@ -3,7 +3,7 @@ import unittest from cpl_query.extension.list import List -class IterableTest(unittest.TestCase): +class IterableTestCase(unittest.TestCase): def setUp(self) -> None: self._list = List(int) diff --git a/src/cpl_query/tests/models.py b/unittests/unittests_query/models.py similarity index 100% rename from src/cpl_query/tests/models.py rename to unittests/unittests_query/models.py diff --git a/src/cpl_query/tests/query_test.py b/unittests/unittests_query/query_test_case.py similarity index 99% rename from src/cpl_query/tests/query_test.py rename to unittests/unittests_query/query_test_case.py index 9f1e48e2..00d4fed8 100644 --- a/src/cpl_query/tests/query_test.py +++ b/unittests/unittests_query/query_test_case.py @@ -5,10 +5,10 @@ from random import randint from cpl_core.utils import String from cpl_query.exceptions import InvalidTypeException, ArgumentNoneException from cpl_query.extension.list import List -from cpl_query.tests.models import User, Address +from unittests_query.models import User, Address -class QueryTest(unittest.TestCase): +class QueryTestCase(unittest.TestCase): def setUp(self) -> None: self._tests = List(User) diff --git a/unittests/unittests_query/query_test_suite.py b/unittests/unittests_query/query_test_suite.py new file mode 100644 index 00000000..35c3fe03 --- /dev/null +++ b/unittests/unittests_query/query_test_suite.py @@ -0,0 +1,17 @@ +import unittest + +from unittests_query.iterable_test_case import IterableTestCase +from unittests_query.query_test_case import QueryTestCase + + +class QueryTestSuite(unittest.TestSuite): + + def __init__(self): + unittest.TestSuite.__init__(self) + + loader = unittest.TestLoader() + self.addTests(loader.loadTestsFromTestCase(QueryTestCase)) + self.addTests(loader.loadTestsFromTestCase(IterableTestCase)) + + def run(self, *args): + super().run(*args) From b05ca7e980ed4cfb21c42670295e36205651ab7d Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 16:03:14 +0200 Subject: [PATCH 11/51] Set dev version --- src/cpl_query/cpl-query.json | 4 +--- tools/set_version/application.py | 2 +- unittests/unittests/unittests.json | 6 +++--- unittests/unittests_cli/unittests_cli.json | 9 +++++---- unittests/unittests_core/unittests_core.json | 6 +++--- unittests/unittests_query/unittests_query.json | 9 +++++---- unittests/unittests_shared/cli_commands.py | 1 - unittests/unittests_shared/unittests_shared.json | 6 +++--- 8 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/cpl_query/cpl-query.json b/src/cpl_query/cpl-query.json index e3d23065..ab3bf7f2 100644 --- a/src/cpl_query/cpl-query.json +++ b/src/cpl_query/cpl-query.json @@ -15,9 +15,7 @@ "CopyrightName": "sh-edraft.de", "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", - "Dependencies": [ - "cpl-core>=2022.6.17.dev4" - ], + "Dependencies": [], "PythonVersion": ">=3.10", "PythonPath": {}, "Classifiers": [] diff --git a/tools/set_version/application.py b/tools/set_version/application.py index 3ad1b23a..5acf6e50 100644 --- a/tools/set_version/application.py +++ b/tools/set_version/application.py @@ -57,7 +57,7 @@ class Application(ApplicationABC): for project in self._workspace.projects: Console.write_line(f'Set dependencies {self._version_pipe.transform(version)} for {project}') self._version_setter.set_dependencies(self._workspace.projects[project], version) - if not project.startswith('cpl'): + if not project.startswith('cpl') and not project.startswith('unittest'): continue Console.write_line(f'Set version {self._version_pipe.transform(version)} for {project}') diff --git a/unittests/unittests/unittests.json b/unittests/unittests/unittests.json index 3549aa94..2a05e376 100644 --- a/unittests/unittests/unittests.json +++ b/unittests/unittests/unittests.json @@ -2,9 +2,9 @@ "ProjectSettings": { "Name": "unittests", "Version": { - "Major": "0", - "Minor": "0", - "Micro": "0" + "Major": "2022", + "Minor": "6", + "Micro": "17.dev4" }, "Author": "", "AuthorEmail": "", diff --git a/unittests/unittests_cli/unittests_cli.json b/unittests/unittests_cli/unittests_cli.json index be9b35a9..156906ac 100644 --- a/unittests/unittests_cli/unittests_cli.json +++ b/unittests/unittests_cli/unittests_cli.json @@ -2,9 +2,9 @@ "ProjectSettings": { "Name": "unittest_cli", "Version": { - "Major": "0", - "Minor": "0", - "Micro": "0" + "Major": "2022", + "Minor": "6", + "Micro": "17.dev4" }, "Author": "", "AuthorEmail": "", @@ -16,7 +16,8 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev4" + "cpl-core>=2022.6.17.dev4", + "cpl-cli>=2022.6.17.dev4" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_core/unittests_core.json b/unittests/unittests_core/unittests_core.json index 98e8b50d..d137cff1 100644 --- a/unittests/unittests_core/unittests_core.json +++ b/unittests/unittests_core/unittests_core.json @@ -2,9 +2,9 @@ "ProjectSettings": { "Name": "unittest_core", "Version": { - "Major": "0", - "Minor": "0", - "Micro": "0" + "Major": "2022", + "Minor": "6", + "Micro": "17.dev4" }, "Author": "", "AuthorEmail": "", diff --git a/unittests/unittests_query/unittests_query.json b/unittests/unittests_query/unittests_query.json index 0b6a6597..5a6ac20c 100644 --- a/unittests/unittests_query/unittests_query.json +++ b/unittests/unittests_query/unittests_query.json @@ -2,9 +2,9 @@ "ProjectSettings": { "Name": "unittest_query", "Version": { - "Major": "0", - "Minor": "0", - "Micro": "0" + "Major": "2022", + "Minor": "6", + "Micro": "17.dev4" }, "Author": "", "AuthorEmail": "", @@ -16,7 +16,8 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev4" + "cpl-core>=2022.6.17.dev4", + "cpl-query>=2022.6.17.dev4" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index fd4af8ce..4577e8e0 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -14,7 +14,6 @@ class CLICommands: for arg in args: command.append(arg) - print(f'Running {command}') subprocess.run(command, env=env_vars) @classmethod diff --git a/unittests/unittests_shared/unittests_shared.json b/unittests/unittests_shared/unittests_shared.json index babe5a4f..a7fe4bbb 100644 --- a/unittests/unittests_shared/unittests_shared.json +++ b/unittests/unittests_shared/unittests_shared.json @@ -2,9 +2,9 @@ "ProjectSettings": { "Name": "unittest_shared", "Version": { - "Major": "0", - "Minor": "0", - "Micro": "0" + "Major": "2022", + "Minor": "6", + "Micro": "17.dev4" }, "Author": "", "AuthorEmail": "", From 9e0e85d646b7525e3944c88f1823cc2b5cb66940 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 16:06:56 +0200 Subject: [PATCH 12/51] Fixed install command --- src/cpl_cli/command/install_service.py | 3 ++- src/cpl_cli/cpl-cli.json | 4 ++-- src/cpl_core/cpl-core.json | 2 +- src/cpl_query/cpl-query.json | 2 +- tools/set_pip_urls/set-pip-urls.json | 2 +- tools/set_version/set-version.json | 2 +- unittests/unittests/unittests.json | 4 ++-- unittests/unittests_cli/unittests_cli.json | 6 +++--- unittests/unittests_core/unittests_core.json | 4 ++-- unittests/unittests_query/unittests_query.json | 6 +++--- unittests/unittests_shared/unittests_shared.json | 4 ++-- 11 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/cpl_cli/command/install_service.py b/src/cpl_cli/command/install_service.py index 688632a3..e53e8082 100644 --- a/src/cpl_cli/command/install_service.py +++ b/src/cpl_cli/command/install_service.py @@ -42,7 +42,7 @@ class InstallService(CommandABC): self._is_simulation = False self._is_virtual = False - self._project_file = f'{self._config.get_configuration("ProjectName")}.json' + self._project_file = f'{self._project_settings.name}.json' @property def help_message(self) -> str: @@ -178,6 +178,7 @@ class InstallService(CommandABC): BuildSettings.__name__: SettingsHelper.get_build_settings_dict(self._build_settings) } + Console.write_line(self._project_file) with open(os.path.join(self._env.working_directory, self._project_file), 'w') as project_file: project_file.write(json.dumps(config, indent=2)) project_file.close() diff --git a/src/cpl_cli/cpl-cli.json b/src/cpl_cli/cpl-cli.json index f703ce15..e43fa127 100644 --- a/src/cpl_cli/cpl-cli.json +++ b/src/cpl_cli/cpl-cli.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev4" + "Micro": "17.dev5" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17.dev4" + "cpl-core>=2022.6.17.dev5" ], "PythonVersion": ">=3.10", "PythonPath": {}, diff --git a/src/cpl_core/cpl-core.json b/src/cpl_core/cpl-core.json index 984d3554..7a8a6fbc 100644 --- a/src/cpl_core/cpl-core.json +++ b/src/cpl_core/cpl-core.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev4" + "Micro": "17.dev5" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", diff --git a/src/cpl_query/cpl-query.json b/src/cpl_query/cpl-query.json index ab3bf7f2..b4bb2e73 100644 --- a/src/cpl_query/cpl-query.json +++ b/src/cpl_query/cpl-query.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev4" + "Micro": "17.dev5" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", diff --git a/tools/set_pip_urls/set-pip-urls.json b/tools/set_pip_urls/set-pip-urls.json index be77c6ed..96156cfa 100644 --- a/tools/set_pip_urls/set-pip-urls.json +++ b/tools/set_pip_urls/set-pip-urls.json @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17.dev4" + "cpl-core>=2022.6.17.dev5" ], "PythonVersion": ">=3.10.4", "PythonPath": {}, diff --git a/tools/set_version/set-version.json b/tools/set_version/set-version.json index e1498a4d..3ee90398 100644 --- a/tools/set_version/set-version.json +++ b/tools/set_version/set-version.json @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17.dev4" + "cpl-core>=2022.6.17.dev5" ], "PythonVersion": ">=3.10.4", "PythonPath": {}, diff --git a/unittests/unittests/unittests.json b/unittests/unittests/unittests.json index 2a05e376..890f9782 100644 --- a/unittests/unittests/unittests.json +++ b/unittests/unittests/unittests.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev4" + "Micro": "17.dev5" }, "Author": "", "AuthorEmail": "", @@ -16,7 +16,7 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev4" + "cpl-core>=2022.6.17.dev5" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_cli/unittests_cli.json b/unittests/unittests_cli/unittests_cli.json index 156906ac..df178f97 100644 --- a/unittests/unittests_cli/unittests_cli.json +++ b/unittests/unittests_cli/unittests_cli.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev4" + "Micro": "17.dev5" }, "Author": "", "AuthorEmail": "", @@ -16,8 +16,8 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev4", - "cpl-cli>=2022.6.17.dev4" + "cpl-core>=2022.6.17.dev5", + "cpl-cli>=2022.6.17.dev5" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_core/unittests_core.json b/unittests/unittests_core/unittests_core.json index d137cff1..176f837a 100644 --- a/unittests/unittests_core/unittests_core.json +++ b/unittests/unittests_core/unittests_core.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev4" + "Micro": "17.dev5" }, "Author": "", "AuthorEmail": "", @@ -16,7 +16,7 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev4" + "cpl-core>=2022.6.17.dev5" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_query/unittests_query.json b/unittests/unittests_query/unittests_query.json index 5a6ac20c..81421fe8 100644 --- a/unittests/unittests_query/unittests_query.json +++ b/unittests/unittests_query/unittests_query.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev4" + "Micro": "17.dev5" }, "Author": "", "AuthorEmail": "", @@ -16,8 +16,8 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev4", - "cpl-query>=2022.6.17.dev4" + "cpl-core>=2022.6.17.dev5", + "cpl-query>=2022.6.17.dev5" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_shared/unittests_shared.json b/unittests/unittests_shared/unittests_shared.json index a7fe4bbb..76f369a2 100644 --- a/unittests/unittests_shared/unittests_shared.json +++ b/unittests/unittests_shared/unittests_shared.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev4" + "Micro": "17.dev5" }, "Author": "", "AuthorEmail": "", @@ -16,7 +16,7 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev4" + "cpl-core>=2022.6.17.dev5" ], "PythonVersion": ">=3.10.4", "PythonPath": { From ddff9dec11a92871cc95a4d6a0829055cbadd9bc Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 16:08:37 +0200 Subject: [PATCH 13/51] Fixed install command --- 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/generate/__init__.py | 4 ++-- src/cpl_cli/_templates/new/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/source/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/source/name/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/source/tests/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/source/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/source/name/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/source/tests/__init__.py | 4 ++-- src/cpl_cli/_templates/new/unittest/__init__.py | 4 ++-- src/cpl_cli/_templates/new/unittest/source/__init__.py | 4 ++-- src/cpl_cli/_templates/new/unittest/source/name/__init__.py | 4 ++-- src/cpl_cli/_templates/publish/__init__.py | 4 ++-- src/cpl_cli/command/__init__.py | 4 ++-- src/cpl_cli/command/install_service.py | 1 - src/cpl_cli/configuration/__init__.py | 4 ++-- src/cpl_cli/live_server/__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 ++-- src/cpl_core/__init__.py | 4 ++-- src/cpl_core/application/__init__.py | 4 ++-- src/cpl_core/configuration/__init__.py | 4 ++-- src/cpl_core/console/__init__.py | 4 ++-- src/cpl_core/database/__init__.py | 4 ++-- src/cpl_core/database/connection/__init__.py | 4 ++-- src/cpl_core/database/context/__init__.py | 4 ++-- src/cpl_core/dependency_injection/__init__.py | 4 ++-- src/cpl_core/environment/__init__.py | 4 ++-- src/cpl_core/logging/__init__.py | 4 ++-- src/cpl_core/mailing/__init__.py | 4 ++-- src/cpl_core/pipes/__init__.py | 4 ++-- src/cpl_core/time/__init__.py | 4 ++-- src/cpl_core/utils/__init__.py | 4 ++-- src/cpl_query/__init__.py | 4 ++-- src/cpl_query/_query/__init__.py | 4 ++-- src/cpl_query/extension/__init__.py | 4 ++-- tools/set_version/set-version.json | 3 ++- 42 files changed, 82 insertions(+), 82 deletions(-) diff --git a/src/cpl_cli/__init__.py b/src/cpl_cli/__init__.py index 4453a344..7e4adf48 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple @@ -27,4 +27,4 @@ from .main import main from .startup import Startup VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/_templates/__init__.py b/src/cpl_cli/_templates/__init__.py index 9114e571..2085ae73 100644 --- a/src/cpl_cli/_templates/__init__.py +++ b/src/cpl_cli/_templates/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/_templates/build/__init__.py b/src/cpl_cli/_templates/build/__init__.py index 5a37043e..4c1a359a 100644 --- a/src/cpl_cli/_templates/build/__init__.py +++ b/src/cpl_cli/_templates/build/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.build' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/_templates/generate/__init__.py b/src/cpl_cli/_templates/generate/__init__.py index a41e4be1..08102786 100644 --- a/src/cpl_cli/_templates/generate/__init__.py +++ b/src/cpl_cli/_templates/generate/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.generate' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/_templates/new/__init__.py b/src/cpl_cli/_templates/new/__init__.py index 2f826888..2e4b01da 100644 --- a/src/cpl_cli/_templates/new/__init__.py +++ b/src/cpl_cli/_templates/new/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/_templates/new/console/__init__.py b/src/cpl_cli/_templates/new/console/__init__.py index 639774f0..4aa53bba 100644 --- a/src/cpl_cli/_templates/new/console/__init__.py +++ b/src/cpl_cli/_templates/new/console/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/_templates/new/console/source/__init__.py b/src/cpl_cli/_templates/new/console/source/__init__.py index 3d59f643..034bfe62 100644 --- a/src/cpl_cli/_templates/new/console/source/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/_templates/new/console/source/name/__init__.py b/src/cpl_cli/_templates/new/console/source/name/__init__.py index f3d64b65..089cd9a6 100644 --- a/src/cpl_cli/_templates/new/console/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/_templates/new/console/source/tests/__init__.py b/src/cpl_cli/_templates/new/console/source/tests/__init__.py index f19d8cb1..9f962d4c 100644 --- a/src/cpl_cli/_templates/new/console/source/tests/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/tests/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/_templates/new/library/__init__.py b/src/cpl_cli/_templates/new/library/__init__.py index ad2fb302..8a798796 100644 --- a/src/cpl_cli/_templates/new/library/__init__.py +++ b/src/cpl_cli/_templates/new/library/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/_templates/new/library/source/__init__.py b/src/cpl_cli/_templates/new/library/source/__init__.py index 881aa9eb..1bac84f9 100644 --- a/src/cpl_cli/_templates/new/library/source/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/_templates/new/library/source/name/__init__.py b/src/cpl_cli/_templates/new/library/source/name/__init__.py index 78dde8dd..8a452402 100644 --- a/src/cpl_cli/_templates/new/library/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/_templates/new/library/source/tests/__init__.py b/src/cpl_cli/_templates/new/library/source/tests/__init__.py index 83dcfa8e..12786bca 100644 --- a/src/cpl_cli/_templates/new/library/source/tests/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/tests/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/_templates/new/unittest/__init__.py b/src/cpl_cli/_templates/new/unittest/__init__.py index 45a18338..e9df9410 100644 --- a/src/cpl_cli/_templates/new/unittest/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/_templates/new/unittest/source/__init__.py b/src/cpl_cli/_templates/new/unittest/source/__init__.py index 7a0fa976..90228071 100644 --- a/src/cpl_cli/_templates/new/unittest/source/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/_templates/new/unittest/source/name/__init__.py b/src/cpl_cli/_templates/new/unittest/source/name/__init__.py index f574f941..2470cbf3 100644 --- a/src/cpl_cli/_templates/new/unittest/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/_templates/publish/__init__.py b/src/cpl_cli/_templates/publish/__init__.py index ea19fe0b..9cb1d1aa 100644 --- a/src/cpl_cli/_templates/publish/__init__.py +++ b/src/cpl_cli/_templates/publish/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.publish' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/command/__init__.py b/src/cpl_cli/command/__init__.py index 832f98dd..05f1b18f 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' 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='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/command/install_service.py b/src/cpl_cli/command/install_service.py index e53e8082..d4342988 100644 --- a/src/cpl_cli/command/install_service.py +++ b/src/cpl_cli/command/install_service.py @@ -178,7 +178,6 @@ class InstallService(CommandABC): BuildSettings.__name__: SettingsHelper.get_build_settings_dict(self._build_settings) } - Console.write_line(self._project_file) with open(os.path.join(self._env.working_directory, self._project_file), 'w') as project_file: project_file.write(json.dumps(config, indent=2)) project_file.close() diff --git a/src/cpl_cli/configuration/__init__.py b/src/cpl_cli/configuration/__init__.py index 1c91e504..bbd53400 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple @@ -30,4 +30,4 @@ from .workspace_settings import WorkspaceSettings from .workspace_settings_name_enum import WorkspaceSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/live_server/__init__.py b/src/cpl_cli/live_server/__init__.py index 1ffe1b09..6094ed35 100644 --- a/src/cpl_cli/live_server/__init__.py +++ b/src/cpl_cli/live_server/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.live_server' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/publish/__init__.py b/src/cpl_cli/publish/__init__.py index 4dc0d603..27f9d1cf 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple @@ -24,4 +24,4 @@ from .publisher_abc import PublisherABC from .publisher_service import PublisherService VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/source_creator/__init__.py b/src/cpl_cli/source_creator/__init__.py index 812c7731..bc77e307 100644 --- a/src/cpl_cli/source_creator/__init__.py +++ b/src/cpl_cli/source_creator/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.source_creator' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_cli/validators/__init__.py b/src/cpl_cli/validators/__init__.py index 29cb394b..7fae4a43 100644 --- a/src/cpl_cli/validators/__init__.py +++ b/src/cpl_cli/validators/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.validators' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_core/__init__.py b/src/cpl_core/__init__.py index a8ab174f..fa5c4b17 100644 --- a/src/cpl_core/__init__.py +++ b/src/cpl_core/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_core' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_core/application/__init__.py b/src/cpl_core/application/__init__.py index fed05ec0..935bf9e8 100644 --- a/src/cpl_core/application/__init__.py +++ b/src/cpl_core/application/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.application' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple @@ -28,4 +28,4 @@ from .startup_abc import StartupABC from .startup_extension_abc import StartupExtensionABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_core/configuration/__init__.py b/src/cpl_core/configuration/__init__.py index f317fa21..b6500994 100644 --- a/src/cpl_core/configuration/__init__.py +++ b/src/cpl_core/configuration/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.configuration' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple @@ -34,4 +34,4 @@ from .validator_abc import ValidatorABC from .variable_argument import VariableArgument VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_core/console/__init__.py b/src/cpl_core/console/__init__.py index f255ae1c..bc1476a9 100644 --- a/src/cpl_core/console/__init__.py +++ b/src/cpl_core/console/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.console' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple @@ -27,4 +27,4 @@ from .foreground_color_enum import ForegroundColorEnum from .spinner_thread import SpinnerThread VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_core/database/__init__.py b/src/cpl_core/database/__init__.py index ed634d68..d5ff0988 100644 --- a/src/cpl_core/database/__init__.py +++ b/src/cpl_core/database/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple @@ -25,4 +25,4 @@ from .database_settings import DatabaseSettings from .table_abc import TableABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_core/database/connection/__init__.py b/src/cpl_core/database/connection/__init__.py index 03ecf658..1f0b2b73 100644 --- a/src/cpl_core/database/connection/__init__.py +++ b/src/cpl_core/database/connection/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database.connection' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple @@ -24,4 +24,4 @@ from .database_connection import DatabaseConnection from .database_connection_abc import DatabaseConnectionABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_core/database/context/__init__.py b/src/cpl_core/database/context/__init__.py index 30c24743..2906617e 100644 --- a/src/cpl_core/database/context/__init__.py +++ b/src/cpl_core/database/context/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database.context' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple @@ -24,4 +24,4 @@ from .database_context import DatabaseContext from .database_context_abc import DatabaseContextABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_core/dependency_injection/__init__.py b/src/cpl_core/dependency_injection/__init__.py index b03e27c4..e12cb685 100644 --- a/src/cpl_core/dependency_injection/__init__.py +++ b/src/cpl_core/dependency_injection/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.dependency_injection' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple @@ -30,4 +30,4 @@ from .service_provider import ServiceProvider from .service_provider_abc import ServiceProviderABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_core/environment/__init__.py b/src/cpl_core/environment/__init__.py index 5194a6e1..e7acb259 100644 --- a/src/cpl_core/environment/__init__.py +++ b/src/cpl_core/environment/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.environment' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple @@ -25,4 +25,4 @@ from .environment_name_enum import EnvironmentNameEnum from .application_environment import ApplicationEnvironment VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_core/logging/__init__.py b/src/cpl_core/logging/__init__.py index 7a040367..02da5f23 100644 --- a/src/cpl_core/logging/__init__.py +++ b/src/cpl_core/logging/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.logging' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple @@ -27,4 +27,4 @@ from .logging_settings import LoggingSettings from .logging_settings_name_enum import LoggingSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_core/mailing/__init__.py b/src/cpl_core/mailing/__init__.py index f2b7dc73..59c458a1 100644 --- a/src/cpl_core/mailing/__init__.py +++ b/src/cpl_core/mailing/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.mailing' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple @@ -27,4 +27,4 @@ from .email_client_settings import EMailClientSettings from .email_client_settings_name_enum import EMailClientSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_core/pipes/__init__.py b/src/cpl_core/pipes/__init__.py index 89a8e972..23a253e4 100644 --- a/src/cpl_core/pipes/__init__.py +++ b/src/cpl_core/pipes/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.pipes' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple @@ -29,4 +29,4 @@ from .to_camel_case_pipe import ToCamelCasePipe from .to_snake_case_pipe import ToSnakeCasePipe VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_core/time/__init__.py b/src/cpl_core/time/__init__.py index 2800356a..150b1172 100644 --- a/src/cpl_core/time/__init__.py +++ b/src/cpl_core/time/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.time' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple @@ -24,4 +24,4 @@ from .time_format_settings import TimeFormatSettings from .time_format_settings_names_enum import TimeFormatSettingsNamesEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_core/utils/__init__.py b/src/cpl_core/utils/__init__.py index 78050380..c540adf6 100644 --- a/src/cpl_core/utils/__init__.py +++ b/src/cpl_core/utils/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.utils' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple @@ -25,4 +25,4 @@ from .string import String from .pip import Pip VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_query/__init__.py b/src/cpl_query/__init__.py index 7311ca67..8bfc996f 100644 --- a/src/cpl_query/__init__.py +++ b/src/cpl_query/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_query' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_query/_query/__init__.py b/src/cpl_query/_query/__init__.py index 19c9ce97..60a7f996 100644 --- a/src/cpl_query/_query/__init__.py +++ b/src/cpl_query/_query/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_query._query' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/src/cpl_query/extension/__init__.py b/src/cpl_query/extension/__init__.py index e63bccea..be7474ec 100644 --- a/src/cpl_query/extension/__init__.py +++ b/src/cpl_query/extension/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_query.extension' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev4' +__version__ = '2022.6.17.dev5' from collections import namedtuple @@ -27,4 +27,4 @@ from .ordered_iterable_abc import OrderedIterableABC from .ordered_iterable import OrderedIterable VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') diff --git a/tools/set_version/set-version.json b/tools/set_version/set-version.json index 3ee90398..2c076df7 100644 --- a/tools/set_version/set-version.json +++ b/tools/set_version/set-version.json @@ -16,7 +16,8 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17.dev5" + "cpl-core>=2022.6.17.dev5", + "gitpython==3.1.27" ], "PythonVersion": ">=3.10.4", "PythonPath": {}, From def92c78c8bb7688c44c943bf8cd6d305236559a Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 16:25:15 +0200 Subject: [PATCH 14/51] Added logic to change version only for projects with changes --- src/cpl_cli/cpl-cli.json | 4 ++-- src/cpl_core/cpl-core.json | 2 +- src/cpl_query/cpl-query.json | 2 +- tools/set_pip_urls/set-pip-urls.json | 2 +- tools/set_version/application.py | 9 +++++++++ tools/set_version/git_service.py | 13 ++++++------- tools/set_version/set-version.json | 2 +- tools/set_version/startup.py | 2 +- unittests/unittests/unittests.json | 4 ++-- unittests/unittests_cli/unittests_cli.json | 6 +++--- unittests/unittests_core/unittests_core.json | 4 ++-- unittests/unittests_query/unittests_query.json | 6 +++--- unittests/unittests_shared/unittests_shared.json | 4 ++-- 13 files changed, 34 insertions(+), 26 deletions(-) diff --git a/src/cpl_cli/cpl-cli.json b/src/cpl_cli/cpl-cli.json index e43fa127..b5a709e3 100644 --- a/src/cpl_cli/cpl-cli.json +++ b/src/cpl_cli/cpl-cli.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev5" + "Micro": "17" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17.dev5" + "cpl-core>=2022.6.17" ], "PythonVersion": ">=3.10", "PythonPath": {}, diff --git a/src/cpl_core/cpl-core.json b/src/cpl_core/cpl-core.json index 7a8a6fbc..7ac905aa 100644 --- a/src/cpl_core/cpl-core.json +++ b/src/cpl_core/cpl-core.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev5" + "Micro": "17" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", diff --git a/src/cpl_query/cpl-query.json b/src/cpl_query/cpl-query.json index b4bb2e73..876fc3f2 100644 --- a/src/cpl_query/cpl-query.json +++ b/src/cpl_query/cpl-query.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev5" + "Micro": "17" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", diff --git a/tools/set_pip_urls/set-pip-urls.json b/tools/set_pip_urls/set-pip-urls.json index 96156cfa..a3c936e3 100644 --- a/tools/set_pip_urls/set-pip-urls.json +++ b/tools/set_pip_urls/set-pip-urls.json @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17.dev5" + "cpl-core>=2022.6.17" ], "PythonVersion": ">=3.10.4", "PythonPath": {}, diff --git a/tools/set_version/application.py b/tools/set_version/application.py index 5acf6e50..0f139550 100644 --- a/tools/set_version/application.py +++ b/tools/set_version/application.py @@ -1,3 +1,4 @@ +import os import traceback from cpl_cli.configuration.version_settings_name_enum import VersionSettingsNameEnum @@ -27,6 +28,7 @@ class Application(ApplicationABC): def main(self): Console.write_line('Set versions:') + args = self._configuration.additional_arguments version = {} branch = "" @@ -53,8 +55,15 @@ class Application(ApplicationABC): Console.error(f'Branch {branch} does not contain valid version') return + diff_paths = [] + for file in self._git_service.get_diff_files(): + diff_paths.append(os.path.basename(os.path.dirname(file))) + try: for project in self._workspace.projects: + if project not in diff_paths: + continue + Console.write_line(f'Set dependencies {self._version_pipe.transform(version)} for {project}') self._version_setter.set_dependencies(self._workspace.projects[project], version) if not project.startswith('cpl') and not project.startswith('unittest'): diff --git a/tools/set_version/git_service.py b/tools/set_version/git_service.py index 263cde5b..0e43b226 100644 --- a/tools/set_version/git_service.py +++ b/tools/set_version/git_service.py @@ -1,4 +1,4 @@ -import os +from git import Repo, DiffIndex from cpl_core.environment import ApplicationEnvironmentABC @@ -7,12 +7,11 @@ class GitService: def __init__(self, env: ApplicationEnvironmentABC): self._env = env + self._repo = Repo(env.working_directory) def get_active_branch_name(self) -> str: - head_dir = os.path.join(self._env.working_directory, '.git/HEAD') - with open(head_dir, 'r') as f: - content = f.read().splitlines() + branch = self._repo.active_branch + return branch.name - for line in content: - if line[0:4] == "ref:": - return line.partition("refs/heads/")[2] + def get_diff_files(self) -> list[str]: + return [item.a_path for item in self._repo.index.diff(None)] diff --git a/tools/set_version/set-version.json b/tools/set_version/set-version.json index 2c076df7..ae872c29 100644 --- a/tools/set_version/set-version.json +++ b/tools/set_version/set-version.json @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17.dev5", + "cpl-core>=2022.6.17", "gitpython==3.1.27" ], "PythonVersion": ">=3.10.4", diff --git a/tools/set_version/startup.py b/tools/set_version/startup.py index 31c8a268..609ef337 100644 --- a/tools/set_version/startup.py +++ b/tools/set_version/startup.py @@ -25,7 +25,7 @@ class Startup(StartupABC): def configure_services(self, services: ServiceCollectionABC, environment: ApplicationEnvironment) -> ServiceProviderABC: services.add_pipes() - services.add_transient(GitService) + services.add_singleton(GitService) services.add_transient(VersionSetterService) return services.build_service_provider() diff --git a/unittests/unittests/unittests.json b/unittests/unittests/unittests.json index 890f9782..be802510 100644 --- a/unittests/unittests/unittests.json +++ b/unittests/unittests/unittests.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev5" + "Micro": "17.dev6" }, "Author": "", "AuthorEmail": "", @@ -16,7 +16,7 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev5" + "cpl-core>=2022.6.17.dev6" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_cli/unittests_cli.json b/unittests/unittests_cli/unittests_cli.json index df178f97..bd09248a 100644 --- a/unittests/unittests_cli/unittests_cli.json +++ b/unittests/unittests_cli/unittests_cli.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev5" + "Micro": "17.dev6" }, "Author": "", "AuthorEmail": "", @@ -16,8 +16,8 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev5", - "cpl-cli>=2022.6.17.dev5" + "cpl-core>=2022.6.17.dev6", + "cpl-cli>=2022.6.17.dev6" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_core/unittests_core.json b/unittests/unittests_core/unittests_core.json index 176f837a..fdf7b69a 100644 --- a/unittests/unittests_core/unittests_core.json +++ b/unittests/unittests_core/unittests_core.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev5" + "Micro": "17.dev6" }, "Author": "", "AuthorEmail": "", @@ -16,7 +16,7 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev5" + "cpl-core>=2022.6.17.dev6" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_query/unittests_query.json b/unittests/unittests_query/unittests_query.json index 81421fe8..326c72d1 100644 --- a/unittests/unittests_query/unittests_query.json +++ b/unittests/unittests_query/unittests_query.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev5" + "Micro": "17.dev6" }, "Author": "", "AuthorEmail": "", @@ -16,8 +16,8 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev5", - "cpl-query>=2022.6.17.dev5" + "cpl-core>=2022.6.17.dev6", + "cpl-query>=2022.6.17.dev6" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_shared/unittests_shared.json b/unittests/unittests_shared/unittests_shared.json index 76f369a2..cab18497 100644 --- a/unittests/unittests_shared/unittests_shared.json +++ b/unittests/unittests_shared/unittests_shared.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev5" + "Micro": "17.dev6" }, "Author": "", "AuthorEmail": "", @@ -16,7 +16,7 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev5" + "cpl-core>=2022.6.17.dev6" ], "PythonVersion": ">=3.10.4", "PythonPath": { From c28f551682a66fca5b20afd446ab13b4721b42f4 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 16:26:55 +0200 Subject: [PATCH 15/51] Added skip message to set-version --- tools/set_version/application.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/set_version/application.py b/tools/set_version/application.py index 0f139550..0b8b19ec 100644 --- a/tools/set_version/application.py +++ b/tools/set_version/application.py @@ -62,11 +62,13 @@ class Application(ApplicationABC): try: for project in self._workspace.projects: if project not in diff_paths: + Console.write_line(f'Skipping {project} due to missing changes') continue Console.write_line(f'Set dependencies {self._version_pipe.transform(version)} for {project}') self._version_setter.set_dependencies(self._workspace.projects[project], version) if not project.startswith('cpl') and not project.startswith('unittest'): + Console.write_line(f'Skipping {project}') continue Console.write_line(f'Set version {self._version_pipe.transform(version)} for {project}') From 6c1d7a3b29476575798280185d3ae1eb3311f18e Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 16:29:07 +0200 Subject: [PATCH 16/51] Removed prints from CLITestSuite --- unittests/unittests_cli/cli_test_suite.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/unittests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py index 06a30252..bb53effd 100644 --- a/unittests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -43,7 +43,6 @@ class CLITestSuite(unittest.TestSuite): self.addTests(loader.loadTestsFromTestCase(RemoveTestCase)) def _setup(self): - print(f'Setup {__name__}') try: if os.path.exists(PLAYGROUND_PATH): shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, '../'))) @@ -54,7 +53,6 @@ class CLITestSuite(unittest.TestSuite): print(f'Setup of {__name__} failed: {traceback.format_exc()}') def _cleanup(self): - print(f'Cleanup {__name__}') try: if os.path.exists(PLAYGROUND_PATH): shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, '../'))) From 15d938b172e3de1fc7ad23e8d3bbd7585b5e68cd Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 21:01:41 +0200 Subject: [PATCH 17/51] Fixed handing of unregistered console arguments --- src/cpl_core/configuration/configuration.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/cpl_core/configuration/configuration.py b/src/cpl_core/configuration/configuration.py index 9b344ace..6ea17122 100644 --- a/src/cpl_core/configuration/configuration.py +++ b/src/cpl_core/configuration/configuration.py @@ -215,16 +215,11 @@ class Configuration(ConfigurationABC): # flags elif isinstance(arg, FlagArgument): - if arg_str.startswith(arg.token) \ - and arg_str_without_token == arg.name or arg_str_without_token in arg.aliases: + if arg_str.startswith(arg.token) and arg_str_without_token == arg.name or arg_str_without_token in arg.aliases: self._additional_arguments.append(arg.name) self._handled_args.append(arg_str) self._parse_arguments(executables, arg_list[i + 1:], arg.console_arguments) - # add left over values to args - if arg_str not in self._additional_arguments and arg_str not in self._handled_args: - self._additional_arguments.append(arg_str) - def add_environment_variables(self, prefix: str): for env_var in os.environ.keys(): if not env_var.startswith(prefix): @@ -310,6 +305,10 @@ class Configuration(ConfigurationABC): arg_list = sys.argv[1:] executables: list[ExecutableArgument] = [] self._parse_arguments(executables, arg_list, self._argument_types) + for arg_str in arg_list: + # add left over values to args + if arg_str not in self._additional_arguments and arg_str not in self._handled_args: + self._additional_arguments.append(arg_str) except Exception as e: Console.error('An error occurred while parsing arguments.') sys.exit() From d23ea86ccfe5b418ef2d4a32276f6cfb61afd415 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 21:18:57 +0200 Subject: [PATCH 18/51] Added logic to answer questions of new command dialog by flag arguments --- src/cpl_cli/command/new_service.py | 46 +++++++++++++++-------- src/cpl_cli/startup_argument_extension.py | 6 ++- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/src/cpl_cli/command/new_service.py b/src/cpl_cli/command/new_service.py index 0f6ccac5..f8b5781e 100644 --- a/src/cpl_cli/command/new_service.py +++ b/src/cpl_cli/command/new_service.py @@ -169,22 +169,22 @@ class NewService(CommandABC): Gets project information's from user :return: """ - if not is_unittest: - result = Console.read('Do you want to use application base? (y/n) ') - if result.lower() == 'y': - self._use_application_api = True + if self._use_application_api or self._use_startup or self._use_service_providing or self._use_async: + Console.set_foreground_color(ForegroundColorEnum.default) + Console.write_line('Skipping question due to given flags') + return - result = Console.read('Do you want to use startup? (y/n) ') - if result.lower() == 'y': - self._use_startup = True - else: - result = Console.read('Do you want to use service providing? (y/n) ') - if result.lower() == 'y': - self._use_service_providing = True - - result = Console.read('Do you want to use async? (y/n) ') - if result.lower() == 'y': - self._use_async = True + if not is_unittest: + self._use_application_api = Console.read('Do you want to use application base? (y/n) ').lower() == 'y' + + if not is_unittest and self._use_application_api: + self._use_startup = Console.read('Do you want to use startup? (y/n) ').lower() == 'y' + + if not is_unittest and not self._use_application_api: + self._use_service_providing = Console.read('Do you want to use service providing? (y/n) ').lower() == 'y' + + if not self._use_async: + self._use_async = Console.read('Do you want to use async? (y/n) ').lower() == 'y' Console.set_foreground_color(ForegroundColorEnum.default) @@ -276,6 +276,22 @@ class NewService(CommandABC): :param args: :return: """ + if 'async' in args: + self._use_async = True + args.remove('async') + + if 'application-base' in args: + self._use_application_api = True + args.remove('application-base') + + if 'startup' in args: + self._use_startup = True + args.remove('startup') + + if 'service-providing' in args: + self._use_service_providing = True + args.remove('service-providing') + console = self._config.get_configuration(ProjectTypeEnum.console.value) library = self._config.get_configuration(ProjectTypeEnum.library.value) unittest = self._config.get_configuration(ProjectTypeEnum.unittest.value) diff --git a/src/cpl_cli/startup_argument_extension.py b/src/cpl_cli/startup_argument_extension.py index 92287027..64710b11 100644 --- a/src/cpl_cli/startup_argument_extension.py +++ b/src/cpl_cli/startup_argument_extension.py @@ -86,7 +86,11 @@ class StartupArgumentExtension(StartupExtensionABC): config.create_console_argument(ArgumentTypeEnum.Executable, '', 'new', ['n', 'N'], NewService, True) \ .add_console_argument(ArgumentTypeEnum.Variable, '', 'console', ['c', 'C'], ' ') \ .add_console_argument(ArgumentTypeEnum.Variable, '', 'library', ['l', 'L'], ' ') \ - .add_console_argument(ArgumentTypeEnum.Variable, '', 'unittest', ['ut', 'UT'], ' ') + .add_console_argument(ArgumentTypeEnum.Variable, '', 'unittest', ['ut', 'UT'], ' ') \ + .add_console_argument(ArgumentTypeEnum.Flag, '--', 'async', ['a', 'A']) \ + .add_console_argument(ArgumentTypeEnum.Flag, '--', 'application-base', ['ab', 'AB']) \ + .add_console_argument(ArgumentTypeEnum.Flag, '--', 'startup', ['s', 'S']) \ + .add_console_argument(ArgumentTypeEnum.Flag, '--', 'service-providing', ['sp', 'SP']) config.create_console_argument(ArgumentTypeEnum.Executable, '', 'publish', ['p', 'P'], PublishService, True, validators=[ProjectValidator]) config.create_console_argument(ArgumentTypeEnum.Executable, '', 'remove', ['r', 'R'], RemoveService, True, validators=[WorkspaceValidator]) \ .add_console_argument(ArgumentTypeEnum.Flag, '--', 'simulate', ['s', 'S']) From d0b0f4bfcb7073d57e2b9e7f36a2e23077343adc Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 21:41:42 +0200 Subject: [PATCH 19/51] Fixed set-version --- tools/set_version/application.py | 4 +++- tools/set_version/set-version.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/set_version/application.py b/tools/set_version/application.py index 0b8b19ec..83ea7b63 100644 --- a/tools/set_version/application.py +++ b/tools/set_version/application.py @@ -1,6 +1,8 @@ import os import traceback +from cpl_core.utils import String + from cpl_cli.configuration.version_settings_name_enum import VersionSettingsNameEnum from cpl_cli.configuration.workspace_settings import WorkspaceSettings from cpl_core.application.application_abc import ApplicationABC @@ -61,7 +63,7 @@ class Application(ApplicationABC): try: for project in self._workspace.projects: - if project not in diff_paths: + if project not in diff_paths and String.convert_to_snake_case(project) not in diff_paths: Console.write_line(f'Skipping {project} due to missing changes') continue diff --git a/tools/set_version/set-version.json b/tools/set_version/set-version.json index ae872c29..da0b3d1d 100644 --- a/tools/set_version/set-version.json +++ b/tools/set_version/set-version.json @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17", + "cpl-core>=2022.6.17.dev6", "gitpython==3.1.27" ], "PythonVersion": ">=3.10.4", From 698f80adfe271ce948bdd32c6f75960b22bc3c4b Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 21:42:28 +0200 Subject: [PATCH 20/51] Build dev6 --- 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/generate/__init__.py | 4 ++-- src/cpl_cli/_templates/new/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/source/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/source/name/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/source/tests/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/source/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/source/name/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/source/tests/__init__.py | 4 ++-- src/cpl_cli/_templates/new/unittest/__init__.py | 4 ++-- src/cpl_cli/_templates/new/unittest/source/__init__.py | 4 ++-- src/cpl_cli/_templates/new/unittest/source/name/__init__.py | 4 ++-- src/cpl_cli/_templates/publish/__init__.py | 4 ++-- src/cpl_cli/command/__init__.py | 4 ++-- src/cpl_cli/configuration/__init__.py | 4 ++-- src/cpl_cli/cpl-cli.json | 4 ++-- src/cpl_cli/live_server/__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 ++-- src/cpl_core/__init__.py | 4 ++-- src/cpl_core/application/__init__.py | 4 ++-- src/cpl_core/configuration/__init__.py | 4 ++-- src/cpl_core/console/__init__.py | 4 ++-- src/cpl_core/cpl-core.json | 2 +- src/cpl_core/database/__init__.py | 4 ++-- src/cpl_core/database/connection/__init__.py | 4 ++-- src/cpl_core/database/context/__init__.py | 4 ++-- src/cpl_core/dependency_injection/__init__.py | 4 ++-- src/cpl_core/environment/__init__.py | 4 ++-- src/cpl_core/logging/__init__.py | 4 ++-- src/cpl_core/mailing/__init__.py | 4 ++-- src/cpl_core/pipes/__init__.py | 4 ++-- src/cpl_core/time/__init__.py | 4 ++-- src/cpl_core/utils/__init__.py | 4 ++-- src/cpl_query/__init__.py | 4 ++-- src/cpl_query/_query/__init__.py | 4 ++-- src/cpl_query/cpl-query.json | 2 +- src/cpl_query/extension/__init__.py | 4 ++-- 43 files changed, 84 insertions(+), 84 deletions(-) diff --git a/src/cpl_cli/__init__.py b/src/cpl_cli/__init__.py index 7e4adf48..210b3e03 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple @@ -27,4 +27,4 @@ from .main import main from .startup import Startup VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/_templates/__init__.py b/src/cpl_cli/_templates/__init__.py index 2085ae73..d5752d0a 100644 --- a/src/cpl_cli/_templates/__init__.py +++ b/src/cpl_cli/_templates/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/_templates/build/__init__.py b/src/cpl_cli/_templates/build/__init__.py index 4c1a359a..36e4e03a 100644 --- a/src/cpl_cli/_templates/build/__init__.py +++ b/src/cpl_cli/_templates/build/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.build' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/_templates/generate/__init__.py b/src/cpl_cli/_templates/generate/__init__.py index 08102786..444862d5 100644 --- a/src/cpl_cli/_templates/generate/__init__.py +++ b/src/cpl_cli/_templates/generate/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.generate' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/_templates/new/__init__.py b/src/cpl_cli/_templates/new/__init__.py index 2e4b01da..b46f91ee 100644 --- a/src/cpl_cli/_templates/new/__init__.py +++ b/src/cpl_cli/_templates/new/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/_templates/new/console/__init__.py b/src/cpl_cli/_templates/new/console/__init__.py index 4aa53bba..8ce45135 100644 --- a/src/cpl_cli/_templates/new/console/__init__.py +++ b/src/cpl_cli/_templates/new/console/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/_templates/new/console/source/__init__.py b/src/cpl_cli/_templates/new/console/source/__init__.py index 034bfe62..336bce89 100644 --- a/src/cpl_cli/_templates/new/console/source/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/_templates/new/console/source/name/__init__.py b/src/cpl_cli/_templates/new/console/source/name/__init__.py index 089cd9a6..3cf58f40 100644 --- a/src/cpl_cli/_templates/new/console/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/_templates/new/console/source/tests/__init__.py b/src/cpl_cli/_templates/new/console/source/tests/__init__.py index 9f962d4c..43f3a725 100644 --- a/src/cpl_cli/_templates/new/console/source/tests/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/tests/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/_templates/new/library/__init__.py b/src/cpl_cli/_templates/new/library/__init__.py index 8a798796..002a81b7 100644 --- a/src/cpl_cli/_templates/new/library/__init__.py +++ b/src/cpl_cli/_templates/new/library/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/_templates/new/library/source/__init__.py b/src/cpl_cli/_templates/new/library/source/__init__.py index 1bac84f9..d32db8e1 100644 --- a/src/cpl_cli/_templates/new/library/source/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/_templates/new/library/source/name/__init__.py b/src/cpl_cli/_templates/new/library/source/name/__init__.py index 8a452402..401218db 100644 --- a/src/cpl_cli/_templates/new/library/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/_templates/new/library/source/tests/__init__.py b/src/cpl_cli/_templates/new/library/source/tests/__init__.py index 12786bca..9c3afc45 100644 --- a/src/cpl_cli/_templates/new/library/source/tests/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/tests/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/_templates/new/unittest/__init__.py b/src/cpl_cli/_templates/new/unittest/__init__.py index e9df9410..aa7e7935 100644 --- a/src/cpl_cli/_templates/new/unittest/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/_templates/new/unittest/source/__init__.py b/src/cpl_cli/_templates/new/unittest/source/__init__.py index 90228071..8bc89c89 100644 --- a/src/cpl_cli/_templates/new/unittest/source/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/_templates/new/unittest/source/name/__init__.py b/src/cpl_cli/_templates/new/unittest/source/name/__init__.py index 2470cbf3..79609b9a 100644 --- a/src/cpl_cli/_templates/new/unittest/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/_templates/publish/__init__.py b/src/cpl_cli/_templates/publish/__init__.py index 9cb1d1aa..da2493e5 100644 --- a/src/cpl_cli/_templates/publish/__init__.py +++ b/src/cpl_cli/_templates/publish/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.publish' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/command/__init__.py b/src/cpl_cli/command/__init__.py index 05f1b18f..c5796c33 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' 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='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/configuration/__init__.py b/src/cpl_cli/configuration/__init__.py index bbd53400..c86bacc3 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple @@ -30,4 +30,4 @@ from .workspace_settings import WorkspaceSettings from .workspace_settings_name_enum import WorkspaceSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/cpl-cli.json b/src/cpl_cli/cpl-cli.json index b5a709e3..cf804054 100644 --- a/src/cpl_cli/cpl-cli.json +++ b/src/cpl_cli/cpl-cli.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17" + "Micro": "17.dev6" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17" + "cpl-core>=2022.6.17.dev6" ], "PythonVersion": ">=3.10", "PythonPath": {}, diff --git a/src/cpl_cli/live_server/__init__.py b/src/cpl_cli/live_server/__init__.py index 6094ed35..ba00f9e8 100644 --- a/src/cpl_cli/live_server/__init__.py +++ b/src/cpl_cli/live_server/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.live_server' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/publish/__init__.py b/src/cpl_cli/publish/__init__.py index 27f9d1cf..e45859c9 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple @@ -24,4 +24,4 @@ from .publisher_abc import PublisherABC from .publisher_service import PublisherService VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/source_creator/__init__.py b/src/cpl_cli/source_creator/__init__.py index bc77e307..08b2fb5d 100644 --- a/src/cpl_cli/source_creator/__init__.py +++ b/src/cpl_cli/source_creator/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.source_creator' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_cli/validators/__init__.py b/src/cpl_cli/validators/__init__.py index 7fae4a43..e9654bb4 100644 --- a/src/cpl_cli/validators/__init__.py +++ b/src/cpl_cli/validators/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.validators' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_core/__init__.py b/src/cpl_core/__init__.py index fa5c4b17..099c8f37 100644 --- a/src/cpl_core/__init__.py +++ b/src/cpl_core/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_core' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_core/application/__init__.py b/src/cpl_core/application/__init__.py index 935bf9e8..244b9dc2 100644 --- a/src/cpl_core/application/__init__.py +++ b/src/cpl_core/application/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.application' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple @@ -28,4 +28,4 @@ from .startup_abc import StartupABC from .startup_extension_abc import StartupExtensionABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_core/configuration/__init__.py b/src/cpl_core/configuration/__init__.py index b6500994..2641ee35 100644 --- a/src/cpl_core/configuration/__init__.py +++ b/src/cpl_core/configuration/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.configuration' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple @@ -34,4 +34,4 @@ from .validator_abc import ValidatorABC from .variable_argument import VariableArgument VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_core/console/__init__.py b/src/cpl_core/console/__init__.py index bc1476a9..ccd0e484 100644 --- a/src/cpl_core/console/__init__.py +++ b/src/cpl_core/console/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.console' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple @@ -27,4 +27,4 @@ from .foreground_color_enum import ForegroundColorEnum from .spinner_thread import SpinnerThread VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_core/cpl-core.json b/src/cpl_core/cpl-core.json index 7ac905aa..525bfd9a 100644 --- a/src/cpl_core/cpl-core.json +++ b/src/cpl_core/cpl-core.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17" + "Micro": "17.dev6" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", diff --git a/src/cpl_core/database/__init__.py b/src/cpl_core/database/__init__.py index d5ff0988..0998767a 100644 --- a/src/cpl_core/database/__init__.py +++ b/src/cpl_core/database/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple @@ -25,4 +25,4 @@ from .database_settings import DatabaseSettings from .table_abc import TableABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_core/database/connection/__init__.py b/src/cpl_core/database/connection/__init__.py index 1f0b2b73..2abf24f8 100644 --- a/src/cpl_core/database/connection/__init__.py +++ b/src/cpl_core/database/connection/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database.connection' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple @@ -24,4 +24,4 @@ from .database_connection import DatabaseConnection from .database_connection_abc import DatabaseConnectionABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_core/database/context/__init__.py b/src/cpl_core/database/context/__init__.py index 2906617e..bc7b32ad 100644 --- a/src/cpl_core/database/context/__init__.py +++ b/src/cpl_core/database/context/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database.context' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple @@ -24,4 +24,4 @@ from .database_context import DatabaseContext from .database_context_abc import DatabaseContextABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_core/dependency_injection/__init__.py b/src/cpl_core/dependency_injection/__init__.py index e12cb685..abdec782 100644 --- a/src/cpl_core/dependency_injection/__init__.py +++ b/src/cpl_core/dependency_injection/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.dependency_injection' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple @@ -30,4 +30,4 @@ from .service_provider import ServiceProvider from .service_provider_abc import ServiceProviderABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_core/environment/__init__.py b/src/cpl_core/environment/__init__.py index e7acb259..3575e3c7 100644 --- a/src/cpl_core/environment/__init__.py +++ b/src/cpl_core/environment/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.environment' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple @@ -25,4 +25,4 @@ from .environment_name_enum import EnvironmentNameEnum from .application_environment import ApplicationEnvironment VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_core/logging/__init__.py b/src/cpl_core/logging/__init__.py index 02da5f23..b85f8d6b 100644 --- a/src/cpl_core/logging/__init__.py +++ b/src/cpl_core/logging/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.logging' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple @@ -27,4 +27,4 @@ from .logging_settings import LoggingSettings from .logging_settings_name_enum import LoggingSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_core/mailing/__init__.py b/src/cpl_core/mailing/__init__.py index 59c458a1..6589ae0d 100644 --- a/src/cpl_core/mailing/__init__.py +++ b/src/cpl_core/mailing/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.mailing' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple @@ -27,4 +27,4 @@ from .email_client_settings import EMailClientSettings from .email_client_settings_name_enum import EMailClientSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_core/pipes/__init__.py b/src/cpl_core/pipes/__init__.py index 23a253e4..20c70858 100644 --- a/src/cpl_core/pipes/__init__.py +++ b/src/cpl_core/pipes/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.pipes' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple @@ -29,4 +29,4 @@ from .to_camel_case_pipe import ToCamelCasePipe from .to_snake_case_pipe import ToSnakeCasePipe VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_core/time/__init__.py b/src/cpl_core/time/__init__.py index 150b1172..d5b857df 100644 --- a/src/cpl_core/time/__init__.py +++ b/src/cpl_core/time/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.time' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple @@ -24,4 +24,4 @@ from .time_format_settings import TimeFormatSettings from .time_format_settings_names_enum import TimeFormatSettingsNamesEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_core/utils/__init__.py b/src/cpl_core/utils/__init__.py index c540adf6..0dc46e2b 100644 --- a/src/cpl_core/utils/__init__.py +++ b/src/cpl_core/utils/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.utils' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple @@ -25,4 +25,4 @@ from .string import String from .pip import Pip VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_query/__init__.py b/src/cpl_query/__init__.py index 8bfc996f..5c98e23f 100644 --- a/src/cpl_query/__init__.py +++ b/src/cpl_query/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_query' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_query/_query/__init__.py b/src/cpl_query/_query/__init__.py index 60a7f996..eccaf9d5 100644 --- a/src/cpl_query/_query/__init__.py +++ b/src/cpl_query/_query/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_query._query' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') diff --git a/src/cpl_query/cpl-query.json b/src/cpl_query/cpl-query.json index 876fc3f2..73259f0a 100644 --- a/src/cpl_query/cpl-query.json +++ b/src/cpl_query/cpl-query.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17" + "Micro": "17.dev6" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", diff --git a/src/cpl_query/extension/__init__.py b/src/cpl_query/extension/__init__.py index be7474ec..6dc5bf71 100644 --- a/src/cpl_query/extension/__init__.py +++ b/src/cpl_query/extension/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_query.extension' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev5' +__version__ = '2022.6.17.dev6' from collections import namedtuple @@ -27,4 +27,4 @@ from .ordered_iterable_abc import OrderedIterableABC from .ordered_iterable import OrderedIterable VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev5') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') From ce0ad4013f88819f31eb5b0c487cca83960ebd2c Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 21:42:43 +0200 Subject: [PATCH 21/51] [WIP] Improved unittest --- unittests/unittests_cli/cli_test_suite.py | 26 +++++++++---------- unittests/unittests_cli/constants.py | 2 +- unittests/unittests_cli/generate_test_case.py | 9 +++++++ unittests/unittests_cli/new_test_case.py | 26 +++++++++++++++++-- unittests/unittests_shared/cli_commands.py | 10 +++---- 5 files changed, 52 insertions(+), 21 deletions(-) diff --git a/unittests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py index bb53effd..e64b3e7f 100644 --- a/unittests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -25,27 +25,27 @@ class CLITestSuite(unittest.TestSuite): loader = unittest.TestLoader() # nothing needed - self.addTests(loader.loadTestsFromTestCase(GenerateTestCase)) + # self.addTests(loader.loadTestsFromTestCase(GenerateTestCase)) self.addTests(loader.loadTestsFromTestCase(NewTestCase)) - self.addTests(loader.loadTestsFromTestCase(VersionTestCase)) + # self.addTests(loader.loadTestsFromTestCase(VersionTestCase)) # project needed - self.addTests(loader.loadTestsFromTestCase(BuildTestCase)) - self.addTests(loader.loadTestsFromTestCase(InstallTestCase)) - self.addTests(loader.loadTestsFromTestCase(PublishTestCase)) - self.addTests(loader.loadTestsFromTestCase(RunTestCase)) - self.addTests(loader.loadTestsFromTestCase(StartTestCase)) - self.addTests(loader.loadTestsFromTestCase(UninstallTestCase)) - self.addTests(loader.loadTestsFromTestCase(UpdateTestCase)) + # self.addTests(loader.loadTestsFromTestCase(BuildTestCase)) + # self.addTests(loader.loadTestsFromTestCase(InstallTestCase)) + # self.addTests(loader.loadTestsFromTestCase(PublishTestCase)) + # self.addTests(loader.loadTestsFromTestCase(RunTestCase)) + # self.addTests(loader.loadTestsFromTestCase(StartTestCase)) + # self.addTests(loader.loadTestsFromTestCase(UninstallTestCase)) + # self.addTests(loader.loadTestsFromTestCase(UpdateTestCase)) # workspace needed - self.addTests(loader.loadTestsFromTestCase(AddTestCase)) - self.addTests(loader.loadTestsFromTestCase(RemoveTestCase)) + # self.addTests(loader.loadTestsFromTestCase(AddTestCase)) + # self.addTests(loader.loadTestsFromTestCase(RemoveTestCase)) def _setup(self): try: if os.path.exists(PLAYGROUND_PATH): - shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, '../'))) + shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH))) os.makedirs(PLAYGROUND_PATH) os.chdir(PLAYGROUND_PATH) @@ -55,7 +55,7 @@ class CLITestSuite(unittest.TestSuite): def _cleanup(self): try: if os.path.exists(PLAYGROUND_PATH): - shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, '../'))) + shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH))) except Exception as e: print(f'Cleanup of {__name__} failed: {traceback.format_exc()}') diff --git a/unittests/unittests_cli/constants.py b/unittests/unittests_cli/constants.py index 917dda78..766d72c0 100644 --- a/unittests/unittests_cli/constants.py +++ b/unittests/unittests_cli/constants.py @@ -1,4 +1,4 @@ import os -PLAYGROUND_PATH = os.path.abspath(os.path.join(os.getcwd(), '../generated/test_cli_playground')) +PLAYGROUND_PATH = os.path.abspath(os.path.join(os.getcwd(), '../test_cli_playground')) CLI_PATH = os.path.abspath(os.path.join(os.getcwd(), '../../src/cpl_cli/main.py')) diff --git a/unittests/unittests_cli/generate_test_case.py b/unittests/unittests_cli/generate_test_case.py index ecc11e68..5a718416 100644 --- a/unittests/unittests_cli/generate_test_case.py +++ b/unittests/unittests_cli/generate_test_case.py @@ -15,28 +15,37 @@ class GenerateTestCase(unittest.TestCase): os.remove(file_path) def test_abc(self): + print(f'{__name__} generate abc') self._test_file('abc', '_abc') def test_class(self): + print(f'{__name__} generate class') self._test_file('class', '') def test_enum(self): + print(f'{__name__} generate enum') self._test_file('enum', '_enum') def test_pipe(self): + print(f'{__name__} generate pipe') self._test_file('pipe', '_pipe') def test_service(self): + print(f'{__name__} generate service') self._test_file('service', '_service') def test_settings(self): + print(f'{__name__} generate settings') self._test_file('settings', '_settings') def test_test_case(self): + print(f'{__name__} generate test_case') self._test_file('test_case', '_test_case') def test_thread(self): + print(f'{__name__} generate thread') self._test_file('thread', '_thread') def test_validator(self): + print(f'{__name__} generate validator') self._test_file('validator', '_validator') diff --git a/unittests/unittests_cli/new_test_case.py b/unittests/unittests_cli/new_test_case.py index d902e011..1309eb99 100644 --- a/unittests/unittests_cli/new_test_case.py +++ b/unittests/unittests_cli/new_test_case.py @@ -1,10 +1,32 @@ +import os +import shutil import unittest +from cpl_core.utils import String + +from unittests_cli.constants import PLAYGROUND_PATH +from unittests_shared.cli_commands import CLICommands + class NewTestCase(unittest.TestCase): def setUp(self): pass - def test_equal(self): - pass + def _test_project(self, project_type: str, name: str, *args): + CLICommands.new(project_type, name, *args) + project_path = os.path.abspath(os.path.join(PLAYGROUND_PATH, String.convert_to_snake_case(name))) + self.assertTrue(os.path.exists(project_path)) + shutil.rmtree(project_path) + + def test_console(self): + print(f'{__name__} new console') + self._test_project('console', 'test-console', '--ab', '--s', '--sp') + + def test_library(self): + print(f'{__name__} new library') + self._test_project('library', 'test-library', '--ab', '--s', '--sp') + + def test_unittest(self): + print(f'{__name__} new unittests') + self._test_project('unittest', 'test-unittest', '--ab', '--s', '--sp') diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index 4577e8e0..9465effd 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -9,7 +9,7 @@ class CLICommands: @staticmethod def _run(cmd: str, *args): env_vars = os.environ - env_vars['CPL_IS_UNITTEST'] = 'YES' + # env_vars['CPL_IS_UNITTEST'] = 'YES' command = ['python', CLI_PATH, cmd] for arg in args: command.append(arg) @@ -17,9 +17,9 @@ class CLICommands: subprocess.run(command, env=env_vars) @classmethod - def generate(cls, *args): - cls._run('generate', *args) + def generate(cls, schematic: str, name: str): + cls._run('generate', schematic, name) @classmethod - def new(cls, *args): - cls._run('new', *args) + def new(cls, project_type: str, name: str, *args): + cls._run('new', project_type, name, *args) From 833dd83008e0a51e9ca1b603801373d49109a9c1 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 22:21:16 +0200 Subject: [PATCH 22/51] Improved unittests & added tests for cpl new --- unittests/unittests_cli/cli_test_suite.py | 20 +++++------- unittests/unittests_cli/generate_test_case.py | 10 ------ unittests/unittests_cli/new_test_case.py | 32 +++++++++++++++---- unittests/unittests_shared/cli_commands.py | 2 +- 4 files changed, 35 insertions(+), 29 deletions(-) diff --git a/unittests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py index e64b3e7f..f1a7d7ea 100644 --- a/unittests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -2,20 +2,12 @@ import os import shutil import traceback import unittest +from typing import Optional +from unittest import TestResult -from unittests_cli.add_test_case import AddTestCase -from unittests_cli.build_test_case import BuildTestCase from unittests_cli.constants import PLAYGROUND_PATH from unittests_cli.generate_test_case import GenerateTestCase -from unittests_cli.install_test_case import InstallTestCase from unittests_cli.new_test_case import NewTestCase -from unittests_cli.publish_test_case import PublishTestCase -from unittests_cli.remove_test_case import RemoveTestCase -from unittests_cli.run_test_case import RunTestCase -from unittests_cli.start_test_case import StartTestCase -from unittests_cli.uninstall_test_case import UninstallTestCase -from unittests_cli.update_test_case import UpdateTestCase -from unittests_cli.version_test_case import VersionTestCase class CLITestSuite(unittest.TestSuite): @@ -24,8 +16,9 @@ class CLITestSuite(unittest.TestSuite): unittest.TestSuite.__init__(self) loader = unittest.TestLoader() + self._result: Optional[TestResult] = None # nothing needed - # self.addTests(loader.loadTestsFromTestCase(GenerateTestCase)) + self.addTests(loader.loadTestsFromTestCase(GenerateTestCase)) self.addTests(loader.loadTestsFromTestCase(NewTestCase)) # self.addTests(loader.loadTestsFromTestCase(VersionTestCase)) @@ -54,6 +47,9 @@ class CLITestSuite(unittest.TestSuite): def _cleanup(self): try: + if self._result is not None and (len(self._result.errors) > 0 or len(self._result.failures) > 0): + return + if os.path.exists(PLAYGROUND_PATH): shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH))) except Exception as e: @@ -61,5 +57,5 @@ class CLITestSuite(unittest.TestSuite): def run(self, *args): self._setup() - super().run(*args) + self._result = super().run(*args) self._cleanup() diff --git a/unittests/unittests_cli/generate_test_case.py b/unittests/unittests_cli/generate_test_case.py index 5a718416..53c03839 100644 --- a/unittests/unittests_cli/generate_test_case.py +++ b/unittests/unittests_cli/generate_test_case.py @@ -12,40 +12,30 @@ class GenerateTestCase(unittest.TestCase): file_path = os.path.abspath(os.path.join(PLAYGROUND_PATH, f'generated_file{suffix}.py')) file_exists = os.path.exists(file_path) self.assertTrue(file_exists) - os.remove(file_path) def test_abc(self): - print(f'{__name__} generate abc') self._test_file('abc', '_abc') def test_class(self): - print(f'{__name__} generate class') self._test_file('class', '') def test_enum(self): - print(f'{__name__} generate enum') self._test_file('enum', '_enum') def test_pipe(self): - print(f'{__name__} generate pipe') self._test_file('pipe', '_pipe') def test_service(self): - print(f'{__name__} generate service') self._test_file('service', '_service') def test_settings(self): - print(f'{__name__} generate settings') self._test_file('settings', '_settings') def test_test_case(self): - print(f'{__name__} generate test_case') self._test_file('test_case', '_test_case') def test_thread(self): - print(f'{__name__} generate thread') self._test_file('thread', '_thread') def test_validator(self): - print(f'{__name__} generate validator') self._test_file('validator', '_validator') diff --git a/unittests/unittests_cli/new_test_case.py b/unittests/unittests_cli/new_test_case.py index 1309eb99..53072308 100644 --- a/unittests/unittests_cli/new_test_case.py +++ b/unittests/unittests_cli/new_test_case.py @@ -11,22 +11,42 @@ from unittests_shared.cli_commands import CLICommands class NewTestCase(unittest.TestCase): def setUp(self): - pass + os.chdir(os.path.abspath(PLAYGROUND_PATH)) def _test_project(self, project_type: str, name: str, *args): CLICommands.new(project_type, name, *args) - project_path = os.path.abspath(os.path.join(PLAYGROUND_PATH, String.convert_to_snake_case(name))) + workspace_path = os.path.abspath(os.path.join(PLAYGROUND_PATH, name)) + self.assertTrue(os.path.exists(workspace_path)) + + project_path = os.path.abspath(os.path.join(PLAYGROUND_PATH, name, 'src', String.convert_to_snake_case(name))) self.assertTrue(os.path.exists(project_path)) - shutil.rmtree(project_path) + self.assertTrue(os.path.join(project_path, f'{name}.json')) + + def _test_sub_project(self, project_type: str, name: str, workspace_name: str, *args): + os.chdir(os.path.abspath(os.path.join(os.getcwd(), workspace_name))) + CLICommands.new(project_type, name, *args) + workspace_path = os.path.abspath(os.path.join(PLAYGROUND_PATH, workspace_name)) + self.assertTrue(os.path.exists(workspace_path)) + + project_path = os.path.abspath(os.path.join(PLAYGROUND_PATH, workspace_name, 'src', String.convert_to_snake_case(name))) + self.assertTrue(os.path.exists(project_path)) + self.assertTrue(os.path.join(project_path, f'{name}.json')) + os.chdir(os.path.abspath(os.path.join(os.getcwd(), '../'))) def test_console(self): - print(f'{__name__} new console') self._test_project('console', 'test-console', '--ab', '--s', '--sp') + def test_sub_console(self): + self._test_sub_project('console', 'test-sub-console', 'test-console', '--ab', '--s', '--sp') + def test_library(self): - print(f'{__name__} new library') self._test_project('library', 'test-library', '--ab', '--s', '--sp') + def test_sub_library(self): + self._test_sub_project('library', 'test-sub-library', 'test-console', '--ab', '--s', '--sp') + def test_unittest(self): - print(f'{__name__} new unittests') self._test_project('unittest', 'test-unittest', '--ab', '--s', '--sp') + + def test_sub_unittest(self): + self._test_sub_project('unittest', 'test-unittest', 'test-console', '--ab', '--s', '--sp') diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index 9465effd..da9c1ce7 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -9,7 +9,7 @@ class CLICommands: @staticmethod def _run(cmd: str, *args): env_vars = os.environ - # env_vars['CPL_IS_UNITTEST'] = 'YES' + env_vars['CPL_IS_UNITTEST'] = 'YES' command = ['python', CLI_PATH, cmd] for arg in args: command.append(arg) From e0da77fd4b661f2501fc8e3494cf81b80fefbc33 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 22:24:19 +0200 Subject: [PATCH 23/51] Added new test condition for cpl new --- unittests/unittests_cli/new_test_case.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/unittests/unittests_cli/new_test_case.py b/unittests/unittests_cli/new_test_case.py index 53072308..1caa725e 100644 --- a/unittests/unittests_cli/new_test_case.py +++ b/unittests/unittests_cli/new_test_case.py @@ -21,6 +21,11 @@ class NewTestCase(unittest.TestCase): project_path = os.path.abspath(os.path.join(PLAYGROUND_PATH, name, 'src', String.convert_to_snake_case(name))) self.assertTrue(os.path.exists(project_path)) self.assertTrue(os.path.join(project_path, f'{name}.json')) + self.assertTrue(os.path.join(project_path, f'application.py')) + self.assertTrue(os.path.join(project_path, f'main.py')) + self.assertTrue(os.path.join(project_path, f'startup.py')) + if project_type == 'unittest': + self.assertTrue(os.path.join(project_path, f'test_case_test_case.py')) def _test_sub_project(self, project_type: str, name: str, workspace_name: str, *args): os.chdir(os.path.abspath(os.path.join(os.getcwd(), workspace_name))) From df7bd066299d447a87a51e3dc5a08d6813648a8a Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 22:51:29 +0200 Subject: [PATCH 24/51] Fixed additional argument & flag bug --- src/cpl_core/configuration/configuration.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cpl_core/configuration/configuration.py b/src/cpl_core/configuration/configuration.py index 6ea17122..28f40355 100644 --- a/src/cpl_core/configuration/configuration.py +++ b/src/cpl_core/configuration/configuration.py @@ -190,8 +190,7 @@ class Configuration(ConfigurationABC): # executable if isinstance(arg, ExecutableArgument): - if arg_str.startswith(arg.token) \ - and arg_str_without_token == arg.name or arg_str_without_token in arg.aliases: + if arg_str.startswith(arg.token) and arg_str_without_token == arg.name or arg_str_without_token in arg.aliases: executables.append(arg) self._handled_args.append(arg_str) self._parse_arguments(executables, arg_list[i + 1:], arg.console_arguments) @@ -202,8 +201,7 @@ class Configuration(ConfigurationABC): if arg.value_token in arg_str_without_value: arg_str_without_value = arg_str_without_token.split(arg.value_token)[0] - if arg_str.startswith(arg.token) \ - and arg_str_without_value == arg.name or arg_str_without_value in arg.aliases: + if arg_str.startswith(arg.token) and arg_str_without_value == arg.name or arg_str_without_value in arg.aliases: if arg.value_token != ' ': value = arg_str_without_token.split(arg.value_token)[1] else: @@ -216,10 +214,16 @@ class Configuration(ConfigurationABC): # flags elif isinstance(arg, FlagArgument): if arg_str.startswith(arg.token) and arg_str_without_token == arg.name or arg_str_without_token in arg.aliases: + if arg_str in self._additional_arguments: + self._additional_arguments.remove(arg_str) self._additional_arguments.append(arg.name) self._handled_args.append(arg_str) self._parse_arguments(executables, arg_list[i + 1:], arg.console_arguments) + # add left over values to args + if arg_str not in self._additional_arguments and arg_str not in self._handled_args: + self._additional_arguments.append(arg_str) + def add_environment_variables(self, prefix: str): for env_var in os.environ.keys(): if not env_var.startswith(prefix): @@ -305,10 +309,6 @@ class Configuration(ConfigurationABC): arg_list = sys.argv[1:] executables: list[ExecutableArgument] = [] self._parse_arguments(executables, arg_list, self._argument_types) - for arg_str in arg_list: - # add left over values to args - if arg_str not in self._additional_arguments and arg_str not in self._handled_args: - self._additional_arguments.append(arg_str) except Exception as e: Console.error('An error occurred while parsing arguments.') sys.exit() From 49cce5fa1a87e42be3ba5cd087f20413d33b087b Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 22:52:03 +0200 Subject: [PATCH 25/51] Extended cpl new options --- src/cpl_cli/command/new_service.py | 17 ++++++++++++++--- src/cpl_cli/startup_argument_extension.py | 3 ++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/cpl_cli/command/new_service.py b/src/cpl_cli/command/new_service.py index f8b5781e..3f1857c2 100644 --- a/src/cpl_cli/command/new_service.py +++ b/src/cpl_cli/command/new_service.py @@ -276,18 +276,29 @@ class NewService(CommandABC): :param args: :return: """ + if 'nothing' in args: + self._use_async = False + self._use_application_api = False + self._use_startup = False + self._use_service_providing = False + if 'async' in args: + args.remove('async') + if 'application-base' in args: + args.remove('application-base') + if 'startup' in args: + args.remove('startup') + if 'service-providing' in args: + args.remove('service-providing') + if 'async' in args: self._use_async = True args.remove('async') - if 'application-base' in args: self._use_application_api = True args.remove('application-base') - if 'startup' in args: self._use_startup = True args.remove('startup') - if 'service-providing' in args: self._use_service_providing = True args.remove('service-providing') diff --git a/src/cpl_cli/startup_argument_extension.py b/src/cpl_cli/startup_argument_extension.py index 64710b11..01f89e2c 100644 --- a/src/cpl_cli/startup_argument_extension.py +++ b/src/cpl_cli/startup_argument_extension.py @@ -90,7 +90,8 @@ class StartupArgumentExtension(StartupExtensionABC): .add_console_argument(ArgumentTypeEnum.Flag, '--', 'async', ['a', 'A']) \ .add_console_argument(ArgumentTypeEnum.Flag, '--', 'application-base', ['ab', 'AB']) \ .add_console_argument(ArgumentTypeEnum.Flag, '--', 'startup', ['s', 'S']) \ - .add_console_argument(ArgumentTypeEnum.Flag, '--', 'service-providing', ['sp', 'SP']) + .add_console_argument(ArgumentTypeEnum.Flag, '--', 'service-providing', ['sp', 'SP']) \ + .add_console_argument(ArgumentTypeEnum.Flag, '--', 'nothing', ['n', 'N']) config.create_console_argument(ArgumentTypeEnum.Executable, '', 'publish', ['p', 'P'], PublishService, True, validators=[ProjectValidator]) config.create_console_argument(ArgumentTypeEnum.Executable, '', 'remove', ['r', 'R'], RemoveService, True, validators=[WorkspaceValidator]) \ .add_console_argument(ArgumentTypeEnum.Flag, '--', 'simulate', ['s', 'S']) From a593f34cde8437468d58eaf87154e32541c186ff Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 23:00:55 +0200 Subject: [PATCH 26/51] Build dev7 --- cpl-workspace.json | 8 +++++++- 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/generate/__init__.py | 4 ++-- src/cpl_cli/_templates/new/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/source/__init__.py | 4 ++-- .../_templates/new/console/source/name/__init__.py | 4 ++-- .../_templates/new/console/source/tests/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/source/__init__.py | 4 ++-- .../_templates/new/library/source/name/__init__.py | 4 ++-- .../_templates/new/library/source/tests/__init__.py | 4 ++-- src/cpl_cli/_templates/new/unittest/__init__.py | 4 ++-- src/cpl_cli/_templates/new/unittest/source/__init__.py | 4 ++-- .../_templates/new/unittest/source/name/__init__.py | 4 ++-- src/cpl_cli/_templates/publish/__init__.py | 4 ++-- src/cpl_cli/command/__init__.py | 4 ++-- src/cpl_cli/configuration/__init__.py | 4 ++-- src/cpl_cli/cpl-cli.json | 4 ++-- src/cpl_cli/live_server/__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 ++-- src/cpl_core/__init__.py | 4 ++-- src/cpl_core/application/__init__.py | 4 ++-- src/cpl_core/configuration/__init__.py | 4 ++-- src/cpl_core/console/__init__.py | 4 ++-- src/cpl_core/cpl-core.json | 2 +- src/cpl_core/database/__init__.py | 4 ++-- src/cpl_core/database/connection/__init__.py | 4 ++-- src/cpl_core/database/context/__init__.py | 4 ++-- src/cpl_core/dependency_injection/__init__.py | 4 ++-- src/cpl_core/environment/__init__.py | 4 ++-- src/cpl_core/logging/__init__.py | 4 ++-- src/cpl_core/mailing/__init__.py | 4 ++-- src/cpl_core/pipes/__init__.py | 4 ++-- src/cpl_core/time/__init__.py | 4 ++-- src/cpl_core/utils/__init__.py | 4 ++-- src/cpl_query/__init__.py | 4 ++-- src/cpl_query/_query/__init__.py | 4 ++-- src/cpl_query/cpl-query.json | 2 +- src/cpl_query/extension/__init__.py | 4 ++-- tools/set_pip_urls/set-pip-urls.json | 2 +- tools/set_version/set-version.json | 2 +- 46 files changed, 93 insertions(+), 87 deletions(-) diff --git a/cpl-workspace.json b/cpl-workspace.json index 8d2d7423..0ccfebed 100644 --- a/cpl-workspace.json +++ b/cpl-workspace.json @@ -83,7 +83,13 @@ "dd": "cpl deploy-dev $ARGS", "deploy-dev-cli": "cpl publish-cli; cpl upload-dev-cli", "deploy-dev-core": "cpl publish-core; cpl upload-dev-core", - "deploy-dev-query": "cpl publish-query; cpl upload-dev-query" + "deploy-dev-query": "cpl publish-query; cpl upload-dev-query", + + "dev-install": "cpl di-core; cpl di-cli; cpl di-query;", + "di": "cpl dev-install", + "di-core": "pip install cpl-query --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de", + "di-cli": "pip install cpl-query --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de", + "di-query": "pip install cpl-query --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de" } } } \ No newline at end of file diff --git a/src/cpl_cli/__init__.py b/src/cpl_cli/__init__.py index 210b3e03..ed75bd53 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple @@ -27,4 +27,4 @@ from .main import main from .startup import Startup VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/_templates/__init__.py b/src/cpl_cli/_templates/__init__.py index d5752d0a..f5695c7b 100644 --- a/src/cpl_cli/_templates/__init__.py +++ b/src/cpl_cli/_templates/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/_templates/build/__init__.py b/src/cpl_cli/_templates/build/__init__.py index 36e4e03a..209ba198 100644 --- a/src/cpl_cli/_templates/build/__init__.py +++ b/src/cpl_cli/_templates/build/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.build' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/_templates/generate/__init__.py b/src/cpl_cli/_templates/generate/__init__.py index 444862d5..0df0a7e7 100644 --- a/src/cpl_cli/_templates/generate/__init__.py +++ b/src/cpl_cli/_templates/generate/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.generate' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/_templates/new/__init__.py b/src/cpl_cli/_templates/new/__init__.py index b46f91ee..9cb917a8 100644 --- a/src/cpl_cli/_templates/new/__init__.py +++ b/src/cpl_cli/_templates/new/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/_templates/new/console/__init__.py b/src/cpl_cli/_templates/new/console/__init__.py index 8ce45135..d814cc99 100644 --- a/src/cpl_cli/_templates/new/console/__init__.py +++ b/src/cpl_cli/_templates/new/console/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/_templates/new/console/source/__init__.py b/src/cpl_cli/_templates/new/console/source/__init__.py index 336bce89..e9383fb3 100644 --- a/src/cpl_cli/_templates/new/console/source/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/_templates/new/console/source/name/__init__.py b/src/cpl_cli/_templates/new/console/source/name/__init__.py index 3cf58f40..286ec8f2 100644 --- a/src/cpl_cli/_templates/new/console/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/_templates/new/console/source/tests/__init__.py b/src/cpl_cli/_templates/new/console/source/tests/__init__.py index 43f3a725..531f5e63 100644 --- a/src/cpl_cli/_templates/new/console/source/tests/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/tests/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/_templates/new/library/__init__.py b/src/cpl_cli/_templates/new/library/__init__.py index 002a81b7..d4b30ae2 100644 --- a/src/cpl_cli/_templates/new/library/__init__.py +++ b/src/cpl_cli/_templates/new/library/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/_templates/new/library/source/__init__.py b/src/cpl_cli/_templates/new/library/source/__init__.py index d32db8e1..2731bca4 100644 --- a/src/cpl_cli/_templates/new/library/source/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/_templates/new/library/source/name/__init__.py b/src/cpl_cli/_templates/new/library/source/name/__init__.py index 401218db..ca97b9a9 100644 --- a/src/cpl_cli/_templates/new/library/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/_templates/new/library/source/tests/__init__.py b/src/cpl_cli/_templates/new/library/source/tests/__init__.py index 9c3afc45..b7b84387 100644 --- a/src/cpl_cli/_templates/new/library/source/tests/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/tests/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/_templates/new/unittest/__init__.py b/src/cpl_cli/_templates/new/unittest/__init__.py index aa7e7935..1bff3dcb 100644 --- a/src/cpl_cli/_templates/new/unittest/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/_templates/new/unittest/source/__init__.py b/src/cpl_cli/_templates/new/unittest/source/__init__.py index 8bc89c89..357b901c 100644 --- a/src/cpl_cli/_templates/new/unittest/source/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/_templates/new/unittest/source/name/__init__.py b/src/cpl_cli/_templates/new/unittest/source/name/__init__.py index 79609b9a..61ae70da 100644 --- a/src/cpl_cli/_templates/new/unittest/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/_templates/publish/__init__.py b/src/cpl_cli/_templates/publish/__init__.py index da2493e5..d9c5204c 100644 --- a/src/cpl_cli/_templates/publish/__init__.py +++ b/src/cpl_cli/_templates/publish/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.publish' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/command/__init__.py b/src/cpl_cli/command/__init__.py index c5796c33..37e94b7b 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' 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='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/configuration/__init__.py b/src/cpl_cli/configuration/__init__.py index c86bacc3..f33f8123 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple @@ -30,4 +30,4 @@ from .workspace_settings import WorkspaceSettings from .workspace_settings_name_enum import WorkspaceSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/cpl-cli.json b/src/cpl_cli/cpl-cli.json index cf804054..2cdbf03b 100644 --- a/src/cpl_cli/cpl-cli.json +++ b/src/cpl_cli/cpl-cli.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev6" + "Micro": "17.dev7" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17.dev6" + "cpl-core>=2022.6.17.dev7" ], "PythonVersion": ">=3.10", "PythonPath": {}, diff --git a/src/cpl_cli/live_server/__init__.py b/src/cpl_cli/live_server/__init__.py index ba00f9e8..e8a7744c 100644 --- a/src/cpl_cli/live_server/__init__.py +++ b/src/cpl_cli/live_server/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.live_server' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/publish/__init__.py b/src/cpl_cli/publish/__init__.py index e45859c9..a9989102 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple @@ -24,4 +24,4 @@ from .publisher_abc import PublisherABC from .publisher_service import PublisherService VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/source_creator/__init__.py b/src/cpl_cli/source_creator/__init__.py index 08b2fb5d..1cb5d1e2 100644 --- a/src/cpl_cli/source_creator/__init__.py +++ b/src/cpl_cli/source_creator/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.source_creator' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_cli/validators/__init__.py b/src/cpl_cli/validators/__init__.py index e9654bb4..8633839c 100644 --- a/src/cpl_cli/validators/__init__.py +++ b/src/cpl_cli/validators/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.validators' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_core/__init__.py b/src/cpl_core/__init__.py index 099c8f37..4d8ffbe9 100644 --- a/src/cpl_core/__init__.py +++ b/src/cpl_core/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_core' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_core/application/__init__.py b/src/cpl_core/application/__init__.py index 244b9dc2..31853279 100644 --- a/src/cpl_core/application/__init__.py +++ b/src/cpl_core/application/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.application' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple @@ -28,4 +28,4 @@ from .startup_abc import StartupABC from .startup_extension_abc import StartupExtensionABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_core/configuration/__init__.py b/src/cpl_core/configuration/__init__.py index 2641ee35..b5fc73a9 100644 --- a/src/cpl_core/configuration/__init__.py +++ b/src/cpl_core/configuration/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.configuration' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple @@ -34,4 +34,4 @@ from .validator_abc import ValidatorABC from .variable_argument import VariableArgument VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_core/console/__init__.py b/src/cpl_core/console/__init__.py index ccd0e484..10521167 100644 --- a/src/cpl_core/console/__init__.py +++ b/src/cpl_core/console/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.console' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple @@ -27,4 +27,4 @@ from .foreground_color_enum import ForegroundColorEnum from .spinner_thread import SpinnerThread VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_core/cpl-core.json b/src/cpl_core/cpl-core.json index 525bfd9a..27b2dd82 100644 --- a/src/cpl_core/cpl-core.json +++ b/src/cpl_core/cpl-core.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev6" + "Micro": "17.dev7" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", diff --git a/src/cpl_core/database/__init__.py b/src/cpl_core/database/__init__.py index 0998767a..c93b6226 100644 --- a/src/cpl_core/database/__init__.py +++ b/src/cpl_core/database/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple @@ -25,4 +25,4 @@ from .database_settings import DatabaseSettings from .table_abc import TableABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_core/database/connection/__init__.py b/src/cpl_core/database/connection/__init__.py index 2abf24f8..140f1734 100644 --- a/src/cpl_core/database/connection/__init__.py +++ b/src/cpl_core/database/connection/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database.connection' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple @@ -24,4 +24,4 @@ from .database_connection import DatabaseConnection from .database_connection_abc import DatabaseConnectionABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_core/database/context/__init__.py b/src/cpl_core/database/context/__init__.py index bc7b32ad..e23f0598 100644 --- a/src/cpl_core/database/context/__init__.py +++ b/src/cpl_core/database/context/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database.context' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple @@ -24,4 +24,4 @@ from .database_context import DatabaseContext from .database_context_abc import DatabaseContextABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_core/dependency_injection/__init__.py b/src/cpl_core/dependency_injection/__init__.py index abdec782..3f12ff68 100644 --- a/src/cpl_core/dependency_injection/__init__.py +++ b/src/cpl_core/dependency_injection/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.dependency_injection' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple @@ -30,4 +30,4 @@ from .service_provider import ServiceProvider from .service_provider_abc import ServiceProviderABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_core/environment/__init__.py b/src/cpl_core/environment/__init__.py index 3575e3c7..fff7d821 100644 --- a/src/cpl_core/environment/__init__.py +++ b/src/cpl_core/environment/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.environment' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple @@ -25,4 +25,4 @@ from .environment_name_enum import EnvironmentNameEnum from .application_environment import ApplicationEnvironment VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_core/logging/__init__.py b/src/cpl_core/logging/__init__.py index b85f8d6b..1473adfb 100644 --- a/src/cpl_core/logging/__init__.py +++ b/src/cpl_core/logging/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.logging' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple @@ -27,4 +27,4 @@ from .logging_settings import LoggingSettings from .logging_settings_name_enum import LoggingSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_core/mailing/__init__.py b/src/cpl_core/mailing/__init__.py index 6589ae0d..83708258 100644 --- a/src/cpl_core/mailing/__init__.py +++ b/src/cpl_core/mailing/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.mailing' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple @@ -27,4 +27,4 @@ from .email_client_settings import EMailClientSettings from .email_client_settings_name_enum import EMailClientSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_core/pipes/__init__.py b/src/cpl_core/pipes/__init__.py index 20c70858..466f7209 100644 --- a/src/cpl_core/pipes/__init__.py +++ b/src/cpl_core/pipes/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.pipes' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple @@ -29,4 +29,4 @@ from .to_camel_case_pipe import ToCamelCasePipe from .to_snake_case_pipe import ToSnakeCasePipe VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_core/time/__init__.py b/src/cpl_core/time/__init__.py index d5b857df..d0e04f3b 100644 --- a/src/cpl_core/time/__init__.py +++ b/src/cpl_core/time/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.time' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple @@ -24,4 +24,4 @@ from .time_format_settings import TimeFormatSettings from .time_format_settings_names_enum import TimeFormatSettingsNamesEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_core/utils/__init__.py b/src/cpl_core/utils/__init__.py index 0dc46e2b..c12a51e4 100644 --- a/src/cpl_core/utils/__init__.py +++ b/src/cpl_core/utils/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.utils' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple @@ -25,4 +25,4 @@ from .string import String from .pip import Pip VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_query/__init__.py b/src/cpl_query/__init__.py index 5c98e23f..71ad1b14 100644 --- a/src/cpl_query/__init__.py +++ b/src/cpl_query/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_query' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_query/_query/__init__.py b/src/cpl_query/_query/__init__.py index eccaf9d5..b148157c 100644 --- a/src/cpl_query/_query/__init__.py +++ b/src/cpl_query/_query/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_query._query' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/src/cpl_query/cpl-query.json b/src/cpl_query/cpl-query.json index 73259f0a..18772f6c 100644 --- a/src/cpl_query/cpl-query.json +++ b/src/cpl_query/cpl-query.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev6" + "Micro": "17.dev7" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", diff --git a/src/cpl_query/extension/__init__.py b/src/cpl_query/extension/__init__.py index 6dc5bf71..80fbf742 100644 --- a/src/cpl_query/extension/__init__.py +++ b/src/cpl_query/extension/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_query.extension' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev6' +__version__ = '2022.6.17.dev7' from collections import namedtuple @@ -27,4 +27,4 @@ from .ordered_iterable_abc import OrderedIterableABC from .ordered_iterable import OrderedIterable VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev6') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') diff --git a/tools/set_pip_urls/set-pip-urls.json b/tools/set_pip_urls/set-pip-urls.json index a3c936e3..3c2405e6 100644 --- a/tools/set_pip_urls/set-pip-urls.json +++ b/tools/set_pip_urls/set-pip-urls.json @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17" + "cpl-core>=2022.6.17.dev7" ], "PythonVersion": ">=3.10.4", "PythonPath": {}, diff --git a/tools/set_version/set-version.json b/tools/set_version/set-version.json index da0b3d1d..ebb1bb8d 100644 --- a/tools/set_version/set-version.json +++ b/tools/set_version/set-version.json @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17.dev6", + "cpl-core>=2022.6.17.dev7", "gitpython==3.1.27" ], "PythonVersion": ">=3.10.4", From 3a1630b68763d0958c8932292ede400c8c621ad2 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 23:01:23 +0200 Subject: [PATCH 27/51] Added force option to set-version --- tools/set_version/application.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/set_version/application.py b/tools/set_version/application.py index 83ea7b63..35948d7e 100644 --- a/tools/set_version/application.py +++ b/tools/set_version/application.py @@ -35,6 +35,11 @@ class Application(ApplicationABC): version = {} branch = "" suffix = "" + force = False + if '--force' in args: + args.remove('--force') + force = True + if len(args) > 1: Console.error(f'Unexpected argument(s): {", ".join(args[1:])}') return @@ -63,7 +68,7 @@ class Application(ApplicationABC): try: for project in self._workspace.projects: - if project not in diff_paths and String.convert_to_snake_case(project) not in diff_paths: + if project not in diff_paths and String.convert_to_snake_case(project) not in diff_paths and not force: Console.write_line(f'Skipping {project} due to missing changes') continue From 56380763a9c5aed7e96045cfa8ffd162daee4b1d Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 23:01:50 +0200 Subject: [PATCH 28/51] Improved unittests --- unittests/unittests/unittests.json | 4 +-- unittests/unittests_cli/new_test_case.py | 28 ++++++++++++++++--- unittests/unittests_cli/unittests_cli.json | 6 ++-- unittests/unittests_core/unittests_core.json | 4 +-- .../unittests_query/unittests_query.json | 6 ++-- .../unittests_shared/unittests_shared.json | 4 +-- 6 files changed, 36 insertions(+), 16 deletions(-) diff --git a/unittests/unittests/unittests.json b/unittests/unittests/unittests.json index be802510..c9be15f0 100644 --- a/unittests/unittests/unittests.json +++ b/unittests/unittests/unittests.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev6" + "Micro": "17.dev7" }, "Author": "", "AuthorEmail": "", @@ -16,7 +16,7 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev6" + "cpl-core>=2022.6.17.dev7" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_cli/new_test_case.py b/unittests/unittests_cli/new_test_case.py index 1caa725e..fa2f8070 100644 --- a/unittests/unittests_cli/new_test_case.py +++ b/unittests/unittests_cli/new_test_case.py @@ -21,11 +21,22 @@ class NewTestCase(unittest.TestCase): project_path = os.path.abspath(os.path.join(PLAYGROUND_PATH, name, 'src', String.convert_to_snake_case(name))) self.assertTrue(os.path.exists(project_path)) self.assertTrue(os.path.join(project_path, f'{name}.json')) - self.assertTrue(os.path.join(project_path, f'application.py')) self.assertTrue(os.path.join(project_path, f'main.py')) - self.assertTrue(os.path.join(project_path, f'startup.py')) + + if '--ab' in args: + self.assertTrue(os.path.isfile(os.path.join(project_path, f'application.py'))) + else: + self.assertFalse(os.path.isfile(os.path.join(project_path, f'application.py'))) + + if '--sp' in args: + self.assertTrue(os.path.isfile(os.path.join(project_path, f'startup.py'))) + else: + self.assertFalse(os.path.isfile(os.path.join(project_path, f'startup.py'))) + if project_type == 'unittest': - self.assertTrue(os.path.join(project_path, f'test_case_test_case.py')) + self.assertTrue(os.path.isfile(os.path.join(project_path, f'test_case.py'))) + else: + self.assertFalse(os.path.isfile(os.path.join(project_path, f'test_case.py'))) def _test_sub_project(self, project_type: str, name: str, workspace_name: str, *args): os.chdir(os.path.abspath(os.path.join(os.getcwd(), workspace_name))) @@ -41,6 +52,15 @@ class NewTestCase(unittest.TestCase): def test_console(self): self._test_project('console', 'test-console', '--ab', '--s', '--sp') + def test_console_without_sp(self): + self._test_project('console', 'test-console-without-sp', '--ab', '--s') + + def test_console_without_s(self): + self._test_project('console', 'test-console-without-s', '--ab') + + def test_console_without_ab(self): + self._test_project('console', 'test-console-without-ab', '--sp') + def test_sub_console(self): self._test_sub_project('console', 'test-sub-console', 'test-console', '--ab', '--s', '--sp') @@ -51,7 +71,7 @@ class NewTestCase(unittest.TestCase): self._test_sub_project('library', 'test-sub-library', 'test-console', '--ab', '--s', '--sp') def test_unittest(self): - self._test_project('unittest', 'test-unittest', '--ab', '--s', '--sp') + self._test_project('unittest', 'test-unittest', '--ab') def test_sub_unittest(self): self._test_sub_project('unittest', 'test-unittest', 'test-console', '--ab', '--s', '--sp') diff --git a/unittests/unittests_cli/unittests_cli.json b/unittests/unittests_cli/unittests_cli.json index bd09248a..c8681484 100644 --- a/unittests/unittests_cli/unittests_cli.json +++ b/unittests/unittests_cli/unittests_cli.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev6" + "Micro": "17.dev7" }, "Author": "", "AuthorEmail": "", @@ -16,8 +16,8 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev6", - "cpl-cli>=2022.6.17.dev6" + "cpl-core>=2022.6.17.dev7", + "cpl-cli>=2022.6.17.dev7" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_core/unittests_core.json b/unittests/unittests_core/unittests_core.json index fdf7b69a..f8dedcd3 100644 --- a/unittests/unittests_core/unittests_core.json +++ b/unittests/unittests_core/unittests_core.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev6" + "Micro": "17.dev7" }, "Author": "", "AuthorEmail": "", @@ -16,7 +16,7 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev6" + "cpl-core>=2022.6.17.dev7" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_query/unittests_query.json b/unittests/unittests_query/unittests_query.json index 326c72d1..c4f1ed2e 100644 --- a/unittests/unittests_query/unittests_query.json +++ b/unittests/unittests_query/unittests_query.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev6" + "Micro": "17.dev7" }, "Author": "", "AuthorEmail": "", @@ -16,8 +16,8 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev6", - "cpl-query>=2022.6.17.dev6" + "cpl-core>=2022.6.17.dev7", + "cpl-query>=2022.6.17.dev7" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_shared/unittests_shared.json b/unittests/unittests_shared/unittests_shared.json index cab18497..9f28e0b7 100644 --- a/unittests/unittests_shared/unittests_shared.json +++ b/unittests/unittests_shared/unittests_shared.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev6" + "Micro": "17.dev7" }, "Author": "", "AuthorEmail": "", @@ -16,7 +16,7 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev6" + "cpl-core>=2022.6.17.dev7" ], "PythonVersion": ">=3.10.4", "PythonPath": { From f9748cdb7674e6c7f9fd3c3e9088dc4aa19a9b11 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 23:03:18 +0200 Subject: [PATCH 29/51] Improved gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 1c6827be..104190c6 100644 --- a/.gitignore +++ b/.gitignore @@ -135,3 +135,6 @@ dmypy.json # IDE .idea/ PythonImportHelper-v2-Completion.json + +# cpl unittest stuff +unittests/test_*_playground From 348fad24c7fbd665005634a35ce695e1c281b800 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 23:27:20 +0200 Subject: [PATCH 30/51] Build dev8 & improved set-version change handling --- 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/generate/__init__.py | 4 ++-- src/cpl_cli/_templates/new/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/source/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/source/name/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/source/tests/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/source/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/source/name/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/source/tests/__init__.py | 4 ++-- src/cpl_cli/_templates/new/unittest/__init__.py | 4 ++-- src/cpl_cli/_templates/new/unittest/source/__init__.py | 4 ++-- src/cpl_cli/_templates/new/unittest/source/name/__init__.py | 4 ++-- src/cpl_cli/_templates/publish/__init__.py | 4 ++-- src/cpl_cli/command/__init__.py | 4 ++-- src/cpl_cli/command/new_service.py | 4 +++- src/cpl_cli/configuration/__init__.py | 4 ++-- src/cpl_cli/cpl-cli.json | 4 ++-- src/cpl_cli/live_server/__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 ++-- src/cpl_core/__init__.py | 4 ++-- src/cpl_core/application/__init__.py | 4 ++-- src/cpl_core/configuration/__init__.py | 4 ++-- src/cpl_core/console/__init__.py | 4 ++-- src/cpl_core/cpl-core.json | 2 +- src/cpl_core/database/__init__.py | 4 ++-- src/cpl_core/database/connection/__init__.py | 4 ++-- src/cpl_core/database/context/__init__.py | 4 ++-- src/cpl_core/dependency_injection/__init__.py | 4 ++-- src/cpl_core/environment/__init__.py | 4 ++-- src/cpl_core/logging/__init__.py | 4 ++-- src/cpl_core/mailing/__init__.py | 4 ++-- src/cpl_core/pipes/__init__.py | 4 ++-- src/cpl_core/time/__init__.py | 4 ++-- src/cpl_core/utils/__init__.py | 4 ++-- src/cpl_query/__init__.py | 4 ++-- src/cpl_query/_query/__init__.py | 4 ++-- src/cpl_query/cpl-query.json | 2 +- src/cpl_query/extension/__init__.py | 4 ++-- tools/set_pip_urls/set-pip-urls.json | 2 +- tools/set_version/application.py | 5 ++++- tools/set_version/set-version.json | 2 +- 47 files changed, 93 insertions(+), 88 deletions(-) diff --git a/src/cpl_cli/__init__.py b/src/cpl_cli/__init__.py index ed75bd53..24f73b13 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple @@ -27,4 +27,4 @@ from .main import main from .startup import Startup VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/_templates/__init__.py b/src/cpl_cli/_templates/__init__.py index f5695c7b..68b96145 100644 --- a/src/cpl_cli/_templates/__init__.py +++ b/src/cpl_cli/_templates/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/_templates/build/__init__.py b/src/cpl_cli/_templates/build/__init__.py index 209ba198..3912c53b 100644 --- a/src/cpl_cli/_templates/build/__init__.py +++ b/src/cpl_cli/_templates/build/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.build' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/_templates/generate/__init__.py b/src/cpl_cli/_templates/generate/__init__.py index 0df0a7e7..545d4865 100644 --- a/src/cpl_cli/_templates/generate/__init__.py +++ b/src/cpl_cli/_templates/generate/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.generate' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/_templates/new/__init__.py b/src/cpl_cli/_templates/new/__init__.py index 9cb917a8..61127d5d 100644 --- a/src/cpl_cli/_templates/new/__init__.py +++ b/src/cpl_cli/_templates/new/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/_templates/new/console/__init__.py b/src/cpl_cli/_templates/new/console/__init__.py index d814cc99..dee5faba 100644 --- a/src/cpl_cli/_templates/new/console/__init__.py +++ b/src/cpl_cli/_templates/new/console/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/_templates/new/console/source/__init__.py b/src/cpl_cli/_templates/new/console/source/__init__.py index e9383fb3..fc6d8264 100644 --- a/src/cpl_cli/_templates/new/console/source/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/_templates/new/console/source/name/__init__.py b/src/cpl_cli/_templates/new/console/source/name/__init__.py index 286ec8f2..3cd4ecd6 100644 --- a/src/cpl_cli/_templates/new/console/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/_templates/new/console/source/tests/__init__.py b/src/cpl_cli/_templates/new/console/source/tests/__init__.py index 531f5e63..0f704402 100644 --- a/src/cpl_cli/_templates/new/console/source/tests/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/tests/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/_templates/new/library/__init__.py b/src/cpl_cli/_templates/new/library/__init__.py index d4b30ae2..1b96a923 100644 --- a/src/cpl_cli/_templates/new/library/__init__.py +++ b/src/cpl_cli/_templates/new/library/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/_templates/new/library/source/__init__.py b/src/cpl_cli/_templates/new/library/source/__init__.py index 2731bca4..b1f2ad85 100644 --- a/src/cpl_cli/_templates/new/library/source/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/_templates/new/library/source/name/__init__.py b/src/cpl_cli/_templates/new/library/source/name/__init__.py index ca97b9a9..0a2b7e52 100644 --- a/src/cpl_cli/_templates/new/library/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/_templates/new/library/source/tests/__init__.py b/src/cpl_cli/_templates/new/library/source/tests/__init__.py index b7b84387..e719eea5 100644 --- a/src/cpl_cli/_templates/new/library/source/tests/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/tests/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/_templates/new/unittest/__init__.py b/src/cpl_cli/_templates/new/unittest/__init__.py index 1bff3dcb..1867ff43 100644 --- a/src/cpl_cli/_templates/new/unittest/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/_templates/new/unittest/source/__init__.py b/src/cpl_cli/_templates/new/unittest/source/__init__.py index 357b901c..539ebd18 100644 --- a/src/cpl_cli/_templates/new/unittest/source/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/_templates/new/unittest/source/name/__init__.py b/src/cpl_cli/_templates/new/unittest/source/name/__init__.py index 61ae70da..1748abbc 100644 --- a/src/cpl_cli/_templates/new/unittest/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/_templates/publish/__init__.py b/src/cpl_cli/_templates/publish/__init__.py index d9c5204c..fafac1c5 100644 --- a/src/cpl_cli/_templates/publish/__init__.py +++ b/src/cpl_cli/_templates/publish/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.publish' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/command/__init__.py b/src/cpl_cli/command/__init__.py index 37e94b7b..770f5f59 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' 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='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/command/new_service.py b/src/cpl_cli/command/new_service.py index 3f1857c2..940d276a 100644 --- a/src/cpl_cli/command/new_service.py +++ b/src/cpl_cli/command/new_service.py @@ -45,6 +45,7 @@ class NewService(CommandABC): self._name: str = '' self._schematic: ProjectTypeEnum = ProjectTypeEnum.console + self._use_nothing: bool = False self._use_application_api: bool = False self._use_startup: bool = False self._use_service_providing: bool = False @@ -169,7 +170,7 @@ class NewService(CommandABC): Gets project information's from user :return: """ - if self._use_application_api or self._use_startup or self._use_service_providing or self._use_async: + if self._use_application_api or self._use_startup or self._use_service_providing or self._use_async or self._use_nothing: Console.set_foreground_color(ForegroundColorEnum.default) Console.write_line('Skipping question due to given flags') return @@ -277,6 +278,7 @@ class NewService(CommandABC): :return: """ if 'nothing' in args: + self._use_nothing = True self._use_async = False self._use_application_api = False self._use_startup = False diff --git a/src/cpl_cli/configuration/__init__.py b/src/cpl_cli/configuration/__init__.py index f33f8123..b1bf3345 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple @@ -30,4 +30,4 @@ from .workspace_settings import WorkspaceSettings from .workspace_settings_name_enum import WorkspaceSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/cpl-cli.json b/src/cpl_cli/cpl-cli.json index 2cdbf03b..e5a3f1bb 100644 --- a/src/cpl_cli/cpl-cli.json +++ b/src/cpl_cli/cpl-cli.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev7" + "Micro": "17.dev8" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17.dev7" + "cpl-core>=2022.6.17.dev8" ], "PythonVersion": ">=3.10", "PythonPath": {}, diff --git a/src/cpl_cli/live_server/__init__.py b/src/cpl_cli/live_server/__init__.py index e8a7744c..6cab5836 100644 --- a/src/cpl_cli/live_server/__init__.py +++ b/src/cpl_cli/live_server/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.live_server' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/publish/__init__.py b/src/cpl_cli/publish/__init__.py index a9989102..08b202f2 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple @@ -24,4 +24,4 @@ from .publisher_abc import PublisherABC from .publisher_service import PublisherService VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/source_creator/__init__.py b/src/cpl_cli/source_creator/__init__.py index 1cb5d1e2..28e7ba67 100644 --- a/src/cpl_cli/source_creator/__init__.py +++ b/src/cpl_cli/source_creator/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.source_creator' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_cli/validators/__init__.py b/src/cpl_cli/validators/__init__.py index 8633839c..0b4f1b7e 100644 --- a/src/cpl_cli/validators/__init__.py +++ b/src/cpl_cli/validators/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.validators' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_core/__init__.py b/src/cpl_core/__init__.py index 4d8ffbe9..e985e960 100644 --- a/src/cpl_core/__init__.py +++ b/src/cpl_core/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_core' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_core/application/__init__.py b/src/cpl_core/application/__init__.py index 31853279..d8ad0d85 100644 --- a/src/cpl_core/application/__init__.py +++ b/src/cpl_core/application/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.application' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple @@ -28,4 +28,4 @@ from .startup_abc import StartupABC from .startup_extension_abc import StartupExtensionABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_core/configuration/__init__.py b/src/cpl_core/configuration/__init__.py index b5fc73a9..8a802ae6 100644 --- a/src/cpl_core/configuration/__init__.py +++ b/src/cpl_core/configuration/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.configuration' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple @@ -34,4 +34,4 @@ from .validator_abc import ValidatorABC from .variable_argument import VariableArgument VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_core/console/__init__.py b/src/cpl_core/console/__init__.py index 10521167..5b16b63e 100644 --- a/src/cpl_core/console/__init__.py +++ b/src/cpl_core/console/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.console' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple @@ -27,4 +27,4 @@ from .foreground_color_enum import ForegroundColorEnum from .spinner_thread import SpinnerThread VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_core/cpl-core.json b/src/cpl_core/cpl-core.json index 27b2dd82..37028396 100644 --- a/src/cpl_core/cpl-core.json +++ b/src/cpl_core/cpl-core.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev7" + "Micro": "17.dev8" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", diff --git a/src/cpl_core/database/__init__.py b/src/cpl_core/database/__init__.py index c93b6226..dfbe4285 100644 --- a/src/cpl_core/database/__init__.py +++ b/src/cpl_core/database/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple @@ -25,4 +25,4 @@ from .database_settings import DatabaseSettings from .table_abc import TableABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_core/database/connection/__init__.py b/src/cpl_core/database/connection/__init__.py index 140f1734..a0e4504c 100644 --- a/src/cpl_core/database/connection/__init__.py +++ b/src/cpl_core/database/connection/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database.connection' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple @@ -24,4 +24,4 @@ from .database_connection import DatabaseConnection from .database_connection_abc import DatabaseConnectionABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_core/database/context/__init__.py b/src/cpl_core/database/context/__init__.py index e23f0598..825fbd5f 100644 --- a/src/cpl_core/database/context/__init__.py +++ b/src/cpl_core/database/context/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.database.context' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple @@ -24,4 +24,4 @@ from .database_context import DatabaseContext from .database_context_abc import DatabaseContextABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_core/dependency_injection/__init__.py b/src/cpl_core/dependency_injection/__init__.py index 3f12ff68..2251a9bf 100644 --- a/src/cpl_core/dependency_injection/__init__.py +++ b/src/cpl_core/dependency_injection/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.dependency_injection' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple @@ -30,4 +30,4 @@ from .service_provider import ServiceProvider from .service_provider_abc import ServiceProviderABC VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_core/environment/__init__.py b/src/cpl_core/environment/__init__.py index fff7d821..0deabdb2 100644 --- a/src/cpl_core/environment/__init__.py +++ b/src/cpl_core/environment/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.environment' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple @@ -25,4 +25,4 @@ from .environment_name_enum import EnvironmentNameEnum from .application_environment import ApplicationEnvironment VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_core/logging/__init__.py b/src/cpl_core/logging/__init__.py index 1473adfb..d0e23b68 100644 --- a/src/cpl_core/logging/__init__.py +++ b/src/cpl_core/logging/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.logging' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple @@ -27,4 +27,4 @@ from .logging_settings import LoggingSettings from .logging_settings_name_enum import LoggingSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_core/mailing/__init__.py b/src/cpl_core/mailing/__init__.py index 83708258..719c40bb 100644 --- a/src/cpl_core/mailing/__init__.py +++ b/src/cpl_core/mailing/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.mailing' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple @@ -27,4 +27,4 @@ from .email_client_settings import EMailClientSettings from .email_client_settings_name_enum import EMailClientSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_core/pipes/__init__.py b/src/cpl_core/pipes/__init__.py index 466f7209..0a2735af 100644 --- a/src/cpl_core/pipes/__init__.py +++ b/src/cpl_core/pipes/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.pipes' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple @@ -29,4 +29,4 @@ from .to_camel_case_pipe import ToCamelCasePipe from .to_snake_case_pipe import ToSnakeCasePipe VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_core/time/__init__.py b/src/cpl_core/time/__init__.py index d0e04f3b..b6e833e1 100644 --- a/src/cpl_core/time/__init__.py +++ b/src/cpl_core/time/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.time' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple @@ -24,4 +24,4 @@ from .time_format_settings import TimeFormatSettings from .time_format_settings_names_enum import TimeFormatSettingsNamesEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_core/utils/__init__.py b/src/cpl_core/utils/__init__.py index c12a51e4..4f51d293 100644 --- a/src/cpl_core/utils/__init__.py +++ b/src/cpl_core/utils/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_core.utils' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple @@ -25,4 +25,4 @@ from .string import String from .pip import Pip VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_query/__init__.py b/src/cpl_query/__init__.py index 71ad1b14..f4bc40d2 100644 --- a/src/cpl_query/__init__.py +++ b/src/cpl_query/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_query' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_query/_query/__init__.py b/src/cpl_query/_query/__init__.py index b148157c..059cab97 100644 --- a/src/cpl_query/_query/__init__.py +++ b/src/cpl_query/_query/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_query._query' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/src/cpl_query/cpl-query.json b/src/cpl_query/cpl-query.json index 18772f6c..355d295b 100644 --- a/src/cpl_query/cpl-query.json +++ b/src/cpl_query/cpl-query.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev7" + "Micro": "17.dev8" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", diff --git a/src/cpl_query/extension/__init__.py b/src/cpl_query/extension/__init__.py index 80fbf742..76f7b2c6 100644 --- a/src/cpl_query/extension/__init__.py +++ b/src/cpl_query/extension/__init__.py @@ -15,7 +15,7 @@ __title__ = 'cpl_query.extension' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev7' +__version__ = '2022.6.17.dev8' from collections import namedtuple @@ -27,4 +27,4 @@ from .ordered_iterable_abc import OrderedIterableABC from .ordered_iterable import OrderedIterable VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev7') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') diff --git a/tools/set_pip_urls/set-pip-urls.json b/tools/set_pip_urls/set-pip-urls.json index 3c2405e6..644962a9 100644 --- a/tools/set_pip_urls/set-pip-urls.json +++ b/tools/set_pip_urls/set-pip-urls.json @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17.dev7" + "cpl-core>=2022.6.17.dev8" ], "PythonVersion": ">=3.10.4", "PythonPath": {}, diff --git a/tools/set_version/application.py b/tools/set_version/application.py index 35948d7e..908d2d38 100644 --- a/tools/set_version/application.py +++ b/tools/set_version/application.py @@ -64,7 +64,10 @@ class Application(ApplicationABC): diff_paths = [] for file in self._git_service.get_diff_files(): - diff_paths.append(os.path.basename(os.path.dirname(file))) + if '/' in file: + diff_paths.append(file.split('/')[1]) + else: + diff_paths.append(os.path.basename(os.path.dirname(file))) try: for project in self._workspace.projects: diff --git a/tools/set_version/set-version.json b/tools/set_version/set-version.json index ebb1bb8d..5ac3d70b 100644 --- a/tools/set_version/set-version.json +++ b/tools/set_version/set-version.json @@ -16,7 +16,7 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core>=2022.6.17.dev7", + "cpl-core>=2022.6.17.dev8", "gitpython==3.1.27" ], "PythonVersion": ">=3.10.4", From 162f06001acf863c4cac1eaef5bb949d240fe0a3 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 23:27:32 +0200 Subject: [PATCH 31/51] Build dev8 & improved cpl new unittests --- unittests/unittests/unittests.json | 4 ++-- unittests/unittests_cli/new_test_case.py | 11 ++++++----- unittests/unittests_cli/unittests_cli.json | 6 +++--- unittests/unittests_core/unittests_core.json | 4 ++-- unittests/unittests_query/unittests_query.json | 6 +++--- unittests/unittests_shared/unittests_shared.json | 4 ++-- 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/unittests/unittests/unittests.json b/unittests/unittests/unittests.json index c9be15f0..1408486c 100644 --- a/unittests/unittests/unittests.json +++ b/unittests/unittests/unittests.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev7" + "Micro": "17.dev8" }, "Author": "", "AuthorEmail": "", @@ -16,7 +16,7 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev7" + "cpl-core>=2022.6.17.dev8" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_cli/new_test_case.py b/unittests/unittests_cli/new_test_case.py index fa2f8070..6b831117 100644 --- a/unittests/unittests_cli/new_test_case.py +++ b/unittests/unittests_cli/new_test_case.py @@ -28,7 +28,8 @@ class NewTestCase(unittest.TestCase): else: self.assertFalse(os.path.isfile(os.path.join(project_path, f'application.py'))) - if '--sp' in args: + # s depends on ab + if '--ab' in args and '--s' in args: self.assertTrue(os.path.isfile(os.path.join(project_path, f'startup.py'))) else: self.assertFalse(os.path.isfile(os.path.join(project_path, f'startup.py'))) @@ -50,10 +51,7 @@ class NewTestCase(unittest.TestCase): os.chdir(os.path.abspath(os.path.join(os.getcwd(), '../'))) def test_console(self): - self._test_project('console', 'test-console', '--ab', '--s', '--sp') - - def test_console_without_sp(self): - self._test_project('console', 'test-console-without-sp', '--ab', '--s') + self._test_project('console', 'test-console', '--ab', '--s') def test_console_without_s(self): self._test_project('console', 'test-console-without-s', '--ab') @@ -61,6 +59,9 @@ class NewTestCase(unittest.TestCase): def test_console_without_ab(self): self._test_project('console', 'test-console-without-ab', '--sp') + def test_console_without_anything(self): + self._test_project('console', 'test-console-without-anything', '--n') + def test_sub_console(self): self._test_sub_project('console', 'test-sub-console', 'test-console', '--ab', '--s', '--sp') diff --git a/unittests/unittests_cli/unittests_cli.json b/unittests/unittests_cli/unittests_cli.json index c8681484..5d0cc83f 100644 --- a/unittests/unittests_cli/unittests_cli.json +++ b/unittests/unittests_cli/unittests_cli.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev7" + "Micro": "17.dev8" }, "Author": "", "AuthorEmail": "", @@ -16,8 +16,8 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev7", - "cpl-cli>=2022.6.17.dev7" + "cpl-core>=2022.6.17.dev8", + "cpl-cli>=2022.6.17.dev8" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_core/unittests_core.json b/unittests/unittests_core/unittests_core.json index f8dedcd3..0286b34d 100644 --- a/unittests/unittests_core/unittests_core.json +++ b/unittests/unittests_core/unittests_core.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev7" + "Micro": "17.dev8" }, "Author": "", "AuthorEmail": "", @@ -16,7 +16,7 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev7" + "cpl-core>=2022.6.17.dev8" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_query/unittests_query.json b/unittests/unittests_query/unittests_query.json index c4f1ed2e..bbb2aa8f 100644 --- a/unittests/unittests_query/unittests_query.json +++ b/unittests/unittests_query/unittests_query.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev7" + "Micro": "17.dev8" }, "Author": "", "AuthorEmail": "", @@ -16,8 +16,8 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev7", - "cpl-query>=2022.6.17.dev7" + "cpl-core>=2022.6.17.dev8", + "cpl-query>=2022.6.17.dev8" ], "PythonVersion": ">=3.10.4", "PythonPath": { diff --git a/unittests/unittests_shared/unittests_shared.json b/unittests/unittests_shared/unittests_shared.json index 9f28e0b7..89c58db2 100644 --- a/unittests/unittests_shared/unittests_shared.json +++ b/unittests/unittests_shared/unittests_shared.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev7" + "Micro": "17.dev8" }, "Author": "", "AuthorEmail": "", @@ -16,7 +16,7 @@ "LicenseName": "", "LicenseDescription": "", "Dependencies": [ - "cpl-core>=2022.6.17.dev7" + "cpl-core>=2022.6.17.dev8" ], "PythonVersion": ">=3.10.4", "PythonPath": { From ff5f9b833d2afdf12c10d78626b7c06c8ecb73f7 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 27 May 2022 18:07:12 +0200 Subject: [PATCH 32/51] Improved unittest for cpl new --- unittests/unittests_cli/new_test_case.py | 31 ++++++++++++++++++++++ unittests/unittests_shared/cli_commands.py | 13 ++++----- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/unittests/unittests_cli/new_test_case.py b/unittests/unittests_cli/new_test_case.py index 6b831117..3013e028 100644 --- a/unittests/unittests_cli/new_test_case.py +++ b/unittests/unittests_cli/new_test_case.py @@ -1,3 +1,4 @@ +import json import os import shutil import unittest @@ -50,6 +51,33 @@ class NewTestCase(unittest.TestCase): self.assertTrue(os.path.join(project_path, f'{name}.json')) os.chdir(os.path.abspath(os.path.join(os.getcwd(), '../'))) + def _test_sub_directory_project(self, project_type: str, directory: str, name: str, workspace_name: str, *args): + os.chdir(os.path.abspath(os.path.join(os.getcwd(), workspace_name))) + CLICommands.new(project_type, f'{directory}/{name}', *args) + workspace_path = os.path.abspath(os.path.join(PLAYGROUND_PATH, workspace_name)) + self.assertTrue(os.path.exists(workspace_path)) + + project_path = os.path.abspath(os.path.join(PLAYGROUND_PATH, workspace_name, f'src/{directory}', String.convert_to_snake_case(name))) + self.assertTrue(os.path.exists(project_path)) + project_file = os.path.join(project_path, f'{name}.json') + self.assertTrue(project_file) + project_json = {} + with open(project_file, 'r', encoding='utf-8') as cfg: + # load json + project_json = json.load(cfg) + cfg.close() + + project_settings = project_json['ProjectSettings'] + build_settings = project_json['BuildSettings'] + + self.assertEqual(project_settings['Name'], name) + self.assertEqual(build_settings['ProjectType'], 'library') + self.assertEqual(build_settings['OutputPath'], '../../dist') + self.assertEqual(build_settings['Main'], f'{String.convert_to_snake_case(name)}.main') + self.assertEqual(build_settings['EntryPoint'], name) + + os.chdir(os.path.abspath(os.path.join(os.getcwd(), '../'))) + def test_console(self): self._test_project('console', 'test-console', '--ab', '--s') @@ -71,6 +99,9 @@ class NewTestCase(unittest.TestCase): def test_sub_library(self): self._test_sub_project('library', 'test-sub-library', 'test-console', '--ab', '--s', '--sp') + def test_sub_directory_library(self): + self._test_sub_directory_project('library', 'directory', 'test-sub-library', 'test-console', '--ab', '--s', '--sp') + def test_unittest(self): self._test_project('unittest', 'test-unittest', '--ab') diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index da9c1ce7..5c04db12 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -7,9 +7,10 @@ from unittests_cli.constants import CLI_PATH class CLICommands: @staticmethod - def _run(cmd: str, *args): + def _run(cmd: str, *args, output=False): env_vars = os.environ - env_vars['CPL_IS_UNITTEST'] = 'YES' + env_vars['CPL_IS_UNITTEST'] = 'NO' if output else 'YES' + command = ['python', CLI_PATH, cmd] for arg in args: command.append(arg) @@ -17,9 +18,9 @@ class CLICommands: subprocess.run(command, env=env_vars) @classmethod - def generate(cls, schematic: str, name: str): - cls._run('generate', schematic, name) + def generate(cls, schematic: str, name: str, output=False): + cls._run('generate', schematic, name, output=output) @classmethod - def new(cls, project_type: str, name: str, *args): - cls._run('new', project_type, name, *args) + def new(cls, project_type: str, name: str, *args, output=False): + cls._run('new', project_type, name, *args, output=output) From beadbf8e91ffbb68020e44c7dc89f94cf5fe62b8 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 27 May 2022 18:17:07 +0200 Subject: [PATCH 33/51] Improved set-version to ignore skipped deps --- tools/set_version/application.py | 4 +++- tools/set_version/version_setter_service.py | 12 +++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/set_version/application.py b/tools/set_version/application.py index 908d2d38..f052750e 100644 --- a/tools/set_version/application.py +++ b/tools/set_version/application.py @@ -70,13 +70,15 @@ class Application(ApplicationABC): diff_paths.append(os.path.basename(os.path.dirname(file))) try: + skipped = [] for project in self._workspace.projects: if project not in diff_paths and String.convert_to_snake_case(project) not in diff_paths and not force: Console.write_line(f'Skipping {project} due to missing changes') + skipped.append(project) continue Console.write_line(f'Set dependencies {self._version_pipe.transform(version)} for {project}') - self._version_setter.set_dependencies(self._workspace.projects[project], version) + self._version_setter.set_dependencies(self._workspace.projects[project], version, skipped=skipped) if not project.startswith('cpl') and not project.startswith('unittest'): Console.write_line(f'Skipping {project}') continue diff --git a/tools/set_version/version_setter_service.py b/tools/set_version/version_setter_service.py index fcc3efaa..0ae94c93 100644 --- a/tools/set_version/version_setter_service.py +++ b/tools/set_version/version_setter_service.py @@ -1,5 +1,8 @@ import json import os +from string import ascii_letters + +from cpl_core.utils import String from cpl_core.console import Console @@ -30,7 +33,7 @@ class VersionSetterService: project_json['ProjectSettings']['Version'] = version self._write_file(file, project_json) - def set_dependencies(self, file: str, version: dict): + def set_dependencies(self, file: str, version: dict, skipped=None): project_json = self._read_file(file) dependencies = project_json['ProjectSettings']['Dependencies'] new_deps = [] @@ -40,6 +43,13 @@ class VersionSetterService: continue dep_version = dependency.split('=')[1] + dep_name = dependency.split('=')[0] + if dep_name[len(dep_name)-1] not in ascii_letters: + dep_name = dep_name[:len(dep_name)-1] + + if skipped is not None and (dep_name in skipped or String.convert_to_snake_case(dep_name) in skipped): + new_deps.append(dependency) + continue new_deps.append(dependency.replace(dep_version, f'{version["Major"]}.{version["Minor"]}.{version["Micro"]}')) project_json['ProjectSettings']['Dependencies'] = new_deps From e5dd89093130c470503393b521f636cf4a2f1ae3 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 27 May 2022 18:57:00 +0200 Subject: [PATCH 34/51] Improved unittest for cpl new & Fixed subdirectory handling with cpl new --- src/cpl_cli/command/new_service.py | 42 +++++++++++++----------- unittests/unittests_cli/new_test_case.py | 3 +- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/cpl_cli/command/new_service.py b/src/cpl_cli/command/new_service.py index 940d276a..73f50ced 100644 --- a/src/cpl_cli/command/new_service.py +++ b/src/cpl_cli/command/new_service.py @@ -44,6 +44,7 @@ class NewService(CommandABC): self._project_json = {} self._name: str = '' + self._rel_path: str = '' self._schematic: ProjectTypeEnum = ProjectTypeEnum.console self._use_nothing: bool = False self._use_application_api: bool = False @@ -83,9 +84,10 @@ class NewService(CommandABC): for name in schematics: Console.write(f'\n\t{name} ') - def _create_project_settings(self, name: str): + def _create_project_settings(self): + self._rel_path = os.path.dirname(self._name) self._project_dict = { - ProjectSettingsNameEnum.name.value: name, + ProjectSettingsNameEnum.name.value: os.path.basename(self._name), ProjectSettingsNameEnum.version.value: { VersionSettingsNameEnum.major.value: '0', VersionSettingsNameEnum.minor.value: '0', @@ -113,15 +115,11 @@ class NewService(CommandABC): self._project.from_dict(self._project_dict) def _create_build_settings(self): - main = f'{String.convert_to_snake_case(self._project.name)}.main' - if self._schematic == ProjectTypeEnum.library.value: - main = f'{String.convert_to_snake_case(self._project.name)}.main' - self._build_dict = { BuildSettingsNameEnum.project_type.value: self._schematic, BuildSettingsNameEnum.source_path.value: '', BuildSettingsNameEnum.output_path.value: '../../dist', - BuildSettingsNameEnum.main.value: main, + BuildSettingsNameEnum.main.value: f'{String.convert_to_snake_case(self._project.name)}.main', BuildSettingsNameEnum.entry_point.value: self._project.name, BuildSettingsNameEnum.include_package_data.value: False, BuildSettingsNameEnum.included.value: [], @@ -151,15 +149,12 @@ class NewService(CommandABC): :return: """ if self._workspace is None: - project_path = os.path.join(self._env.working_directory, self._project.name) + project_path = os.path.join(self._env.working_directory, self._rel_path, self._project.name) else: - project_path = os.path.join( - self._env.working_directory, - 'src', - String.convert_to_snake_case(self._project.name) - ) + project_path = os.path.join(self._env.working_directory, 'src', self._rel_path, String.convert_to_snake_case(self._project.name)) if os.path.isdir(project_path) and len(os.listdir(project_path)) > 0: + Console.write_line(project_path) Console.error('Project path is not empty\n') return None @@ -195,7 +190,7 @@ class NewService(CommandABC): :param args: :return: """ - self._create_project_settings(self._name) + self._create_project_settings() self._create_build_settings() self._create_project_json() path = self._get_project_path() @@ -203,6 +198,9 @@ class NewService(CommandABC): return self._get_project_information() + project_name = self._project.name + if self._rel_path != '': + project_name = f'{self._rel_path}/{project_name}' try: ConsoleBuilder.build( path, @@ -210,7 +208,7 @@ class NewService(CommandABC): self._use_startup, self._use_service_providing, self._use_async, - self._project.name, + project_name, self._project_json, self._workspace ) @@ -223,7 +221,7 @@ class NewService(CommandABC): :param args: :return: """ - self._create_project_settings(self._name) + self._create_project_settings() self._create_build_settings() self._create_project_json() path = self._get_project_path() @@ -231,12 +229,15 @@ class NewService(CommandABC): return self._get_project_information(is_unittest=True) + project_name = self._project.name + if self._rel_path != '': + project_name = f'{self._rel_path}/{project_name}' try: UnittestBuilder.build( path, self._use_application_api, self._use_async, - self._project.name, + project_name, self._project_json, self._workspace ) @@ -249,7 +250,7 @@ class NewService(CommandABC): :param args: :return: """ - self._create_project_settings(self._name) + self._create_project_settings() self._create_build_settings() self._create_project_json() path = self._get_project_path() @@ -257,6 +258,9 @@ class NewService(CommandABC): return self._get_project_information() + project_name = self._project.name + if self._rel_path != '': + project_name = f'{self._rel_path}/{project_name}' try: LibraryBuilder.build( path, @@ -264,7 +268,7 @@ class NewService(CommandABC): self._use_startup, self._use_service_providing, self._use_async, - self._project.name, + project_name, self._project_json, self._workspace ) diff --git a/unittests/unittests_cli/new_test_case.py b/unittests/unittests_cli/new_test_case.py index 3013e028..94bb652c 100644 --- a/unittests/unittests_cli/new_test_case.py +++ b/unittests/unittests_cli/new_test_case.py @@ -60,8 +60,7 @@ class NewTestCase(unittest.TestCase): project_path = os.path.abspath(os.path.join(PLAYGROUND_PATH, workspace_name, f'src/{directory}', String.convert_to_snake_case(name))) self.assertTrue(os.path.exists(project_path)) project_file = os.path.join(project_path, f'{name}.json') - self.assertTrue(project_file) - project_json = {} + self.assertTrue(os.path.exists(project_file)) with open(project_file, 'r', encoding='utf-8') as cfg: # load json project_json = json.load(cfg) From 9fca2018e55c3e199d9067c88c006f047f76a2b7 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 27 May 2022 18:57:12 +0200 Subject: [PATCH 35/51] Build dev10 --- 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/generate/__init__.py | 4 ++-- src/cpl_cli/_templates/new/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/source/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/source/name/__init__.py | 4 ++-- src/cpl_cli/_templates/new/console/source/tests/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/source/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/source/name/__init__.py | 4 ++-- src/cpl_cli/_templates/new/library/source/tests/__init__.py | 4 ++-- src/cpl_cli/_templates/new/unittest/__init__.py | 4 ++-- src/cpl_cli/_templates/new/unittest/source/__init__.py | 4 ++-- src/cpl_cli/_templates/new/unittest/source/name/__init__.py | 4 ++-- src/cpl_cli/_templates/publish/__init__.py | 4 ++-- src/cpl_cli/command/__init__.py | 4 ++-- src/cpl_cli/configuration/__init__.py | 4 ++-- src/cpl_cli/cpl-cli.json | 2 +- src/cpl_cli/live_server/__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 ++-- unittests/unittests_cli/unittests_cli.json | 4 ++-- 25 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/cpl_cli/__init__.py b/src/cpl_cli/__init__.py index 24f73b13..51dbf5a5 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple @@ -27,4 +27,4 @@ from .main import main from .startup import Startup VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/_templates/__init__.py b/src/cpl_cli/_templates/__init__.py index 68b96145..25bbfbe6 100644 --- a/src/cpl_cli/_templates/__init__.py +++ b/src/cpl_cli/_templates/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/_templates/build/__init__.py b/src/cpl_cli/_templates/build/__init__.py index 3912c53b..3e4b72ef 100644 --- a/src/cpl_cli/_templates/build/__init__.py +++ b/src/cpl_cli/_templates/build/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.build' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/_templates/generate/__init__.py b/src/cpl_cli/_templates/generate/__init__.py index 545d4865..b284b1eb 100644 --- a/src/cpl_cli/_templates/generate/__init__.py +++ b/src/cpl_cli/_templates/generate/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.generate' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/_templates/new/__init__.py b/src/cpl_cli/_templates/new/__init__.py index 61127d5d..1d55e913 100644 --- a/src/cpl_cli/_templates/new/__init__.py +++ b/src/cpl_cli/_templates/new/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/_templates/new/console/__init__.py b/src/cpl_cli/_templates/new/console/__init__.py index dee5faba..2844a979 100644 --- a/src/cpl_cli/_templates/new/console/__init__.py +++ b/src/cpl_cli/_templates/new/console/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/_templates/new/console/source/__init__.py b/src/cpl_cli/_templates/new/console/source/__init__.py index fc6d8264..9d5993a1 100644 --- a/src/cpl_cli/_templates/new/console/source/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/_templates/new/console/source/name/__init__.py b/src/cpl_cli/_templates/new/console/source/name/__init__.py index 3cd4ecd6..73b5e446 100644 --- a/src/cpl_cli/_templates/new/console/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/_templates/new/console/source/tests/__init__.py b/src/cpl_cli/_templates/new/console/source/tests/__init__.py index 0f704402..12090cae 100644 --- a/src/cpl_cli/_templates/new/console/source/tests/__init__.py +++ b/src/cpl_cli/_templates/new/console/source/tests/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.console.source.tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/_templates/new/library/__init__.py b/src/cpl_cli/_templates/new/library/__init__.py index 1b96a923..528a3ed3 100644 --- a/src/cpl_cli/_templates/new/library/__init__.py +++ b/src/cpl_cli/_templates/new/library/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/_templates/new/library/source/__init__.py b/src/cpl_cli/_templates/new/library/source/__init__.py index b1f2ad85..d8b99a19 100644 --- a/src/cpl_cli/_templates/new/library/source/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/_templates/new/library/source/name/__init__.py b/src/cpl_cli/_templates/new/library/source/name/__init__.py index 0a2b7e52..2cb90ed0 100644 --- a/src/cpl_cli/_templates/new/library/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/_templates/new/library/source/tests/__init__.py b/src/cpl_cli/_templates/new/library/source/tests/__init__.py index e719eea5..e7b146b9 100644 --- a/src/cpl_cli/_templates/new/library/source/tests/__init__.py +++ b/src/cpl_cli/_templates/new/library/source/tests/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.library.source.tests' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/_templates/new/unittest/__init__.py b/src/cpl_cli/_templates/new/unittest/__init__.py index 1867ff43..70895e74 100644 --- a/src/cpl_cli/_templates/new/unittest/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/_templates/new/unittest/source/__init__.py b/src/cpl_cli/_templates/new/unittest/source/__init__.py index 539ebd18..85a5acfd 100644 --- a/src/cpl_cli/_templates/new/unittest/source/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/source/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest.source' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/_templates/new/unittest/source/name/__init__.py b/src/cpl_cli/_templates/new/unittest/source/name/__init__.py index 1748abbc..ba02fcf1 100644 --- a/src/cpl_cli/_templates/new/unittest/source/name/__init__.py +++ b/src/cpl_cli/_templates/new/unittest/source/name/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.new.unittest.source.name' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/_templates/publish/__init__.py b/src/cpl_cli/_templates/publish/__init__.py index fafac1c5..4c6c7c23 100644 --- a/src/cpl_cli/_templates/publish/__init__.py +++ b/src/cpl_cli/_templates/publish/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli._templates.publish' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/command/__init__.py b/src/cpl_cli/command/__init__.py index 770f5f59..64d2b8a1 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' 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='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/configuration/__init__.py b/src/cpl_cli/configuration/__init__.py index b1bf3345..3ef7fcfd 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple @@ -30,4 +30,4 @@ from .workspace_settings import WorkspaceSettings from .workspace_settings_name_enum import WorkspaceSettingsNameEnum VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/cpl-cli.json b/src/cpl_cli/cpl-cli.json index e5a3f1bb..1f2c75d9 100644 --- a/src/cpl_cli/cpl-cli.json +++ b/src/cpl_cli/cpl-cli.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev8" + "Micro": "17.dev10" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", diff --git a/src/cpl_cli/live_server/__init__.py b/src/cpl_cli/live_server/__init__.py index 6cab5836..b059e535 100644 --- a/src/cpl_cli/live_server/__init__.py +++ b/src/cpl_cli/live_server/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.live_server' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/publish/__init__.py b/src/cpl_cli/publish/__init__.py index 08b202f2..cb7586fa 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 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple @@ -24,4 +24,4 @@ from .publisher_abc import PublisherABC from .publisher_service import PublisherService VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/source_creator/__init__.py b/src/cpl_cli/source_creator/__init__.py index 28e7ba67..fbcf7624 100644 --- a/src/cpl_cli/source_creator/__init__.py +++ b/src/cpl_cli/source_creator/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.source_creator' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/src/cpl_cli/validators/__init__.py b/src/cpl_cli/validators/__init__.py index 0b4f1b7e..0b420956 100644 --- a/src/cpl_cli/validators/__init__.py +++ b/src/cpl_cli/validators/__init__.py @@ -15,11 +15,11 @@ __title__ = 'cpl_cli.validators' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.17.dev8' +__version__ = '2022.6.17.dev10' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='17.dev8') +version_info = VersionInfo(major='2022', minor='6', micro='17.dev10') diff --git a/unittests/unittests_cli/unittests_cli.json b/unittests/unittests_cli/unittests_cli.json index 5d0cc83f..eecb81c0 100644 --- a/unittests/unittests_cli/unittests_cli.json +++ b/unittests/unittests_cli/unittests_cli.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "6", - "Micro": "17.dev8" + "Micro": "17.dev10" }, "Author": "", "AuthorEmail": "", @@ -17,7 +17,7 @@ "LicenseDescription": "", "Dependencies": [ "cpl-core>=2022.6.17.dev8", - "cpl-cli>=2022.6.17.dev8" + "cpl-cli>=2022.6.17.dev10" ], "PythonVersion": ">=3.10.4", "PythonPath": { From 9b56650d4b19e63cdef1b43998393ed683f9da1d Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 3 Jun 2022 23:35:07 +0200 Subject: [PATCH 36/51] Added cpl add test --- src/cpl_cli/main.py | 18 ++++---- unittests/unittests_cli/add_test_case.py | 50 ++++++++++++++++++++-- unittests/unittests_cli/cli_test_suite.py | 3 +- unittests/unittests_shared/cli_commands.py | 4 ++ 4 files changed, 61 insertions(+), 14 deletions(-) diff --git a/src/cpl_cli/main.py b/src/cpl_cli/main.py index 5ccac3ed..4b6959d9 100644 --- a/src/cpl_cli/main.py +++ b/src/cpl_cli/main.py @@ -41,12 +41,12 @@ def main(): if __name__ == '__main__': main() -# (( -# ( `) -# ; / , -# / \/ -# / | -# / ~/ -# / ) ) ~ edraft -# ___// | / -# `--' \_~-, +# (( +# ( `) +# ; / , +# / \/ +# / | +# / ~/ +# / ) ) ~ edraft +# ___// | / +# `--' \_~-, diff --git a/unittests/unittests_cli/add_test_case.py b/unittests/unittests_cli/add_test_case.py index c2f493b3..27964fbe 100644 --- a/unittests/unittests_cli/add_test_case.py +++ b/unittests/unittests_cli/add_test_case.py @@ -1,10 +1,52 @@ +import json +import os +import shutil import unittest +from cpl_core.utils import String + +from unittests_cli.constants import PLAYGROUND_PATH +from unittests_shared.cli_commands import CLICommands + class AddTestCase(unittest.TestCase): - def setUp(self): - pass + def __init__(self, methodName: str): + unittest.TestCase.__init__(self, methodName) + self._source = 'add-test-project' + self._target = 'add-test-library' + self._project_file = f'src/{String.convert_to_snake_case(self._source)}/{self._source}.json' - def test_equal(self): - pass + def _get_project_settings(self): + with open(os.path.join(os.getcwd(), self._project_file), 'r', encoding='utf-8') as cfg: + # load json + project_json = json.load(cfg) + cfg.close() + + return project_json + + def setUp(self): + os.chdir(os.path.abspath(PLAYGROUND_PATH)) + # create projects + CLICommands.new('console', self._source, '--ab', '--s') + os.chdir(os.path.join(os.getcwd(), self._source)) + CLICommands.new('console', self._target, '--ab', '--s') + + def cleanUp(self): + # remove projects + if not os.path.exists(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))): + return + + shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))) + + def test_add(self): + CLICommands.add(self._source, self._target) + settings = self._get_project_settings() + self.assertNotEqual(settings, {}) + self.assertIn('ProjectSettings', settings) + self.assertIn('ProjectReferences', settings['BuildSettings']) + self.assertIn('BuildSettings', settings) + self.assertIn( + f'../{String.convert_to_snake_case(self._target)}/{self._target}.json', + settings['BuildSettings']['ProjectReferences'] + ) diff --git a/unittests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py index f1a7d7ea..ffc3eb95 100644 --- a/unittests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -5,6 +5,7 @@ import unittest from typing import Optional from unittest import TestResult +from unittests_cli.add_test_case import AddTestCase from unittests_cli.constants import PLAYGROUND_PATH from unittests_cli.generate_test_case import GenerateTestCase from unittests_cli.new_test_case import NewTestCase @@ -32,7 +33,7 @@ class CLITestSuite(unittest.TestSuite): # self.addTests(loader.loadTestsFromTestCase(UpdateTestCase)) # workspace needed - # self.addTests(loader.loadTestsFromTestCase(AddTestCase)) + self.addTests(loader.loadTestsFromTestCase(AddTestCase)) # self.addTests(loader.loadTestsFromTestCase(RemoveTestCase)) def _setup(self): diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index 5c04db12..68ed508c 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -17,6 +17,10 @@ class CLICommands: subprocess.run(command, env=env_vars) + @classmethod + def add(cls, source: str, target: str): + cls._run('add', source, target) + @classmethod def generate(cls, schematic: str, name: str, output=False): cls._run('generate', schematic, name, output=output) From dad4913bcdb1a73575d6ef52c7aa2e229444ada7 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 3 Jun 2022 23:44:26 +0200 Subject: [PATCH 37/51] Added cpl remove test --- unittests/unittests_cli/cli_test_suite.py | 3 ++- unittests/unittests_cli/remove_test_case.py | 30 ++++++++++++++++++--- unittests/unittests_shared/cli_commands.py | 4 +++ 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/unittests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py index ffc3eb95..58638afb 100644 --- a/unittests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -9,6 +9,7 @@ from unittests_cli.add_test_case import AddTestCase from unittests_cli.constants import PLAYGROUND_PATH from unittests_cli.generate_test_case import GenerateTestCase from unittests_cli.new_test_case import NewTestCase +from unittests_cli.remove_test_case import RemoveTestCase class CLITestSuite(unittest.TestSuite): @@ -34,7 +35,7 @@ class CLITestSuite(unittest.TestSuite): # workspace needed self.addTests(loader.loadTestsFromTestCase(AddTestCase)) - # self.addTests(loader.loadTestsFromTestCase(RemoveTestCase)) + self.addTests(loader.loadTestsFromTestCase(RemoveTestCase)) def _setup(self): try: diff --git a/unittests/unittests_cli/remove_test_case.py b/unittests/unittests_cli/remove_test_case.py index a600c283..a397c44f 100644 --- a/unittests/unittests_cli/remove_test_case.py +++ b/unittests/unittests_cli/remove_test_case.py @@ -1,10 +1,32 @@ +import json +import os +import shutil import unittest +from cpl_core.utils import String + +from unittests_cli.constants import PLAYGROUND_PATH +from unittests_shared.cli_commands import CLICommands + class RemoveTestCase(unittest.TestCase): - def setUp(self): - pass + def __init__(self, methodName: str): + unittest.TestCase.__init__(self, methodName) + self._source = 'add-test-project' + self._target = 'add-test-library' + self._project_file = f'src/{String.convert_to_snake_case(self._source)}/{self._source}.json' - def test_equal(self): - pass + def setUp(self): + os.chdir(os.path.abspath(PLAYGROUND_PATH)) + # create projects + CLICommands.new('console', self._source, '--ab', '--s') + os.chdir(os.path.join(os.getcwd(), self._source)) + CLICommands.new('console', self._target, '--ab', '--s') + + def test_remove(self): + CLICommands.remove(self._target) + path = os.path.abspath(os.path.join(os.getcwd(), f'../{String.convert_to_snake_case(self._target)}')) + self.assertTrue(os.path.exists(os.getcwd())) + self.assertTrue(os.path.exists(os.path.join(os.getcwd(), self._project_file))) + self.assertFalse(os.path.exists(path)) diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index 68ed508c..dd1e0029 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -28,3 +28,7 @@ class CLICommands: @classmethod def new(cls, project_type: str, name: str, *args, output=False): cls._run('new', project_type, name, *args, output=output) + + @classmethod + def remove(cls, project: str): + cls._run('remove', project) From 77c560b40cfcfb774dc51f906bb1a8474655d4e2 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 3 Jun 2022 23:46:03 +0200 Subject: [PATCH 38/51] Improved cpl remove test --- unittests/unittests_cli/remove_test_case.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/unittests/unittests_cli/remove_test_case.py b/unittests/unittests_cli/remove_test_case.py index a397c44f..b61a5d3f 100644 --- a/unittests/unittests_cli/remove_test_case.py +++ b/unittests/unittests_cli/remove_test_case.py @@ -17,6 +17,14 @@ class RemoveTestCase(unittest.TestCase): self._target = 'add-test-library' self._project_file = f'src/{String.convert_to_snake_case(self._source)}/{self._source}.json' + def _get_project_settings(self): + with open(os.path.join(os.getcwd(), self._project_file), 'r', encoding='utf-8') as cfg: + # load json + project_json = json.load(cfg) + cfg.close() + + return project_json + def setUp(self): os.chdir(os.path.abspath(PLAYGROUND_PATH)) # create projects @@ -30,3 +38,11 @@ class RemoveTestCase(unittest.TestCase): self.assertTrue(os.path.exists(os.getcwd())) self.assertTrue(os.path.exists(os.path.join(os.getcwd(), self._project_file))) self.assertFalse(os.path.exists(path)) + settings = self._get_project_settings() + self.assertIn('ProjectSettings', settings) + self.assertIn('ProjectReferences', settings['BuildSettings']) + self.assertIn('BuildSettings', settings) + self.assertNotIn( + f'../{String.convert_to_snake_case(self._target)}/{self._target}.json', + settings['BuildSettings']['ProjectReferences'] + ) From 89d591ce0a827aeed91ef0a35bc960316babb7e8 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sat, 4 Jun 2022 00:36:31 +0200 Subject: [PATCH 39/51] Added project reference handling in cpl remove --- src/cpl_cli/command/remove_service.py | 54 +++++++++++++++++++-- unittests/unittests_cli/remove_test_case.py | 1 + 2 files changed, 52 insertions(+), 3 deletions(-) diff --git a/src/cpl_cli/command/remove_service.py b/src/cpl_cli/command/remove_service.py index 42462219..87db8b7a 100644 --- a/src/cpl_cli/command/remove_service.py +++ b/src/cpl_cli/command/remove_service.py @@ -3,12 +3,14 @@ import shutil import json import textwrap +from cpl_cli.configuration.settings_helper import SettingsHelper + from cpl_core.configuration.configuration_abc import ConfigurationABC from cpl_core.console.console import Console from cpl_core.console.foreground_color_enum import ForegroundColorEnum from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC from cpl_cli.command_abc import CommandABC -from cpl_cli.configuration import WorkspaceSettings, WorkspaceSettingsNameEnum +from cpl_cli.configuration import WorkspaceSettings, WorkspaceSettingsNameEnum, BuildSettingsNameEnum, ProjectSettings, BuildSettings class RemoveService(CommandABC): @@ -68,6 +70,50 @@ class RemoveService(CommandABC): self._create_file(path, ws_dict) + def _get_project_settings(self, project: str) -> dict: + with open(os.path.join(os.getcwd(), self._workspace.projects[project]), 'r', encoding='utf-8') as cfg: + # load json + project_json = json.load(cfg) + cfg.close() + + return project_json + + def _write_project_settings(self, project: str, project_settings: dict, build_settings: dict): + with open(os.path.join(os.getcwd(), self._workspace.projects[project]), 'w', encoding='utf-8') as file: + file.write(json.dumps({ + ProjectSettings.__name__: project_settings, + BuildSettings.__name__: build_settings + }, indent=2)) + file.close() + + def _find_deps_in_projects(self, project_name: str, rel_path: str): + for project in self._workspace.projects: + if project == project_name: + continue + + project_settings = self._get_project_settings(project) + if BuildSettings.__name__ not in project_settings or BuildSettingsNameEnum.project_references.value not in project_settings[BuildSettings.__name__]: + continue + + ref_to_delete = '' + for ref in project_settings[BuildSettings.__name__][BuildSettingsNameEnum.project_references.value]: + if os.path.basename(ref) == f'{project_name}.json': + ref_to_delete = ref + + if ref_to_delete not in project_settings[BuildSettings.__name__][BuildSettingsNameEnum.project_references.value]: + continue + + project_settings[BuildSettings.__name__][BuildSettingsNameEnum.project_references.value].remove(ref_to_delete) + Console.spinner( + f'Removing {project_name} from {project}', + self._write_project_settings, + project, + project_settings[ProjectSettings.__name__], + project_settings[BuildSettings.__name__], + text_foreground_color=ForegroundColorEnum.green, + spinner_foreground_color=ForegroundColorEnum.cyan + ) + def execute(self, args: list[str]): """ Entry point of command @@ -88,15 +134,17 @@ class RemoveService(CommandABC): Console.error(f'Project {project_name} is the default project.') return - src_path = os.path.abspath(os.path.dirname(self._workspace.projects[project_name])) + src_path = os.path.dirname(self._workspace.projects[project_name]) Console.spinner( f'Removing {src_path}', self._remove_sources, - src_path, + os.path.abspath(src_path), text_foreground_color=ForegroundColorEnum.green, spinner_foreground_color=ForegroundColorEnum.cyan ) + self._find_deps_in_projects(project_name, src_path) + del self._workspace.projects[project_name] path = 'cpl-workspace.json' Console.spinner( diff --git a/unittests/unittests_cli/remove_test_case.py b/unittests/unittests_cli/remove_test_case.py index b61a5d3f..e53d9f1a 100644 --- a/unittests/unittests_cli/remove_test_case.py +++ b/unittests/unittests_cli/remove_test_case.py @@ -31,6 +31,7 @@ class RemoveTestCase(unittest.TestCase): CLICommands.new('console', self._source, '--ab', '--s') os.chdir(os.path.join(os.getcwd(), self._source)) CLICommands.new('console', self._target, '--ab', '--s') + CLICommands.add(self._source, self._target) def test_remove(self): CLICommands.remove(self._target) From c0789cf4f7a6ed5640de4823f50375246a830f28 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Tue, 21 Jun 2022 08:56:26 +0200 Subject: [PATCH 40/51] Added tests for install command --- src/cpl_cli/command/version_service.py | 1 - unittests/unittests_cli/cli_test_suite.py | 3 +- unittests/unittests_cli/install_test_case.py | 85 +++++++++++++++++++- unittests/unittests_shared/cli_commands.py | 4 + 4 files changed, 87 insertions(+), 6 deletions(-) diff --git a/src/cpl_cli/command/version_service.py b/src/cpl_cli/command/version_service.py index 5e93660f..7b74b007 100644 --- a/src/cpl_cli/command/version_service.py +++ b/src/cpl_cli/command/version_service.py @@ -5,7 +5,6 @@ import pkg_resources import textwrap import cpl_cli -import cpl_core from cpl_core.console.console import Console from cpl_core.console.foreground_color_enum import ForegroundColorEnum from cpl_cli.command_abc import CommandABC diff --git a/unittests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py index 58638afb..626902b4 100644 --- a/unittests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -8,6 +8,7 @@ from unittest import TestResult from unittests_cli.add_test_case import AddTestCase from unittests_cli.constants import PLAYGROUND_PATH from unittests_cli.generate_test_case import GenerateTestCase +from unittests_cli.install_test_case import InstallTestCase from unittests_cli.new_test_case import NewTestCase from unittests_cli.remove_test_case import RemoveTestCase @@ -26,7 +27,7 @@ class CLITestSuite(unittest.TestSuite): # project needed # self.addTests(loader.loadTestsFromTestCase(BuildTestCase)) - # self.addTests(loader.loadTestsFromTestCase(InstallTestCase)) + self.addTests(loader.loadTestsFromTestCase(InstallTestCase)) # self.addTests(loader.loadTestsFromTestCase(PublishTestCase)) # self.addTests(loader.loadTestsFromTestCase(RunTestCase)) # self.addTests(loader.loadTestsFromTestCase(StartTestCase)) diff --git a/unittests/unittests_cli/install_test_case.py b/unittests/unittests_cli/install_test_case.py index 0271f37b..bb992206 100644 --- a/unittests/unittests_cli/install_test_case.py +++ b/unittests/unittests_cli/install_test_case.py @@ -1,10 +1,87 @@ +import json +import os +import shutil import unittest +import pkg_resources + +from cpl_core.utils import String + +from unittests_cli.constants import PLAYGROUND_PATH +from unittests_shared.cli_commands import CLICommands + class InstallTestCase(unittest.TestCase): - def setUp(self): - pass + def __init__(self, methodName: str): + unittest.TestCase.__init__(self, methodName) + self._source = 'install-test-source' + self._project_file = f'src/{String.convert_to_snake_case(self._source)}/{self._source}.json' + + def _get_project_settings(self): + with open(os.path.join(os.getcwd(), self._project_file), 'r', encoding='utf-8') as cfg: + # load json + project_json = json.load(cfg) + cfg.close() + + return project_json + + def _save_project_settings(self, settings: dict): + with open(os.path.join(os.getcwd(), self._project_file), 'w', encoding='utf-8') as project_file: + project_file.write(json.dumps(settings, indent=2)) + project_file.close() + + def setUp(self): + os.chdir(os.path.abspath(PLAYGROUND_PATH)) + # create projects + CLICommands.new('console', self._source, '--ab', '--s') + os.chdir(os.path.join(os.getcwd(), self._source)) + + def cleanUp(self): + # remove projects + if not os.path.exists(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))): + return + + shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))) + + def test_install_package(self): + version = '1.7.3' + package_name = 'discord.py' + package = f'{package_name}=={version}' + CLICommands.install(package) + settings = self._get_project_settings() + self.assertNotEqual(settings, {}) + self.assertIn('ProjectSettings', settings) + self.assertIn('Dependencies', settings['ProjectSettings']) + self.assertIn( + package, + settings['ProjectSettings']['Dependencies'] + ) + packages = dict(tuple(str(ws).split()) for ws in pkg_resources.working_set) + self.assertIn(package_name, packages) + self.assertEqual(version, packages[package_name]) + + def test_install_all(self): + version = '1.7.3' + package_name = 'discord.py' + package = f'{package_name}=={version}' + settings = self._get_project_settings() + self.assertIn('ProjectSettings', settings) + self.assertIn('Dependencies', settings['ProjectSettings']) + self.assertNotIn( + package, + settings['ProjectSettings']['Dependencies'] + ) + settings['ProjectSettings']['Dependencies'].append(package) + self._save_project_settings(settings) + CLICommands.install() + new_settings = self._get_project_settings() + self.assertEqual(settings, new_settings) + self.assertIn('ProjectSettings', new_settings) + self.assertIn('Dependencies', new_settings['ProjectSettings']) + self.assertIn( + package, + new_settings['ProjectSettings']['Dependencies'] + ) + - def test_equal(self): - pass diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index dd1e0029..cccfb675 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -25,6 +25,10 @@ class CLICommands: def generate(cls, schematic: str, name: str, output=False): cls._run('generate', schematic, name, output=output) + @classmethod + def install(cls, package: str = '', output=False): + cls._run('install', package, output=output) + @classmethod def new(cls, project_type: str, name: str, *args, output=False): cls._run('new', project_type, name, *args, output=output) From 2925788d019ebe066007afbfcb6ebf27af62caf5 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Tue, 21 Jun 2022 09:24:56 +0200 Subject: [PATCH 41/51] Added tests for uninstall command --- src/cpl_cli/command/uninstall_service.py | 6 +- unittests/unittests_cli/cli_test_suite.py | 16 +++++- .../unittests_cli/uninstall_test_case.py | 56 +++++++++++++++++-- unittests/unittests_shared/cli_commands.py | 4 ++ 4 files changed, 74 insertions(+), 8 deletions(-) diff --git a/src/cpl_cli/command/uninstall_service.py b/src/cpl_cli/command/uninstall_service.py index c5c132c4..f2b88d5f 100644 --- a/src/cpl_cli/command/uninstall_service.py +++ b/src/cpl_cli/command/uninstall_service.py @@ -35,6 +35,7 @@ class UninstallService(CommandABC): self._is_simulating = False self._is_virtual = False + self._project_file = f'{self._project_settings.name}.json' @property def help_message(self) -> str: @@ -59,8 +60,7 @@ class UninstallService(CommandABC): Console.error(f'Expected package') Console.error(f'Usage: cpl uninstall ') return - - + if '--virtual' in args: self._is_virtual = True args.remove('--virtual') @@ -110,7 +110,7 @@ class UninstallService(CommandABC): ProjectSettings.__name__: SettingsHelper.get_project_settings_dict(self._project_settings), BuildSettings.__name__: SettingsHelper.get_build_settings_dict(self._build_settings) } - with open(os.path.join(self._env.working_directory, f'{self._config.get_configuration("ProjectName")}.json'), 'w') as project_file: + with open(os.path.join(self._env.working_directory, self._project_file), 'w') as project_file: project_file.write(json.dumps(config, indent=2)) project_file.close() diff --git a/unittests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py index 626902b4..a0e49f09 100644 --- a/unittests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -11,6 +11,7 @@ from unittests_cli.generate_test_case import GenerateTestCase from unittests_cli.install_test_case import InstallTestCase from unittests_cli.new_test_case import NewTestCase from unittests_cli.remove_test_case import RemoveTestCase +from unittests_cli.uninstall_test_case import UninstallTestCase class CLITestSuite(unittest.TestSuite): @@ -23,15 +24,28 @@ class CLITestSuite(unittest.TestSuite): # nothing needed self.addTests(loader.loadTestsFromTestCase(GenerateTestCase)) self.addTests(loader.loadTestsFromTestCase(NewTestCase)) + + # compare console output # self.addTests(loader.loadTestsFromTestCase(VersionTestCase)) # project needed + # compare two file states/directory content # self.addTests(loader.loadTestsFromTestCase(BuildTestCase)) + self.addTests(loader.loadTestsFromTestCase(InstallTestCase)) + + # compare two file states/directory content # self.addTests(loader.loadTestsFromTestCase(PublishTestCase)) + + # check if application was executed properly # self.addTests(loader.loadTestsFromTestCase(RunTestCase)) + + # check if application was executed properly and file watcher is working # self.addTests(loader.loadTestsFromTestCase(StartTestCase)) - # self.addTests(loader.loadTestsFromTestCase(UninstallTestCase)) + + self.addTests(loader.loadTestsFromTestCase(UninstallTestCase)) + + # check in project settings if package is updated # self.addTests(loader.loadTestsFromTestCase(UpdateTestCase)) # workspace needed diff --git a/unittests/unittests_cli/uninstall_test_case.py b/unittests/unittests_cli/uninstall_test_case.py index f3d1ae15..66bde537 100644 --- a/unittests/unittests_cli/uninstall_test_case.py +++ b/unittests/unittests_cli/uninstall_test_case.py @@ -1,10 +1,58 @@ +import json +import os +import shutil +import time import unittest +import pkg_resources + +from cpl_core.utils import String + +from unittests_cli.constants import PLAYGROUND_PATH +from unittests_shared.cli_commands import CLICommands + class UninstallTestCase(unittest.TestCase): - def setUp(self): - pass + def __init__(self, methodName: str): + unittest.TestCase.__init__(self, methodName) + self._source = 'uninstall-test-source' + self._project_file = f'src/{String.convert_to_snake_case(self._source)}/{self._source}.json' + self._version = '1.7.3' + self._package_name = 'discord.py' + self._package = f'{self._package_name}=={self._version}' - def test_equal(self): - pass + def _get_project_settings(self): + with open(os.path.join(os.getcwd(), self._project_file), 'r', encoding='utf-8') as cfg: + # load json + project_json = json.load(cfg) + cfg.close() + + return project_json + + def setUp(self): + os.chdir(os.path.abspath(PLAYGROUND_PATH)) + # create projects + CLICommands.new('console', self._source, '--ab', '--s') + os.chdir(os.path.join(os.getcwd(), self._source)) + CLICommands.install(self._package) + + def cleanUp(self): + # remove projects + if not os.path.exists(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))): + return + + shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))) + + def test_uninstall(self): + CLICommands.uninstall(self._package) + settings = self._get_project_settings() + self.assertNotEqual(settings, {}) + self.assertIn('ProjectSettings', settings) + self.assertIn('Dependencies', settings['ProjectSettings']) + self.assertNotIn( + self._package, + settings['ProjectSettings']['Dependencies'] + ) + packages = dict(tuple(str(ws).split()) for ws in pkg_resources.working_set) + self.assertNotIn(self._package_name, packages) diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index cccfb675..41ab4b4c 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -36,3 +36,7 @@ class CLICommands: @classmethod def remove(cls, project: str): cls._run('remove', project) + + @classmethod + def uninstall(cls, package: str, output=False): + cls._run('uninstall', package, output=output) From 32478926c8a0b2659d5cee1dd87aff1383371e76 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 23 Jun 2022 21:49:44 +0200 Subject: [PATCH 42/51] Added tests for build command --- src/cpl_cli/publish/publisher_service.py | 4 +- unittests/unittests_cli/build_test_case.py | 86 +++++++++++++++++++++- unittests/unittests_cli/cli_test_suite.py | 48 ++++++------ unittests/unittests_shared/cli_commands.py | 4 + 4 files changed, 115 insertions(+), 27 deletions(-) diff --git a/src/cpl_cli/publish/publisher_service.py b/src/cpl_cli/publish/publisher_service.py index dc85215c..64988545 100644 --- a/src/cpl_cli/publish/publisher_service.py +++ b/src/cpl_cli/publish/publisher_service.py @@ -426,7 +426,7 @@ class PublisherService(PublisherABC): :return: """ self._env.set_working_directory(os.path.join(self._env.working_directory, '../')) - self.exclude(f'*/{self._config.get_configuration("ProjectName")}.json') + self.exclude(f'*/{self._project_settings.name}.json') self._output_path = os.path.abspath(os.path.join(self._output_path, self._project_settings.name, 'build')) Console.spinner('Reading source files:', self._read_sources, text_foreground_color=ForegroundColorEnum.green, @@ -449,7 +449,7 @@ class PublisherService(PublisherABC): :return: """ self._env.set_working_directory(os.path.join(self._env.working_directory, '../')) - self.exclude(f'*/{self._config.get_configuration("ProjectName")}.json') + self.exclude(f'*/{self._project_settings.name}.json') self._output_path = os.path.abspath(os.path.join(self._output_path, self._project_settings.name, 'publish')) Console.write_line('Build:') diff --git a/unittests/unittests_cli/build_test_case.py b/unittests/unittests_cli/build_test_case.py index 2456c099..e35d5cbd 100644 --- a/unittests/unittests_cli/build_test_case.py +++ b/unittests/unittests_cli/build_test_case.py @@ -1,10 +1,88 @@ +import filecmp +import json +import os +import shutil import unittest +from cpl_core.utils import String + +from unittests_cli.constants import PLAYGROUND_PATH +from unittests_shared.cli_commands import CLICommands + class BuildTestCase(unittest.TestCase): - def setUp(self): - pass + def __init__(self, methodName: str): + unittest.TestCase.__init__(self, methodName) + self._source = 'build-test-source' + self._project_file = f'src/{String.convert_to_snake_case(self._source)}/{self._source}.json' - def test_equal(self): - pass + def _get_project_settings(self): + with open(os.path.join(os.getcwd(), self._project_file), 'r', encoding='utf-8') as cfg: + # load json + project_json = json.load(cfg) + cfg.close() + + return project_json + + def _save_project_settings(self, settings: dict): + with open(os.path.join(os.getcwd(), self._project_file), 'w', encoding='utf-8') as project_file: + project_file.write(json.dumps(settings, indent=2)) + project_file.close() + + def setUp(self): + os.chdir(os.path.abspath(PLAYGROUND_PATH)) + # create projects + CLICommands.new('console', self._source, '--ab', '--s') + os.chdir(os.path.join(os.getcwd(), self._source)) + + def cleanUp(self): + # remove projects + if not os.path.exists(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))): + return + + shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))) + + def _are_dir_trees_equal(self, dir1, dir2): + """ + found at https://stackoverflow.com/questions/4187564/recursively-compare-two-directories-to-ensure-they-have-the-same-files-and-subdi + + Compare two directories recursively. Files in each directory are + assumed to be equal if their names and contents are equal. + + @param dir1: First directory path + @param dir2: Second directory path + + @return: True if the directory trees are the same and + there were no errors while accessing the directories or files, + False otherwise. + """ + + dirs_cmp = filecmp.dircmp(dir1, dir2) + if len(dirs_cmp.left_only) > 0 or len(dirs_cmp.right_only) > 0 or len(dirs_cmp.funny_files) > 0: + return False + + (_, mismatch, errors) = filecmp.cmpfiles(dir1, dir2, dirs_cmp.common_files, shallow=False) + + if len(mismatch) > 0 or len(errors) > 0: + return False + + for common_dir in dirs_cmp.common_dirs: + new_dir1 = os.path.join(dir1, common_dir) + new_dir2 = os.path.join(dir2, common_dir) + if not self._are_dir_trees_equal(new_dir1, new_dir2): + return False + + return True + + def test_build(self): + CLICommands.build() + dist_path = './dist' + full_dist_path = f'{dist_path}/{self._source}/build/{String.convert_to_snake_case(self._source)}' + self.assertTrue(os.path.exists(dist_path)) + self.assertTrue(os.path.exists(full_dist_path)) + self.assertFalse(self._are_dir_trees_equal(f'./src/{String.convert_to_snake_case(self._source)}', full_dist_path)) + with open(f'{full_dist_path}/{self._source}.json', 'w') as file: + file.write(json.dumps(self._get_project_settings(), indent=2)) + file.close() + self.assertTrue(self._are_dir_trees_equal(f'./src/{String.convert_to_snake_case(self._source)}', full_dist_path)) diff --git a/unittests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py index a0e49f09..fac4682b 100644 --- a/unittests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -6,12 +6,14 @@ from typing import Optional from unittest import TestResult from unittests_cli.add_test_case import AddTestCase +from unittests_cli.build_test_case import BuildTestCase from unittests_cli.constants import PLAYGROUND_PATH from unittests_cli.generate_test_case import GenerateTestCase from unittests_cli.install_test_case import InstallTestCase from unittests_cli.new_test_case import NewTestCase from unittests_cli.remove_test_case import RemoveTestCase from unittests_cli.uninstall_test_case import UninstallTestCase +from unittests_cli.update_test_case import UpdateTestCase class CLITestSuite(unittest.TestSuite): @@ -21,36 +23,40 @@ class CLITestSuite(unittest.TestSuite): loader = unittest.TestLoader() self._result: Optional[TestResult] = None - # nothing needed - self.addTests(loader.loadTestsFromTestCase(GenerateTestCase)) - self.addTests(loader.loadTestsFromTestCase(NewTestCase)) - # compare console output - # self.addTests(loader.loadTestsFromTestCase(VersionTestCase)) + active_tests = [ + # nothing needed + GenerateTestCase, + NewTestCase, - # project needed - # compare two file states/directory content - # self.addTests(loader.loadTestsFromTestCase(BuildTestCase)) + # compare console output + # VersionTestCase, - self.addTests(loader.loadTestsFromTestCase(InstallTestCase)) + # project needed + # compare two file states/directory content + BuildTestCase, + InstallTestCase, - # compare two file states/directory content - # self.addTests(loader.loadTestsFromTestCase(PublishTestCase)) + # compare two file states/directory content + # PublishTestCase, - # check if application was executed properly - # self.addTests(loader.loadTestsFromTestCase(RunTestCase)) + # check if application was executed properly + # RunTestCase, - # check if application was executed properly and file watcher is working - # self.addTests(loader.loadTestsFromTestCase(StartTestCase)) + # check if application was executed properly and file watcher is working + # StartTestCase, - self.addTests(loader.loadTestsFromTestCase(UninstallTestCase)) + UninstallTestCase, + # check in project settings if package is updated + # UpdateTestCase, - # check in project settings if package is updated - # self.addTests(loader.loadTestsFromTestCase(UpdateTestCase)) + # workspace needed + AddTestCase, + RemoveTestCase + ] - # workspace needed - self.addTests(loader.loadTestsFromTestCase(AddTestCase)) - self.addTests(loader.loadTestsFromTestCase(RemoveTestCase)) + for test in active_tests: + self.addTests(loader.loadTestsFromTestCase(test)) def _setup(self): try: diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index 41ab4b4c..431e6d13 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -21,6 +21,10 @@ class CLICommands: def add(cls, source: str, target: str): cls._run('add', source, target) + @classmethod + def build(cls): + cls._run('build') + @classmethod def generate(cls, schematic: str, name: str, output=False): cls._run('generate', schematic, name, output=output) From 9e978f3ece005da838d9a8d3bf122c2553109c08 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 23 Jun 2022 23:39:41 +0200 Subject: [PATCH 43/51] Fixed tests for un/install commands --- unittests/unittests_cli/install_test_case.py | 13 +++++++++++-- unittests/unittests_cli/uninstall_test_case.py | 12 +++++++----- unittests/unittests_shared/cli_commands.py | 6 +++++- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/unittests/unittests_cli/install_test_case.py b/unittests/unittests_cli/install_test_case.py index bb992206..4986ba15 100644 --- a/unittests/unittests_cli/install_test_case.py +++ b/unittests/unittests_cli/install_test_case.py @@ -1,6 +1,8 @@ import json import os import shutil +import subprocess +import sys import unittest import pkg_resources @@ -44,6 +46,10 @@ class InstallTestCase(unittest.TestCase): shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))) + def _get_installed_packages(self) -> dict: + reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze']) + return dict([tuple(r.decode().split('==')) for r in reqs.split()]) + def test_install_package(self): version = '1.7.3' package_name = 'discord.py' @@ -57,11 +63,11 @@ class InstallTestCase(unittest.TestCase): package, settings['ProjectSettings']['Dependencies'] ) - packages = dict(tuple(str(ws).split()) for ws in pkg_resources.working_set) + packages = self._get_installed_packages() self.assertIn(package_name, packages) self.assertEqual(version, packages[package_name]) - def test_install_all(self): + def _test_install_all(self): version = '1.7.3' package_name = 'discord.py' package = f'{package_name}=={version}' @@ -83,5 +89,8 @@ class InstallTestCase(unittest.TestCase): package, new_settings['ProjectSettings']['Dependencies'] ) + packages = self._get_installed_packages() + self.assertIn(package_name, packages) + self.assertEqual(version, packages[package_name]) diff --git a/unittests/unittests_cli/uninstall_test_case.py b/unittests/unittests_cli/uninstall_test_case.py index 66bde537..ac29aaf3 100644 --- a/unittests/unittests_cli/uninstall_test_case.py +++ b/unittests/unittests_cli/uninstall_test_case.py @@ -1,13 +1,11 @@ import json import os import shutil -import time +import subprocess +import sys import unittest -import pkg_resources - from cpl_core.utils import String - from unittests_cli.constants import PLAYGROUND_PATH from unittests_shared.cli_commands import CLICommands @@ -44,6 +42,10 @@ class UninstallTestCase(unittest.TestCase): shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))) + def _get_installed_packages(self) -> dict: + reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze']) + return dict([tuple(r.decode().split('==')) for r in reqs.split()]) + def test_uninstall(self): CLICommands.uninstall(self._package) settings = self._get_project_settings() @@ -54,5 +56,5 @@ class UninstallTestCase(unittest.TestCase): self._package, settings['ProjectSettings']['Dependencies'] ) - packages = dict(tuple(str(ws).split()) for ws in pkg_resources.working_set) + packages = self._get_installed_packages() self.assertNotIn(self._package_name, packages) diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index 431e6d13..e11b1274 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -30,7 +30,11 @@ class CLICommands: cls._run('generate', schematic, name, output=output) @classmethod - def install(cls, package: str = '', output=False): + def install(cls, package: str = None, output=False): + if package is None: + cls._run('install', output=output) + return + cls._run('install', package, output=output) @classmethod From 6e50d0cb228f13fa44f01c6dfccf14f5c06fbc2f Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 23 Jun 2022 23:47:29 +0200 Subject: [PATCH 44/51] Added tests for publish command --- unittests/unittests_cli/cli_test_suite.py | 12 +-- unittests/unittests_cli/publish_test_case.py | 90 +++++++++++++++++++- unittests/unittests_shared/cli_commands.py | 4 + 3 files changed, 92 insertions(+), 14 deletions(-) diff --git a/unittests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py index fac4682b..cac0af7d 100644 --- a/unittests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -11,6 +11,7 @@ from unittests_cli.constants import PLAYGROUND_PATH from unittests_cli.generate_test_case import GenerateTestCase from unittests_cli.install_test_case import InstallTestCase from unittests_cli.new_test_case import NewTestCase +from unittests_cli.publish_test_case import PublishTestCase from unittests_cli.remove_test_case import RemoveTestCase from unittests_cli.uninstall_test_case import UninstallTestCase from unittests_cli.update_test_case import UpdateTestCase @@ -28,28 +29,19 @@ class CLITestSuite(unittest.TestSuite): # nothing needed GenerateTestCase, NewTestCase, - # compare console output # VersionTestCase, - # project needed - # compare two file states/directory content BuildTestCase, InstallTestCase, - - # compare two file states/directory content - # PublishTestCase, - + PublishTestCase, # check if application was executed properly # RunTestCase, - # check if application was executed properly and file watcher is working # StartTestCase, - UninstallTestCase, # check in project settings if package is updated # UpdateTestCase, - # workspace needed AddTestCase, RemoveTestCase diff --git a/unittests/unittests_cli/publish_test_case.py b/unittests/unittests_cli/publish_test_case.py index bad55d55..7c828ced 100644 --- a/unittests/unittests_cli/publish_test_case.py +++ b/unittests/unittests_cli/publish_test_case.py @@ -1,10 +1,92 @@ +import filecmp +import json +import os +import shutil import unittest +from cpl_core.utils import String + +from unittests_cli.constants import PLAYGROUND_PATH +from unittests_shared.cli_commands import CLICommands + class PublishTestCase(unittest.TestCase): - def setUp(self): - pass + def __init__(self, methodName: str): + unittest.TestCase.__init__(self, methodName) + self._source = 'publish-test-source' + self._project_file = f'src/{String.convert_to_snake_case(self._source)}/{self._source}.json' - def test_equal(self): - pass + def _get_project_settings(self): + with open(os.path.join(os.getcwd(), self._project_file), 'r', encoding='utf-8') as cfg: + # load json + project_json = json.load(cfg) + cfg.close() + + return project_json + + def _save_project_settings(self, settings: dict): + with open(os.path.join(os.getcwd(), self._project_file), 'w', encoding='utf-8') as project_file: + project_file.write(json.dumps(settings, indent=2)) + project_file.close() + + def setUp(self): + os.chdir(os.path.abspath(PLAYGROUND_PATH)) + # create projects + CLICommands.new('console', self._source, '--ab', '--s') + os.chdir(os.path.join(os.getcwd(), self._source)) + + def cleanUp(self): + # remove projects + if not os.path.exists(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))): + return + + shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))) + + def _are_dir_trees_equal(self, dir1, dir2): + """ + found at https://stackoverflow.com/questions/4187564/recursively-compare-two-directories-to-ensure-they-have-the-same-files-and-subdi + + Compare two directories recursively. Files in each directory are + assumed to be equal if their names and contents are equal. + + @param dir1: First directory path + @param dir2: Second directory path + + @return: True if the directory trees are the same and + there were no errors while accessing the directories or files, + False otherwise. + """ + + dirs_cmp = filecmp.dircmp(dir1, dir2) + if len(dirs_cmp.left_only) > 0 or len(dirs_cmp.right_only) > 0 or len(dirs_cmp.funny_files) > 0: + return False + + (_, mismatch, errors) = filecmp.cmpfiles(dir1, dir2, dirs_cmp.common_files, shallow=False) + + if len(mismatch) > 0 or len(errors) > 0: + return False + + for common_dir in dirs_cmp.common_dirs: + new_dir1 = os.path.join(dir1, common_dir) + new_dir2 = os.path.join(dir2, common_dir) + if not self._are_dir_trees_equal(new_dir1, new_dir2): + return False + + return True + + def test_publish(self): + CLICommands.publish() + dist_path = './dist' + setup_path = f'{dist_path}/{self._source}/publish/setup' + full_dist_path = f'{dist_path}/{self._source}/publish/build/lib/{String.convert_to_snake_case(self._source)}' + self.assertTrue(os.path.exists(dist_path)) + self.assertTrue(os.path.exists(setup_path)) + self.assertTrue(os.path.exists(os.path.join(setup_path, f'{self._source}-0.0.0.tar.gz'))) + self.assertTrue(os.path.exists(os.path.join(setup_path, f'{String.convert_to_snake_case(self._source)}-0.0.0-py3-none-any.whl'))) + self.assertTrue(os.path.exists(full_dist_path)) + self.assertFalse(self._are_dir_trees_equal(f'./src/{String.convert_to_snake_case(self._source)}', full_dist_path)) + with open(f'{full_dist_path}/{self._source}.json', 'w') as file: + file.write(json.dumps(self._get_project_settings(), indent=2)) + file.close() + self.assertTrue(self._are_dir_trees_equal(f'./src/{String.convert_to_snake_case(self._source)}', full_dist_path)) diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index e11b1274..e685a73e 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -41,6 +41,10 @@ class CLICommands: def new(cls, project_type: str, name: str, *args, output=False): cls._run('new', project_type, name, *args, output=output) + @classmethod + def publish(cls): + cls._run('publish') + @classmethod def remove(cls, project: str): cls._run('remove', project) From 6de3bbdaf4df9154b45becec0a89bde8b7dc0588 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 26 Jun 2022 00:15:05 +0200 Subject: [PATCH 45/51] Added tests for run command --- unittests/unittests_cli/cli_test_suite.py | 11 ++- unittests/unittests_cli/run_test_case.py | 89 +++++++++++++++++++++- unittests/unittests_shared/cli_commands.py | 28 ++++--- 3 files changed, 111 insertions(+), 17 deletions(-) diff --git a/unittests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py index cac0af7d..f0242a88 100644 --- a/unittests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -13,6 +13,7 @@ from unittests_cli.install_test_case import InstallTestCase from unittests_cli.new_test_case import NewTestCase from unittests_cli.publish_test_case import PublishTestCase from unittests_cli.remove_test_case import RemoveTestCase +from unittests_cli.run_test_case import RunTestCase from unittests_cli.uninstall_test_case import UninstallTestCase from unittests_cli.update_test_case import UpdateTestCase @@ -24,6 +25,7 @@ class CLITestSuite(unittest.TestSuite): loader = unittest.TestLoader() self._result: Optional[TestResult] = None + self._is_online = True active_tests = [ # nothing needed @@ -33,13 +35,10 @@ class CLITestSuite(unittest.TestSuite): # VersionTestCase, # project needed BuildTestCase, - InstallTestCase, PublishTestCase, - # check if application was executed properly - # RunTestCase, + RunTestCase, # check if application was executed properly and file watcher is working # StartTestCase, - UninstallTestCase, # check in project settings if package is updated # UpdateTestCase, # workspace needed @@ -47,6 +46,10 @@ class CLITestSuite(unittest.TestSuite): RemoveTestCase ] + if self._is_online: + active_tests.append(InstallTestCase) + active_tests.append(UninstallTestCase) + for test in active_tests: self.addTests(loader.loadTestsFromTestCase(test)) diff --git a/unittests/unittests_cli/run_test_case.py b/unittests/unittests_cli/run_test_case.py index 7ace1dd2..1d86b68d 100644 --- a/unittests/unittests_cli/run_test_case.py +++ b/unittests/unittests_cli/run_test_case.py @@ -1,10 +1,91 @@ +import json +import os +import shutil +import subprocess +import sys import unittest +import pkg_resources + +from cpl_core.utils import String + +from unittests_cli.constants import PLAYGROUND_PATH +from unittests_shared.cli_commands import CLICommands + class RunTestCase(unittest.TestCase): - def setUp(self): - pass + def __init__(self, methodName: str): + unittest.TestCase.__init__(self, methodName) + self._source = 'run-test' + self._project_file = f'src/{String.convert_to_snake_case(self._source)}/{self._source}.json' + self._appsettings = f'src/{String.convert_to_snake_case(self._source)}/appsettings.json' + self._application = f'src/{String.convert_to_snake_case(self._source)}/application.py' + self._test_code = f""" + import json + settings = dict() + with open('appsettings.json', 'r', encoding='utf-8') as cfg: + # load json + settings = json.load(cfg) + cfg.close() + + settings['RunTest']['WasStarted'] = 'True' + + with open('appsettings.json', 'w', encoding='utf-8') as project_file: + project_file.write(json.dumps(settings, indent=2)) + project_file.close() + """ - def test_equal(self): - pass + def _get_appsettings(self): + with open(os.path.join(os.getcwd(), self._appsettings), 'r', encoding='utf-8') as cfg: + # load json + project_json = json.load(cfg) + cfg.close() + + return project_json + + def _save_appsettings(self, settings: dict): + with open(os.path.join(os.getcwd(), self._appsettings), 'w', encoding='utf-8') as project_file: + project_file.write(json.dumps(settings, indent=2)) + project_file.close() + + def setUp(self): + os.chdir(os.path.abspath(PLAYGROUND_PATH)) + # create projects + CLICommands.new('console', self._source, '--ab', '--s') + os.chdir(os.path.join(os.getcwd(), self._source)) + settings = {'RunTest': {'WasStarted': 'False'}} + self._save_appsettings(settings) + with open(os.path.join(os.getcwd(), self._application), 'a', encoding='utf-8') as file: + file.write(f'\t\t{self._test_code}') + file.close() + + def cleanUp(self): + # remove projects + if not os.path.exists(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))): + return + + shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))) + + def test_run(self): + CLICommands.run() + settings = self._get_appsettings() + self.assertNotEqual(settings, {}) + self.assertIn('RunTest', settings) + self.assertIn('WasStarted', settings['RunTest']) + self.assertEqual( + 'True', + settings['RunTest']['WasStarted'] + ) + + def test_run_by_project(self): + os.chdir(os.path.join(os.getcwd())) + CLICommands.run(self._source) + settings = self._get_appsettings() + self.assertNotEqual(settings, {}) + self.assertIn('RunTest', settings) + self.assertIn('WasStarted', settings['RunTest']) + self.assertEqual( + 'True', + settings['RunTest']['WasStarted'] + ) diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index e685a73e..4a2d38e2 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -15,15 +15,18 @@ class CLICommands: for arg in args: command.append(arg) - subprocess.run(command, env=env_vars) + if output: + subprocess.run(command, env=env_vars) + else: + subprocess.run(command, env=env_vars, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) @classmethod - def add(cls, source: str, target: str): - cls._run('add', source, target) + def add(cls, source: str, target: str, output=False): + cls._run('add', source, target, output=output) @classmethod - def build(cls): - cls._run('build') + def build(cls, output=False): + cls._run('build', output=output) @classmethod def generate(cls, schematic: str, name: str, output=False): @@ -42,12 +45,19 @@ class CLICommands: cls._run('new', project_type, name, *args, output=output) @classmethod - def publish(cls): - cls._run('publish') + def publish(cls, output=False): + cls._run('publish', output=output) @classmethod - def remove(cls, project: str): - cls._run('remove', project) + def remove(cls, project: str, output=False): + cls._run('remove', project, output=output) + + @classmethod + def run(cls, project: str = None, output=False): + if project is None: + cls._run('run', output=output) + return + cls._run('run', project, output=output) @classmethod def uninstall(cls, package: str, output=False): From 32507afae97badaf823e1f74a61eee2eb0e5b42d Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 26 Jun 2022 00:39:16 +0200 Subject: [PATCH 46/51] Added tests for start command --- unittests/unittests_cli/cli_test_suite.py | 20 ++-- unittests/unittests_cli/install_test_case.py | 3 - unittests/unittests_cli/new_test_case.py | 2 - unittests/unittests_cli/remove_test_case.py | 2 - unittests/unittests_cli/start_test_case.py | 95 ++++++++++++++++++- unittests/unittests_cli/threads/__init__.py | 1 + .../threads/start_test_thread.py | 12 +++ unittests/unittests_shared/cli_commands.py | 6 +- 8 files changed, 119 insertions(+), 22 deletions(-) create mode 100644 unittests/unittests_cli/threads/__init__.py create mode 100644 unittests/unittests_cli/threads/start_test_thread.py diff --git a/unittests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py index f0242a88..c615ab5a 100644 --- a/unittests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -14,6 +14,7 @@ from unittests_cli.new_test_case import NewTestCase from unittests_cli.publish_test_case import PublishTestCase from unittests_cli.remove_test_case import RemoveTestCase from unittests_cli.run_test_case import RunTestCase +from unittests_cli.start_test_case import StartTestCase from unittests_cli.uninstall_test_case import UninstallTestCase from unittests_cli.update_test_case import UpdateTestCase @@ -25,25 +26,24 @@ class CLITestSuite(unittest.TestSuite): loader = unittest.TestLoader() self._result: Optional[TestResult] = None - self._is_online = True + self._is_online = False active_tests = [ # nothing needed - GenerateTestCase, - NewTestCase, + # GenerateTestCase, + # NewTestCase, # compare console output # VersionTestCase, # project needed - BuildTestCase, - PublishTestCase, - RunTestCase, - # check if application was executed properly and file watcher is working - # StartTestCase, + # BuildTestCase, + # PublishTestCase, + # RunTestCase, + StartTestCase, # check in project settings if package is updated # UpdateTestCase, # workspace needed - AddTestCase, - RemoveTestCase + # AddTestCase, + # RemoveTestCase ] if self._is_online: diff --git a/unittests/unittests_cli/install_test_case.py b/unittests/unittests_cli/install_test_case.py index 4986ba15..ceefbf4f 100644 --- a/unittests/unittests_cli/install_test_case.py +++ b/unittests/unittests_cli/install_test_case.py @@ -5,10 +5,7 @@ import subprocess import sys import unittest -import pkg_resources - from cpl_core.utils import String - from unittests_cli.constants import PLAYGROUND_PATH from unittests_shared.cli_commands import CLICommands diff --git a/unittests/unittests_cli/new_test_case.py b/unittests/unittests_cli/new_test_case.py index 94bb652c..4125993d 100644 --- a/unittests/unittests_cli/new_test_case.py +++ b/unittests/unittests_cli/new_test_case.py @@ -1,10 +1,8 @@ import json import os -import shutil import unittest from cpl_core.utils import String - from unittests_cli.constants import PLAYGROUND_PATH from unittests_shared.cli_commands import CLICommands diff --git a/unittests/unittests_cli/remove_test_case.py b/unittests/unittests_cli/remove_test_case.py index e53d9f1a..81aa8ee0 100644 --- a/unittests/unittests_cli/remove_test_case.py +++ b/unittests/unittests_cli/remove_test_case.py @@ -1,10 +1,8 @@ import json import os -import shutil import unittest from cpl_core.utils import String - from unittests_cli.constants import PLAYGROUND_PATH from unittests_shared.cli_commands import CLICommands diff --git a/unittests/unittests_cli/start_test_case.py b/unittests/unittests_cli/start_test_case.py index 8da691da..8782b5ca 100644 --- a/unittests/unittests_cli/start_test_case.py +++ b/unittests/unittests_cli/start_test_case.py @@ -1,10 +1,97 @@ +import json +import os +import shutil import unittest +from cpl_core.utils import String +from unittests_cli.constants import PLAYGROUND_PATH +from unittests_cli.threads.start_test_thread import StartTestThread +from unittests_shared.cli_commands import CLICommands + class StartTestCase(unittest.TestCase): - def setUp(self): - pass + def __init__(self, methodName: str): + unittest.TestCase.__init__(self, methodName) + self._source = 'start-test' + self._project_file = f'src/{String.convert_to_snake_case(self._source)}/{self._source}.json' + self._appsettings = f'src/{String.convert_to_snake_case(self._source)}/appsettings.json' + self._application = f'src/{String.convert_to_snake_case(self._source)}/application.py' + self._test_code = f""" + import json + settings = dict() + with open('appsettings.json', 'r', encoding='utf-8') as cfg: + # load json + settings = json.load(cfg) + cfg.close() + + if settings['RunTest']['WasStarted']: + settings['RunTest']['WasRestarted'] = 'True' + + settings['RunTest']['WasStarted'] = 'True' - def test_equal(self): - pass + with open('appsettings.json', 'w', encoding='utf-8') as project_file: + project_file.write(json.dumps(settings, indent=2)) + project_file.close() + """ + + def _get_appsettings(self): + with open(os.path.join(os.getcwd(), self._appsettings), 'r', encoding='utf-8') as cfg: + # load json + project_json = json.load(cfg) + cfg.close() + + return project_json + + def _save_appsettings(self, settings: dict): + with open(os.path.join(os.getcwd(), self._appsettings), 'w', encoding='utf-8') as project_file: + project_file.write(json.dumps(settings, indent=2)) + project_file.close() + + def setUp(self): + os.chdir(os.path.abspath(PLAYGROUND_PATH)) + # create projects + CLICommands.new('console', self._source, '--ab', '--s') + os.chdir(os.path.join(os.getcwd(), self._source)) + settings = {'RunTest': {'WasStarted': 'False', 'WasRestarted': 'False'}} + self._save_appsettings(settings) + with open(os.path.join(os.getcwd(), self._application), 'a', encoding='utf-8') as file: + file.write(f'\t\t{self._test_code}') + file.close() + + def cleanUp(self): + # remove projects + if not os.path.exists(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))): + return + + shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))) + + def test_start(self): + thread = StartTestThread() + thread.run() + settings = self._get_appsettings() + self.assertNotEqual(settings, {}) + self.assertIn('RunTest', settings) + self.assertIn('WasStarted', settings['RunTest']) + self.assertEqual( + 'True', + settings['RunTest']['WasStarted'] + ) + + with open(os.path.join(os.getcwd(), self._application), 'a', encoding='utf-8') as file: + file.write(f'# trigger restart (comment generated by unittest)') + file.close() + + settings = self._get_appsettings() + self.assertNotEqual(settings, {}) + self.assertIn('RunTest', settings) + self.assertIn('WasStarted', settings['RunTest']) + self.assertIn('WasRestarted', settings['RunTest']) + self.assertEqual( + 'True', + settings['RunTest']['WasStarted'] + ) + self.assertEqual( + 'True', + settings['RunTest']['WasRestarted'] + ) diff --git a/unittests/unittests_cli/threads/__init__.py b/unittests/unittests_cli/threads/__init__.py new file mode 100644 index 00000000..425ab6c1 --- /dev/null +++ b/unittests/unittests_cli/threads/__init__.py @@ -0,0 +1 @@ +# imports diff --git a/unittests/unittests_cli/threads/start_test_thread.py b/unittests/unittests_cli/threads/start_test_thread.py new file mode 100644 index 00000000..1a80b8d1 --- /dev/null +++ b/unittests/unittests_cli/threads/start_test_thread.py @@ -0,0 +1,12 @@ +import threading + +from unittests_shared.cli_commands import CLICommands + + +class StartTestThread(threading.Thread): + + def __init__(self): + threading.Thread.__init__(self, daemon=True) + + def run(self): + CLICommands.start() diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index 4a2d38e2..eeb253e1 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -18,7 +18,7 @@ class CLICommands: if output: subprocess.run(command, env=env_vars) else: - subprocess.run(command, env=env_vars, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + subprocess.run(command, env=env_vars, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, stdin=subprocess.DEVNULL) @classmethod def add(cls, source: str, target: str, output=False): @@ -59,6 +59,10 @@ class CLICommands: return cls._run('run', project, output=output) + @classmethod + def start(cls, output=False): + cls._run('start', output=output) + @classmethod def uninstall(cls, package: str, output=False): cls._run('uninstall', package, output=output) From fa002a50ac9623def08d1f685fd27fc480084b38 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 26 Jun 2022 00:41:25 +0200 Subject: [PATCH 47/51] Fixed for start command --- unittests/unittests_cli/cli_test_suite.py | 14 +++++++------- unittests/unittests_cli/start_test_case.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/unittests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py index c615ab5a..eea5426e 100644 --- a/unittests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -30,20 +30,20 @@ class CLITestSuite(unittest.TestSuite): active_tests = [ # nothing needed - # GenerateTestCase, - # NewTestCase, + GenerateTestCase, + NewTestCase, # compare console output # VersionTestCase, # project needed - # BuildTestCase, - # PublishTestCase, - # RunTestCase, + BuildTestCase, + PublishTestCase, + RunTestCase, StartTestCase, # check in project settings if package is updated # UpdateTestCase, # workspace needed - # AddTestCase, - # RemoveTestCase + AddTestCase, + RemoveTestCase ] if self._is_online: diff --git a/unittests/unittests_cli/start_test_case.py b/unittests/unittests_cli/start_test_case.py index 8782b5ca..a0c86a03 100644 --- a/unittests/unittests_cli/start_test_case.py +++ b/unittests/unittests_cli/start_test_case.py @@ -25,7 +25,7 @@ class StartTestCase(unittest.TestCase): settings = json.load(cfg) cfg.close() - if settings['RunTest']['WasStarted']: + if settings['RunTest']['WasStarted'] == 'True': settings['RunTest']['WasRestarted'] = 'True' settings['RunTest']['WasStarted'] = 'True' From d83d1a244e6371c0020d52e1c315f7d93a325f6b Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 26 Jun 2022 01:05:45 +0200 Subject: [PATCH 48/51] Fixed for start command [WIP] output is needed --- unittests/unittests_cli/cli_test_suite.py | 14 +++++++------- unittests/unittests_cli/start_test_case.py | 8 ++++++-- .../unittests_cli/threads/start_test_thread.py | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/unittests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py index eea5426e..c615ab5a 100644 --- a/unittests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -30,20 +30,20 @@ class CLITestSuite(unittest.TestSuite): active_tests = [ # nothing needed - GenerateTestCase, - NewTestCase, + # GenerateTestCase, + # NewTestCase, # compare console output # VersionTestCase, # project needed - BuildTestCase, - PublishTestCase, - RunTestCase, + # BuildTestCase, + # PublishTestCase, + # RunTestCase, StartTestCase, # check in project settings if package is updated # UpdateTestCase, # workspace needed - AddTestCase, - RemoveTestCase + # AddTestCase, + # RemoveTestCase ] if self._is_online: diff --git a/unittests/unittests_cli/start_test_case.py b/unittests/unittests_cli/start_test_case.py index a0c86a03..f41eb450 100644 --- a/unittests/unittests_cli/start_test_case.py +++ b/unittests/unittests_cli/start_test_case.py @@ -1,6 +1,7 @@ import json import os import shutil +import time import unittest from cpl_core.utils import String @@ -29,7 +30,7 @@ class StartTestCase(unittest.TestCase): settings['RunTest']['WasRestarted'] = 'True' settings['RunTest']['WasStarted'] = 'True' - + with open('appsettings.json', 'w', encoding='utf-8') as project_file: project_file.write(json.dumps(settings, indent=2)) project_file.close() @@ -68,7 +69,8 @@ class StartTestCase(unittest.TestCase): def test_start(self): thread = StartTestThread() - thread.run() + thread.start() + time.sleep(1) settings = self._get_appsettings() self.assertNotEqual(settings, {}) self.assertIn('RunTest', settings) @@ -82,6 +84,8 @@ class StartTestCase(unittest.TestCase): file.write(f'# trigger restart (comment generated by unittest)') file.close() + time.sleep(1) + settings = self._get_appsettings() self.assertNotEqual(settings, {}) self.assertIn('RunTest', settings) diff --git a/unittests/unittests_cli/threads/start_test_thread.py b/unittests/unittests_cli/threads/start_test_thread.py index 1a80b8d1..6c413e6d 100644 --- a/unittests/unittests_cli/threads/start_test_thread.py +++ b/unittests/unittests_cli/threads/start_test_thread.py @@ -9,4 +9,4 @@ class StartTestThread(threading.Thread): threading.Thread.__init__(self, daemon=True) def run(self): - CLICommands.start() + CLICommands.start(True) From 78ffbcc33dabdf6dcf344c826d320696f5c15746 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 26 Jun 2022 01:07:10 +0200 Subject: [PATCH 49/51] Readded all test cases --- unittests/unittests_cli/cli_test_suite.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/unittests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py index c615ab5a..3b74a429 100644 --- a/unittests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -26,24 +26,24 @@ class CLITestSuite(unittest.TestSuite): loader = unittest.TestLoader() self._result: Optional[TestResult] = None - self._is_online = False + self._is_online = True active_tests = [ # nothing needed - # GenerateTestCase, - # NewTestCase, + GenerateTestCase, + NewTestCase, # compare console output # VersionTestCase, # project needed - # BuildTestCase, - # PublishTestCase, - # RunTestCase, + BuildTestCase, + PublishTestCase, + RunTestCase, StartTestCase, # check in project settings if package is updated # UpdateTestCase, # workspace needed - # AddTestCase, - # RemoveTestCase + AddTestCase, + RemoveTestCase ] if self._is_online: From 45be77dd10206b23f3ef62d1b49bf3987cf8869c Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 26 Jun 2022 19:51:18 +0200 Subject: [PATCH 50/51] Added tests for version command --- unittests/unittests_cli/cli_test_suite.py | 8 +- unittests/unittests_cli/version_test_case.py | 91 +++++++++++++++++++- unittests/unittests_shared/cli_commands.py | 15 ++++ 3 files changed, 108 insertions(+), 6 deletions(-) diff --git a/unittests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py index 3b74a429..6cfcc39f 100644 --- a/unittests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -17,6 +17,7 @@ from unittests_cli.run_test_case import RunTestCase from unittests_cli.start_test_case import StartTestCase from unittests_cli.uninstall_test_case import UninstallTestCase from unittests_cli.update_test_case import UpdateTestCase +from unittests_cli.version_test_case import VersionTestCase class CLITestSuite(unittest.TestSuite): @@ -29,12 +30,11 @@ class CLITestSuite(unittest.TestSuite): self._is_online = True active_tests = [ - # nothing needed + # # nothing needed + VersionTestCase, GenerateTestCase, NewTestCase, - # compare console output - # VersionTestCase, - # project needed + # # project needed BuildTestCase, PublishTestCase, RunTestCase, diff --git a/unittests/unittests_cli/version_test_case.py b/unittests/unittests_cli/version_test_case.py index cd7e75e9..73a7053a 100644 --- a/unittests/unittests_cli/version_test_case.py +++ b/unittests/unittests_cli/version_test_case.py @@ -1,10 +1,97 @@ +import pkgutil +import platform +import sys +import textwrap import unittest +import pkg_resources +from art import text2art +from tabulate import tabulate + +import cpl_cli +from cpl_core.console import ForegroundColorEnum +from termcolor import colored + +from unittests_shared.cli_commands import CLICommands + class VersionTestCase(unittest.TestCase): + def __init__(self, methodName: str): + unittest.TestCase.__init__(self, methodName) + self._block_banner = "" + self._block_version = "" + self._block_package_header = "" + self._block_cpl_packages = "" + self._block_packages = "" + self._name = "CPL CLI" + def setUp(self): pass - def test_equal(self): - pass + def _get_version_output(self, version: str): + index = 0 + + for line in version.split('\n'): + if line == "": + continue + + if index <= 5: + self._block_banner += f'{line}\n' + + if 7 <= index <= 9: + self._block_version += f'{line}\n' + + if 10 <= index <= 15: + self._block_cpl_packages += f'{line}\n' + + if index >= 17: + self._block_packages += f'{line}\n' + + index += 1 + + def test_version(self): + version = CLICommands.version() + self._get_version_output(version) + reference_banner = colored(text2art(self._name), ForegroundColorEnum.yellow.value).split('\n') + reference_banner = "\n".join(reference_banner[:len(reference_banner) - 1]) + '\n' + self.assertEqual(reference_banner, self._block_banner) + + reference_version = [ + colored(f'{colored("Common Python library CLI: ")}{colored(cpl_cli.__version__)}'), + colored(f'{colored("Python: ")}{colored(f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}")}'), + colored(f'OS: {colored(f"{platform.system()} {platform.processor()}")}') + '\n' + ] + self.assertEqual('\n'.join(reference_version), self._block_version) + packages = [] + cpl_packages = [ + 'cpl_core', + 'cpl_cli', + 'cpl_query' + ] + for modname in cpl_packages: + module = pkgutil.find_loader(modname) + if module is None: + break + + module = module.load_module(modname) + if '__version__' in dir(module): + packages.append([f'{modname}', module.__version__]) + + reference_cpl_packages = [ + colored(colored(f'CPL packages:')), + colored(f'{tabulate(packages, headers=["Name", "Version"])}') + '\n' + ] + self.assertEqual('\n'.join(reference_cpl_packages), self._block_cpl_packages) + + packages = [] + dependencies = dict(tuple(str(ws).split()) for ws in pkg_resources.working_set) + for p in dependencies: + packages.append([p, dependencies[p]]) + + reference_packages = [ + colored(colored(f'Python packages:')), + colored(f'{tabulate(packages, headers=["Name", "Version"])}'), + '\x1b[0m\x1b[0m\n\x1b[0m\x1b[0m\n' # fix colored codes + ] + self.assertEqual('\n'.join(reference_packages), self._block_packages) diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index eeb253e1..2e30bf82 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -20,6 +20,17 @@ class CLICommands: else: subprocess.run(command, env=env_vars, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, stdin=subprocess.DEVNULL) + @staticmethod + def _run_with_output(cmd: str, *args) -> str: + env_vars = os.environ + env_vars['CPL_IS_UNITTEST'] = 'NO' + + command = ['python', CLI_PATH, cmd] + for arg in args: + command.append(arg) + + return subprocess.run(command, env=env_vars, check=True, capture_output=True, text=True).stdout + @classmethod def add(cls, source: str, target: str, output=False): cls._run('add', source, target, output=output) @@ -66,3 +77,7 @@ class CLICommands: @classmethod def uninstall(cls, package: str, output=False): cls._run('uninstall', package, output=output) + + @classmethod + def version(cls) -> str: + return cls._run_with_output('version') From c2632253aceeb7988fdb332d2bff309b25952d9d Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Mon, 27 Jun 2022 09:10:21 +0200 Subject: [PATCH 51/51] Added tests for update command --- src/cpl_cli/command/update_service.py | 7 +- unittests/unittests_cli/cli_test_suite.py | 7 +- unittests/unittests_cli/update_test_case.py | 86 ++++++++++++++++++++- unittests/unittests_shared/cli_commands.py | 4 + 4 files changed, 93 insertions(+), 11 deletions(-) diff --git a/src/cpl_cli/command/update_service.py b/src/cpl_cli/command/update_service.py index 5d082109..3b1895f5 100644 --- a/src/cpl_cli/command/update_service.py +++ b/src/cpl_cli/command/update_service.py @@ -40,6 +40,8 @@ class UpdateService(CommandABC): self._cli_settings = cli_settings self._is_simulation = False + self._project_file = f'{self._project_settings.name}.json' + @property def help_message(self) -> str: return textwrap.dedent("""\ @@ -81,7 +83,7 @@ class UpdateService(CommandABC): new_package = Pip.get_package(name) if new_package is None: Console.error(f'Update for package {package} failed') - return + continue self._project_json_update_dependency(package, new_package) @@ -151,8 +153,7 @@ class UpdateService(CommandABC): BuildSettings.__name__: SettingsHelper.get_build_settings_dict(self._build_settings) } - with open(os.path.join(self._env.working_directory, f'{self._config.get_configuration("ProjectName")}.json'), - 'w') as project: + with open(os.path.join(self._env.working_directory, self._project_file), 'w') as project: project.write(json.dumps(config, indent=2)) project.close() diff --git a/unittests/unittests_cli/cli_test_suite.py b/unittests/unittests_cli/cli_test_suite.py index 6cfcc39f..f26f3f3a 100644 --- a/unittests/unittests_cli/cli_test_suite.py +++ b/unittests/unittests_cli/cli_test_suite.py @@ -30,17 +30,15 @@ class CLITestSuite(unittest.TestSuite): self._is_online = True active_tests = [ - # # nothing needed + # nothing needed VersionTestCase, GenerateTestCase, NewTestCase, - # # project needed + # project needed BuildTestCase, PublishTestCase, RunTestCase, StartTestCase, - # check in project settings if package is updated - # UpdateTestCase, # workspace needed AddTestCase, RemoveTestCase @@ -49,6 +47,7 @@ class CLITestSuite(unittest.TestSuite): if self._is_online: active_tests.append(InstallTestCase) active_tests.append(UninstallTestCase) + active_tests.append(UpdateTestCase) for test in active_tests: self.addTests(loader.loadTestsFromTestCase(test)) diff --git a/unittests/unittests_cli/update_test_case.py b/unittests/unittests_cli/update_test_case.py index 35e6d8f3..36c6fd4f 100644 --- a/unittests/unittests_cli/update_test_case.py +++ b/unittests/unittests_cli/update_test_case.py @@ -1,10 +1,88 @@ +import json +import os +import shutil +import subprocess +import sys import unittest +from cpl_core.utils import String +from unittests_cli.constants import PLAYGROUND_PATH +from unittests_shared.cli_commands import CLICommands + class UpdateTestCase(unittest.TestCase): - def setUp(self): - pass + def __init__(self, methodName: str): + unittest.TestCase.__init__(self, methodName) + self._source = 'install-test-source' + self._project_file = f'src/{String.convert_to_snake_case(self._source)}/{self._source}.json' + + self._old_version = '1.7.1' + self._old_package_name = 'discord.py' + self._old_package = f'{self._old_package_name}=={self._old_version}' + + self._new_version = '1.7.3' + self._new_package_name = 'discord.py' + self._new_package = f'{self._new_package_name}=={self._new_version}' + + def _get_project_settings(self): + with open(os.path.join(os.getcwd(), self._project_file), 'r', encoding='utf-8') as cfg: + # load json + project_json = json.load(cfg) + cfg.close() + + return project_json + + def _save_project_settings(self, settings: dict): + with open(os.path.join(os.getcwd(), self._project_file), 'w', encoding='utf-8') as project_file: + project_file.write(json.dumps(settings, indent=2)) + project_file.close() + + def setUp(self): + CLICommands.uninstall(self._old_package) + CLICommands.uninstall(self._new_package) + os.chdir(os.path.abspath(PLAYGROUND_PATH)) + # create projects + CLICommands.new('console', self._source, '--ab', '--s') + os.chdir(os.path.join(os.getcwd(), self._source)) + CLICommands.install(self._old_package) + + def cleanUp(self): + # remove projects + if not os.path.exists(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))): + return + + shutil.rmtree(os.path.abspath(os.path.join(PLAYGROUND_PATH, self._source))) + + def _get_installed_packages(self) -> dict: + reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze']) + return dict([tuple(r.decode().split('==')) for r in reqs.split()]) + + def test_install_package(self): + settings = self._get_project_settings() + self.assertNotEqual(settings, {}) + self.assertIn('ProjectSettings', settings) + self.assertIn('Dependencies', settings['ProjectSettings']) + self.assertIn( + self._old_package, + settings['ProjectSettings']['Dependencies'] + ) + packages = self._get_installed_packages() + self.assertIn(self._old_package_name, packages) + self.assertEqual(self._old_version, packages[self._old_package_name]) + + CLICommands.update() + + settings = self._get_project_settings() + self.assertNotEqual(settings, {}) + self.assertIn('ProjectSettings', settings) + self.assertIn('Dependencies', settings['ProjectSettings']) + self.assertIn( + self._new_package, + settings['ProjectSettings']['Dependencies'] + ) + packages = self._get_installed_packages() + self.assertIn(self._new_package_name, packages) + self.assertEqual(self._new_version, packages[self._new_package_name]) + - def test_equal(self): - pass diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index 2e30bf82..a458390c 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -78,6 +78,10 @@ class CLICommands: def uninstall(cls, package: str, output=False): cls._run('uninstall', package, output=output) + @classmethod + def update(cls, output=False): + cls._run('update', output=output) + @classmethod def version(cls) -> str: return cls._run_with_output('version')