From 9f4077a0732ad540d100a92096e1aace16629d87 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 25 May 2022 13:11:41 +0200 Subject: [PATCH 1/5] Improved configuration --- src/cpl_core/configuration/configuration.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cpl_core/configuration/configuration.py b/src/cpl_core/configuration/configuration.py index a0d1c6c1..d4a83eb9 100644 --- a/src/cpl_core/configuration/configuration.py +++ b/src/cpl_core/configuration/configuration.py @@ -5,8 +5,6 @@ import traceback from collections.abc import Callable from typing import Union, Type, Optional -from cpl_cli.command.custom_script_service import CustomScriptService -from cpl_cli.configuration import WorkspaceSettings from cpl_core.configuration.argument_abc import ArgumentABC from cpl_core.configuration.argument_builder import ArgumentBuilder from cpl_core.configuration.argument_executable_abc import ArgumentExecutableABC @@ -158,6 +156,8 @@ class Configuration(ConfigurationABC): def _handle_pre_or_post_executables(self, pre: bool, argument: ExecutableArgument, services: ServiceProviderABC): script_type = 'pre-' if pre else 'post-' + + from cpl_cli.configuration.workspace_settings import WorkspaceSettings workspace: Optional[WorkspaceSettings] = self.get_configuration(WorkspaceSettings) if workspace is None or len(workspace.scripts) == 0: return @@ -170,12 +170,13 @@ class Configuration(ConfigurationABC): if script.split(script_type)[1] != argument.name: continue + from cpl_cli.command.custom_script_service import CustomScriptService css: CustomScriptService = services.get_service(CustomScriptService) if css is None: continue Console.write_line() - self.add_configuration('ACTIVE_EXECUTABLE', script) + self._set_variable('ACTIVE_EXECUTABLE', script) css.run([]) def _parse_arguments(self, executables: list[ArgumentABC], arg_list: list[str], args_types: list[ArgumentABC]): @@ -333,7 +334,7 @@ class Configuration(ConfigurationABC): cmd: ArgumentExecutableABC = services.get_service(exe.executable_type) self._handle_pre_or_post_executables(True, exe, services) - self.add_configuration('ACTIVE_EXECUTABLE', exe.name) + self._set_variable('ACTIVE_EXECUTABLE', exe.name) cmd.execute(self._additional_arguments) self._handle_pre_or_post_executables(False, exe, services) prevent = exe.prevent_next_executable From a8756d493ad6b9a8b1c1157c8efca6627d11a5c3 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 25 May 2022 13:19:12 +0200 Subject: [PATCH 2/5] Fixed error with RemoveService --- src/cpl_cli/command/remove_service.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cpl_cli/command/remove_service.py b/src/cpl_cli/command/remove_service.py index 7d7dbe09..42462219 100644 --- a/src/cpl_cli/command/remove_service.py +++ b/src/cpl_cli/command/remove_service.py @@ -52,8 +52,9 @@ class RemoveService(CommandABC): project_json.write(json.dumps(content, indent=2)) project_json.close() - @staticmethod - def _remove_sources(path: str): + def _remove_sources(self, path: str): + if self._is_simulation: + return shutil.rmtree(path) def _create_workspace(self, path: str): From 48c6941f1a488abefd99c2d696d7cfbdc9f44f2e Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 25 May 2022 13:43:16 +0200 Subject: [PATCH 3/5] Added run command & tools/set-version project --- cpl-workspace.json | 14 +--- src/cpl_cli/command/run_service.py | 76 +++++++++++++---- src/cpl_cli/live_server/live_server_thread.py | 12 --- src/cpl_cli/live_server/start_executable.py | 81 +++++++++++++++++++ src/cpl_cli/startup.py | 6 +- src/cpl_cli/startup_argument_extension.py | 3 + src/cpl_core/configuration/configuration.py | 2 +- tools/set_version/__init__.py | 1 + tools/set_version/application.py | 16 ++++ tools/set_version/appsettings.json | 15 ++++ tools/set_version/main.py | 14 ++++ tools/set_version/set-version.json | 43 ++++++++++ tools/set_version/startup.py | 16 ++++ 13 files changed, 256 insertions(+), 43 deletions(-) create mode 100644 src/cpl_cli/live_server/start_executable.py create mode 100644 tools/set_version/__init__.py create mode 100644 tools/set_version/application.py create mode 100644 tools/set_version/appsettings.json create mode 100644 tools/set_version/main.py create mode 100644 tools/set_version/set-version.json create mode 100644 tools/set_version/startup.py diff --git a/cpl-workspace.json b/cpl-workspace.json index 116affef..5d9098a3 100644 --- a/cpl-workspace.json +++ b/cpl-workspace.json @@ -4,7 +4,8 @@ "Projects": { "cpl_core": "src/cpl_core/cpl_core.json", "cpl_cli": "src/cpl_cli/cpl_cli.json", - "cpl_query": "src/cpl_query/cpl_query.json" + "cpl_query": "src/cpl_query/cpl_query.json", + "set-version": "tools/set_version/set-version.json" }, "Scripts": { "hello-world": "echo 'Hello World'", @@ -12,55 +13,44 @@ "db": "cpl build-docs", "docs-open": "xdg-open $PWD/docs/build/html/index.html &", "do": "cpl docs-open", - "build-all": "cpl build-cli; cpl build-core; cpl build-query;", "ba": "cpl build-all", "build-cli": "echo 'Build cpl_cli'; cd ./src/cpl_cli; cpl build; cd ../../;", "build-core": "echo 'Build cpl_core'; cd ./src/cpl_core; cpl build; cd ../../;", "build-query": "echo 'Build cpl_query'; cd ./src/cpl_query; cpl build; cd ../../;", - "publish-all": "cpl publish-cli; cpl publish-core; cpl publish-query;", "pa": "cpl build-all", "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;", "upload-prod-core": "echo 'PROD Upload cpl_core'; cpl upl-prod-core;", "upload-prod-query": "echo 'PROD Upload cpl_query'; cpl upl-prod-query;", - "upload-exp-cli": "echo 'EXP Upload cpl_cli'; cpl upl-exp-cli;", "upload-exp-core": "echo 'EXP Upload cpl_core'; cpl upl-exp-core;", "upload-exp-query": "echo 'EXP Upload cpl_query'; cpl upl-exp-query;", - "upload-dev-cli": "echo 'DEV Upload cpl_cli'; cpl upl-dev-cli;", "upload-dev-core": "echo 'DEV Upload cpl_core'; cpl upl-dev-core;", "upload-dev-query": "echo 'DEV Upload cpl_query'; cpl upl-dev-query;", - "upl-prod-cli": "twine upload -r pip.sh-edraft.de dist/cpl-cli/publish/setup/*", "upl-prod-core": "twine upload -r pip.sh-edraft.de dist/cpl-core/publish/setup/*", "upl-prod-query": "twine upload -r pip.sh-edraft.de dist/cpl-query/publish/setup/*", - "upl-exp-cli": "twine upload -r pip-exp.sh-edraft.de dist/cpl-cli/publish/setup/*", "upl-exp-core": "twine upload -r pip-exp.sh-edraft.de dist/cpl-core/publish/setup/*", "upl-exp-query": "twine upload -r pip-exp.sh-edraft.de dist/cpl-query/publish/setup/*", - "upl-dev-cli": "twine upload -r pip-dev.sh-edraft.de dist/cpl-cli/publish/setup/*", "upl-dev-core": "twine upload -r pip-dev.sh-edraft.de dist/cpl-core/publish/setup/*", "upl-dev-query": "twine upload -r pip-dev.sh-edraft.de dist/cpl-query/publish/setup/*", - "deploy-prod": "cpl deploy-prod-cli; cpl deploy-prod-core; cpl deploy-prod-query;", "dp": "cpl deploy-prod", "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", - "deploy-exp": "cpl deploy-exp-cli; cpl deploy-exp-core; cpl deploy-exp-query;", "de": "cpl deploy-exp", "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", - "deploy-dev": "cpl deploy-dev-cli; cpl deploy-dev-core; cpl deploy-dev-query;", "dd": "cpl deploy-dev", "deploy-dev-cli": "cpl publish-cli; cpl upload-dev-cli", diff --git a/src/cpl_cli/command/run_service.py b/src/cpl_cli/command/run_service.py index e6be3878..78d48a34 100644 --- a/src/cpl_cli/command/run_service.py +++ b/src/cpl_cli/command/run_service.py @@ -1,33 +1,49 @@ import os +import sys import textwrap +from cpl_cli import Error from cpl_cli.command_abc import CommandABC -from cpl_core.console.console import Console -from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC +from cpl_cli.configuration import WorkspaceSettings from cpl_cli.configuration.build_settings import BuildSettings from cpl_cli.configuration.project_settings import ProjectSettings -from cpl_cli.live_server.live_server_thread import LiveServerThread +from cpl_cli.live_server.start_executable import StartExecutable +from cpl_core.configuration import ConfigurationABC +from cpl_core.console.console import Console +from cpl_core.dependency_injection import ServiceProviderABC +from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC class RunService(CommandABC): - def __init__(self, env: ApplicationEnvironmentABC, project_settings: ProjectSettings, build_settings: BuildSettings): + def __init__(self, + config: ConfigurationABC, + env: ApplicationEnvironmentABC, + services: ServiceProviderABC, + project_settings: ProjectSettings, + build_settings: BuildSettings, + workspace: WorkspaceSettings + ): """ Service for the CLI command start + :param config: :param env: + :param services: :param project_settings: :param build_settings: + :param workspace: """ CommandABC.__init__(self) + self._config = config self._env = env + self._services = services self._project_settings = project_settings self._build_settings = build_settings + self._workspace = workspace self._src_dir = os.path.join(self._env.working_directory, self._build_settings.source_path) - self._args: list[str] = [] - @property def help_message(self) -> str: return textwrap.dedent("""\ @@ -35,19 +51,49 @@ class RunService(CommandABC): Usage: cpl run """) + def _set_project_by_args(self, name: str): + if self._workspace is None: + Error.error('The command requires to be run in an CPL workspace, but a workspace could not be found.') + sys.exit() + + if name not in self._workspace.projects: + Error.error(f'Project {name} not found in workspace') + sys.exit() + + project_path = self._workspace.projects[name] + + self._config.add_configuration(ProjectSettings, None) + self._config.add_configuration(BuildSettings, None) + + working_directory = self._config.get_configuration('PATH_WORKSPACE') + if working_directory is not None: + self._env.set_working_directory(working_directory) + + json_file = os.path.join(self._env.working_directory, project_path) + self._config.add_json_file(json_file, optional=True, output=False) + self._project_settings: ProjectSettings = self._config.get_configuration(ProjectSettings) + self._build_settings: BuildSettings = self._config.get_configuration(BuildSettings) + + if self._project_settings is None or self._build_settings is None: + Error.error(f'Project {name} not found') + sys.exit() + + self._src_dir = os.path.dirname(json_file) + def execute(self, args: list[str]): """ Entry point of command :param args: :return: """ - ls_thread = LiveServerThread( - self._project_settings.python_executable, - self._src_dir, - self._args, - self._env, - self._build_settings - ) - ls_thread.start() - ls_thread.join() + if len(args) > 1: + Error.error(f'Unexpected argument(s): {", ".join(args)}') + sys.exit() + + if len(args) == 1: + self._set_project_by_args(args[0]) + args.remove(args[0]) + + start_service = StartExecutable(self._env, self._build_settings) + start_service.run(args, self._project_settings.python_executable, self._src_dir, output=False) Console.write_line() diff --git a/src/cpl_cli/live_server/live_server_thread.py b/src/cpl_cli/live_server/live_server_thread.py index 3c88f841..3018b5ef 100644 --- a/src/cpl_cli/live_server/live_server_thread.py +++ b/src/cpl_cli/live_server/live_server_thread.py @@ -35,8 +35,6 @@ class LiveServerThread(threading.Thread): self._command = [] self._env_vars = os.environ - self._set_venv() - @property def command(self) -> list[str]: return self._command @@ -45,16 +43,6 @@ class LiveServerThread(threading.Thread): def main(self) -> str: return self._main - def _set_venv(self): - if self._executable != sys.executable: - path = os.path.abspath(os.path.dirname(os.path.dirname(self._executable))) - if sys.platform == 'win32': - self._env_vars['PATH'] = f'{path}\\bin' + os.pathsep + os.environ.get('PATH', '') - else: - self._env_vars['PATH'] = f'{path}/bin' + os.pathsep + os.environ.get('PATH', '') - - self._env_vars['VIRTUAL_ENV'] = path - def run(self): """ Starts the CPL project diff --git a/src/cpl_cli/live_server/start_executable.py b/src/cpl_cli/live_server/start_executable.py new file mode 100644 index 00000000..426f03e7 --- /dev/null +++ b/src/cpl_cli/live_server/start_executable.py @@ -0,0 +1,81 @@ +import os +import subprocess +import sys +import threading +from datetime import datetime + +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.configuration import BuildSettings + + +class StartExecutable: + + def __init__(self, env: ApplicationEnvironmentABC, build_settings: BuildSettings): + """ + Service to start the CPL project for the live development server + :param env: + :param build_settings: + """ + + self._executable = None + + self._env = env + self._build_settings = build_settings + + self._main = '' + self._command = [] + self._env_vars = os.environ + + self._set_venv() + + def _set_venv(self): + if self._executable is None or self._executable == sys.executable: + return + + path = os.path.abspath(os.path.dirname(os.path.dirname(self._executable))) + if sys.platform == 'win32': + self._env_vars['PATH'] = f'{path}\\bin' + os.pathsep + os.environ.get('PATH', '') + else: + self._env_vars['PATH'] = f'{path}/bin' + os.pathsep + os.environ.get('PATH', '') + + self._env_vars['VIRTUAL_ENV'] = path + + def run(self, args: list[str], executable: str, path: str, output=True): + self._executable = os.path.abspath(executable) + + main = self._build_settings.main + if '.' in self._build_settings.main: + length = len(self._build_settings.main.split('.')) - 1 + main = self._build_settings.main.split('.')[length] + + self._main = os.path.join(path, f'{main}.py') + if not os.path.isfile(self._main): + Console.error('Entry point main.py not found') + return + + # set cwd to src/ + self._env.set_working_directory(os.path.abspath(os.path.join(path))) + src_cwd = os.path.abspath(os.path.join(path, '../')) + if sys.platform == 'win32': + self._env_vars['PYTHONPATH'] = f'{src_cwd};' \ + f'{os.path.join(self._env.working_directory, self._build_settings.source_path)}' + else: + self._env_vars['PYTHONPATH'] = f'{src_cwd}:' \ + f'{os.path.join(self._env.working_directory, self._build_settings.source_path)}' + + if output: + Console.set_foreground_color(ForegroundColorEnum.green) + Console.write_line('Read successfully') + Console.set_foreground_color(ForegroundColorEnum.cyan) + Console.write_line(f'Started at {datetime.now().strftime("%Y-%m-%d %H:%M:%S")}\n\n') + Console.set_foreground_color(ForegroundColorEnum.default) + + self._command = [self._executable, self._main] + # if len(self._args) > 0: + # self._command.append(' '.join(self._args)) + for arg in args: + self._command.append(arg) + + subprocess.run(self._command, env=self._env_vars) diff --git a/src/cpl_cli/startup.py b/src/cpl_cli/startup.py index 6c90f01c..25aebea5 100644 --- a/src/cpl_cli/startup.py +++ b/src/cpl_cli/startup.py @@ -8,7 +8,7 @@ from cpl_core.application.startup_abc import StartupABC from cpl_core.configuration.configuration_abc import ConfigurationABC from cpl_core.dependency_injection.service_collection_abc import ServiceCollectionABC from cpl_core.dependency_injection.service_provider_abc import ServiceProviderABC -from cpl_core.environment import ApplicationEnvironment +from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC class Startup(StartupABC): @@ -16,7 +16,7 @@ class Startup(StartupABC): def __init__(self): StartupABC.__init__(self) - def configure_configuration(self, configuration: ConfigurationABC, environment: ApplicationEnvironment) -> ConfigurationABC: + def configure_configuration(self, configuration: ConfigurationABC, environment: ApplicationEnvironmentABC) -> ConfigurationABC: environment.set_runtime_directory(os.path.dirname(__file__)) configuration.argument_error_function = Error.error @@ -26,7 +26,7 @@ class Startup(StartupABC): return configuration - def configure_services(self, services: ServiceCollectionABC, environment: ApplicationEnvironment) -> ServiceProviderABC: + def configure_services(self, services: ServiceCollectionABC, environment: ApplicationEnvironmentABC) -> ServiceProviderABC: services.add_transient(PublisherABC, PublisherService) services.add_transient(LiveServerService) diff --git a/src/cpl_cli/startup_argument_extension.py b/src/cpl_cli/startup_argument_extension.py index 1430e699..41b905f8 100644 --- a/src/cpl_cli/startup_argument_extension.py +++ b/src/cpl_cli/startup_argument_extension.py @@ -1,6 +1,8 @@ import os from typing import Optional +from cpl_core.console import Console + from cpl_cli.command.add_service import AddService from cpl_cli.command.build_service import BuildService from cpl_cli.command.custom_script_service import CustomScriptService @@ -47,6 +49,7 @@ class StartupArgumentExtension(StartupExtensionABC): def _read_cpl_environment(self, config: ConfigurationABC, env: ApplicationEnvironmentABC): workspace: Optional[WorkspaceSettings] = config.get_configuration(WorkspaceSettings) + config.add_configuration('PATH_WORKSPACE', env.working_directory) if workspace is not None: for script in workspace.scripts: config.create_console_argument(ArgumentTypeEnum.Executable, '', script, [], CustomScriptService) diff --git a/src/cpl_core/configuration/configuration.py b/src/cpl_core/configuration/configuration.py index d4a83eb9..9b344ace 100644 --- a/src/cpl_core/configuration/configuration.py +++ b/src/cpl_core/configuration/configuration.py @@ -340,7 +340,7 @@ class Configuration(ConfigurationABC): prevent = exe.prevent_next_executable success = True except Exception as e: - Console.error('An error occurred while executing arguments.') + Console.error('An error occurred while executing arguments.', traceback.format_exc()) sys.exit() return success diff --git a/tools/set_version/__init__.py b/tools/set_version/__init__.py new file mode 100644 index 00000000..ad5eca30 --- /dev/null +++ b/tools/set_version/__init__.py @@ -0,0 +1 @@ +# imports: diff --git a/tools/set_version/application.py b/tools/set_version/application.py new file mode 100644 index 00000000..9ce6fc0a --- /dev/null +++ b/tools/set_version/application.py @@ -0,0 +1,16 @@ +from cpl_core.application import ApplicationABC +from cpl_core.configuration import ConfigurationABC +from cpl_core.console import Console +from cpl_core.dependency_injection import ServiceProviderABC + + +class Application(ApplicationABC): + + def __init__(self, config: ConfigurationABC, services: ServiceProviderABC): + ApplicationABC.__init__(self, config, services) + + def configure(self): + pass + + def main(self): + Console.write_line('Hello World from tools') diff --git a/tools/set_version/appsettings.json b/tools/set_version/appsettings.json new file mode 100644 index 00000000..629e6ebd --- /dev/null +++ b/tools/set_version/appsettings.json @@ -0,0 +1,15 @@ +{ + "TimeFormatSettings": { + "DateFormat": "%Y-%m-%d", + "TimeFormat": "%H:%M:%S", + "DateTimeFormat": "%Y-%m-%d %H:%M:%S.%f", + "DateTimeLogFormat": "%Y-%m-%d_%H-%M-%S" + }, + + "LoggingSettings": { + "Path": "logs/", + "Filename": "log_$start_time.log", + "ConsoleLogLevel": "ERROR", + "FileLogLevel": "WARN" + } +} diff --git a/tools/set_version/main.py b/tools/set_version/main.py new file mode 100644 index 00000000..71943f43 --- /dev/null +++ b/tools/set_version/main.py @@ -0,0 +1,14 @@ +from cpl_core.application import ApplicationBuilder + +from set_version.application import Application +from set_version.startup import Startup + + +def main(): + app_builder = ApplicationBuilder(Application) + app_builder.use_startup(Startup) + app_builder.build().run() + + +if __name__ == '__main__': + main() diff --git a/tools/set_version/set-version.json b/tools/set_version/set-version.json new file mode 100644 index 00000000..3039cf07 --- /dev/null +++ b/tools/set_version/set-version.json @@ -0,0 +1,43 @@ +{ + "ProjectSettings": { + "Name": "set-version", + "Version": { + "Major": "0", + "Minor": "0", + "Micro": "0" + }, + "Author": "", + "AuthorEmail": "", + "Description": "", + "LongDescription": "", + "URL": "", + "CopyrightDate": "", + "CopyrightName": "", + "LicenseName": "", + "LicenseDescription": "", + "Dependencies": [ + "sh_cpl-core>=2022.6.1.dev4" + ], + "PythonVersion": ">=3.10.4", + "PythonPath": { + "linux": "" + }, + "Classifiers": [] + }, + "BuildSettings": { + "ProjectType": "console", + "SourcePath": "", + "OutputPath": "../../dist", + "Main": "set_version.main", + "EntryPoint": "set-version", + "IncludePackageData": false, + "Included": [], + "Excluded": [ + "*/__pycache__", + "*/logs", + "*/tests" + ], + "PackageData": {}, + "ProjectReferences": [] + } +} \ No newline at end of file diff --git a/tools/set_version/startup.py b/tools/set_version/startup.py new file mode 100644 index 00000000..359c03d2 --- /dev/null +++ b/tools/set_version/startup.py @@ -0,0 +1,16 @@ +from cpl_core.application import StartupABC +from cpl_core.configuration import ConfigurationABC +from cpl_core.dependency_injection import ServiceProviderABC, ServiceCollectionABC +from cpl_core.environment import ApplicationEnvironment + + +class Startup(StartupABC): + + def __init__(self): + StartupABC.__init__(self) + + def configure_configuration(self, configuration: ConfigurationABC, environment: ApplicationEnvironment) -> ConfigurationABC: + return configuration + + def configure_services(self, services: ServiceCollectionABC, environment: ApplicationEnvironment) -> ServiceProviderABC: + return services.build_service_provider() From 5feb44595a28e0252e3c5ec9adc623a2f5d70996 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 25 May 2022 14:00:38 +0200 Subject: [PATCH 4/5] Fixed cpl run command --- cpl-workspace.json | 1 + 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/publish/__init__.py | 4 ++-- src/cpl_cli/command/__init__.py | 4 ++-- src/cpl_cli/command/custom_script_service.py | 8 +++++++- 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 ++-- 42 files changed, 87 insertions(+), 80 deletions(-) diff --git a/cpl-workspace.json b/cpl-workspace.json index 5d9098a3..3a85b29f 100644 --- a/cpl-workspace.json +++ b/cpl-workspace.json @@ -13,6 +13,7 @@ "db": "cpl build-docs", "docs-open": "xdg-open $PWD/docs/build/html/index.html &", "do": "cpl docs-open", + "pre-build": "cpl run set-version;", "build-all": "cpl build-cli; cpl build-core; cpl build-query;", "ba": "cpl build-all", "build-cli": "echo 'Build cpl_cli'; cd ./src/cpl_cli; cpl build; cd ../../;", diff --git a/src/cpl_cli/__init__.py b/src/cpl_cli/__init__.py index cb505c8b..63c9f7ce 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.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_cli/_templates/__init__.py b/src/cpl_cli/_templates/__init__.py index d5df0517..9a8ac68b 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.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_cli/_templates/build/__init__.py b/src/cpl_cli/_templates/build/__init__.py index d858ee52..779822e0 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.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_cli/_templates/generate/__init__.py b/src/cpl_cli/_templates/generate/__init__.py index 55ddb78b..3e7d6781 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.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_cli/_templates/new/__init__.py b/src/cpl_cli/_templates/new/__init__.py index 6856c973..6a00273e 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.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_cli/_templates/new/console/__init__.py b/src/cpl_cli/_templates/new/console/__init__.py index ecd47e45..9639dc9a 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.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_cli/_templates/new/console/source/__init__.py b/src/cpl_cli/_templates/new/console/source/__init__.py index bd31b991..57aee7c7 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.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.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 a26e50c5..02140906 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.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.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 7fe376ec..2a587b18 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.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_cli/_templates/new/library/__init__.py b/src/cpl_cli/_templates/new/library/__init__.py index de18ce9a..44422652 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.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_cli/_templates/new/library/source/__init__.py b/src/cpl_cli/_templates/new/library/source/__init__.py index ee44dc84..fbbbb29a 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.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.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 ed0ff1ea..f20866b7 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.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.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 6c95bcea..7df4bb38 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.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_cli/_templates/publish/__init__.py b/src/cpl_cli/_templates/publish/__init__.py index ec5fce4d..ff9e454c 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.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_cli/command/__init__.py b/src/cpl_cli/command/__init__.py index f27a4c9d..f7896c15 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.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_cli/command/custom_script_service.py b/src/cpl_cli/command/custom_script_service.py index 4208b8d5..3e6bebdf 100644 --- a/src/cpl_cli/command/custom_script_service.py +++ b/src/cpl_cli/command/custom_script_service.py @@ -1,6 +1,8 @@ import os import subprocess +from cpl_core.environment import ApplicationEnvironmentABC + from cpl_core.configuration.configuration_abc import ConfigurationABC from cpl_core.console.console import Console from cpl_cli.command_abc import CommandABC @@ -9,13 +11,14 @@ from cpl_cli.configuration.workspace_settings import WorkspaceSettings class CustomScriptService(CommandABC): - def __init__(self, config: ConfigurationABC, ws: WorkspaceSettings): + def __init__(self, config: ConfigurationABC, env: ApplicationEnvironmentABC, ws: WorkspaceSettings): """ Service for CLI scripts """ CommandABC.__init__(self) self._config = config + self._env = env self._workspace = ws @property @@ -24,6 +27,9 @@ class CustomScriptService(CommandABC): def execute(self, args: list[str]): cmd = self._config.get_configuration('ACTIVE_EXECUTABLE') + wd = self._config.get_configuration('PATH_WORKSPACE') + if wd is not None: + self._env.set_working_directory(wd) for script in self._workspace.scripts: if script != cmd: diff --git a/src/cpl_cli/configuration/__init__.py b/src/cpl_cli/configuration/__init__.py index e8218baf..b12182a6 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.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_cli/cpl_cli.json b/src/cpl_cli/cpl_cli.json index 3aa44d54..98e3f128 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": "13" + "Micro": "14.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.13" + "cpl-core>=2022.6.14.dev1" ], "PythonVersion": ">=3.10", "PythonPath": {}, diff --git a/src/cpl_cli/live_server/__init__.py b/src/cpl_cli/live_server/__init__.py index 85ec2412..981729d5 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.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_cli/publish/__init__.py b/src/cpl_cli/publish/__init__.py index 44325377..bb94f9bc 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.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_cli/source_creator/__init__.py b/src/cpl_cli/source_creator/__init__.py index 7e8d080d..19089840 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.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_cli/validators/__init__.py b/src/cpl_cli/validators/__init__.py index 0f804e30..6eab00eb 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.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_core/__init__.py b/src/cpl_core/__init__.py index b290ac73..de58ed87 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.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_core/application/__init__.py b/src/cpl_core/application/__init__.py index 0086ac0f..8e96f77e 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.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_core/configuration/__init__.py b/src/cpl_core/configuration/__init__.py index 3e6b196d..75cbf0f2 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.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_core/console/__init__.py b/src/cpl_core/console/__init__.py index feb2015f..9038717d 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.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_core/cpl_core.json b/src/cpl_core/cpl_core.json index 76e5aa9a..1fe5377d 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": "13" + "Micro": "14.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 28527d76..ecd2eba7 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.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_core/database/connection/__init__.py b/src/cpl_core/database/connection/__init__.py index 19ffd858..5f15d616 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.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_core/database/context/__init__.py b/src/cpl_core/database/context/__init__.py index df3de117..f8e4c28c 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.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_core/dependency_injection/__init__.py b/src/cpl_core/dependency_injection/__init__.py index 9883028d..7511e97a 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.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_core/environment/__init__.py b/src/cpl_core/environment/__init__.py index 724f9ece..edc415f8 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.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_core/logging/__init__.py b/src/cpl_core/logging/__init__.py index 9ecc5264..70fbd359 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.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_core/mailing/__init__.py b/src/cpl_core/mailing/__init__.py index 0f59b2f6..40393d62 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.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_core/pipes/__init__.py b/src/cpl_core/pipes/__init__.py index 70b9c27e..61c3f7c2 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.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_core/time/__init__.py b/src/cpl_core/time/__init__.py index 63a4cadf..d9456507 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.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_core/utils/__init__.py b/src/cpl_core/utils/__init__.py index 40a1f72d..eeb093da 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.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_query/__init__.py b/src/cpl_query/__init__.py index 4b7767bb..cd2a1085 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) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_query/_query/__init__.py b/src/cpl_query/_query/__init__.py index 5bc4bf00..d0183643 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) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.1.dev4' +__version__ = '2022.6.14.dev1' from collections import namedtuple # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major='2022', minor='6', micro='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') diff --git a/src/cpl_query/cpl_query.json b/src/cpl_query/cpl_query.json index 3f69f1d3..fdf516ba 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": "13" + "Micro": "14.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.13" + "cpl-core>=2022.6.14.dev1" ], "PythonVersion": ">=3.10", "PythonPath": {}, diff --git a/src/cpl_query/extension/__init__.py b/src/cpl_query/extension/__init__.py index b045f5e3..f732577e 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) 2020 - 2022 sh-edraft.de' -__version__ = '2022.6.1.dev4' +__version__ = '2022.6.14.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='1.dev4') +version_info = VersionInfo(major='2022', minor='6', micro='14.dev1') From 40f132da338f04ce1fb57f651abf449d38bee43b Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 25 May 2022 14:14:26 +0200 Subject: [PATCH 5/5] Added workspace scripts --- cpl-workspace.json | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/cpl-workspace.json b/cpl-workspace.json index 3a85b29f..b92e671b 100644 --- a/cpl-workspace.json +++ b/cpl-workspace.json @@ -9,49 +9,60 @@ }, "Scripts": { "hello-world": "echo 'Hello World'", + + "sv": "cpl set-version", + "set-version": "echo 'Set versions for all projects'; cpl run set-version; 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": "cpl run set-version;", + + "pre-build-all": "cpl sv", "build-all": "cpl build-cli; cpl build-core; cpl build-query;", "ba": "cpl build-all", "build-cli": "echo 'Build cpl_cli'; cd ./src/cpl_cli; cpl build; cd ../../;", "build-core": "echo 'Build cpl_core'; cd ./src/cpl_core; cpl build; cd ../../;", "build-query": "echo 'Build cpl_query'; cd ./src/cpl_query; cpl build; cd ../../;", + + "pre-publish-all": "cpl sv", "publish-all": "cpl publish-cli; cpl publish-core; cpl publish-query;", "pa": "cpl build-all", "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;", - "upload-prod-core": "echo 'PROD Upload cpl_core'; cpl upl-prod-core;", - "upload-prod-query": "echo 'PROD Upload cpl_query'; cpl upl-prod-query;", - "upload-exp-cli": "echo 'EXP Upload cpl_cli'; cpl upl-exp-cli;", - "upload-exp-core": "echo 'EXP Upload cpl_core'; cpl upl-exp-core;", - "upload-exp-query": "echo 'EXP Upload cpl_query'; cpl upl-exp-query;", - "upload-dev-cli": "echo 'DEV Upload cpl_cli'; cpl upl-dev-cli;", - "upload-dev-core": "echo 'DEV Upload cpl_core'; cpl upl-dev-core;", - "upload-dev-query": "echo 'DEV Upload cpl_query'; cpl upl-dev-query;", "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;", "upl-prod-core": "twine upload -r pip.sh-edraft.de dist/cpl-core/publish/setup/*", + "upload-prod-query": "echo 'PROD Upload cpl_query'; cpl upl-prod-query;", "upl-prod-query": "twine upload -r pip.sh-edraft.de dist/cpl-query/publish/setup/*", + "upload-exp-cli": "echo 'EXP Upload cpl_cli'; cpl upl-exp-cli;", "upl-exp-cli": "twine upload -r pip-exp.sh-edraft.de dist/cpl-cli/publish/setup/*", + "upload-exp-core": "echo 'EXP Upload cpl_core'; cpl upl-exp-core;", "upl-exp-core": "twine upload -r pip-exp.sh-edraft.de dist/cpl-core/publish/setup/*", + "upload-exp-query": "echo 'EXP Upload cpl_query'; cpl upl-exp-query;", "upl-exp-query": "twine upload -r pip-exp.sh-edraft.de dist/cpl-query/publish/setup/*", + "upload-dev-cli": "echo 'DEV Upload cpl_cli'; cpl upl-dev-cli;", "upl-dev-cli": "twine upload -r pip-dev.sh-edraft.de dist/cpl-cli/publish/setup/*", + "upload-dev-core": "echo 'DEV Upload cpl_core'; cpl upl-dev-core;", "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/*", + "deploy-prod": "cpl deploy-prod-cli; cpl deploy-prod-core; cpl deploy-prod-query;", "dp": "cpl deploy-prod", "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", + "deploy-exp": "cpl deploy-exp-cli; cpl deploy-exp-core; cpl deploy-exp-query;", "de": "cpl deploy-exp", "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", + "deploy-dev": "cpl deploy-dev-cli; cpl deploy-dev-core; cpl deploy-dev-query;", "dd": "cpl deploy-dev", "deploy-dev-cli": "cpl publish-cli; cpl upload-dev-cli",