From fd68d25a1d8b0128977c9f730e2ba9d1798d99f3 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sat, 30 Apr 2022 17:15:26 +0200 Subject: [PATCH] Updated to python3.10 --- .gitignore | 1 + src/cpl_cli/command/generate_service.py | 3 +-- src/cpl_cli/command_model.py | 6 ++---- src/cpl_cli/cpl_cli.json | 2 +- src/cpl_core/configuration/configuration.py | 4 ++-- src/cpl_core/configuration/configuration_abc.py | 6 +++--- src/cpl_core/console/console.py | 2 +- src/cpl_core/console/console_call.py | 2 +- src/cpl_core/cpl_core.json | 2 +- src/cpl_core/dependency_injection/service_collection_abc.py | 2 +- src/cpl_core/dependency_injection/service_provider.py | 3 +-- src/cpl_core/dependency_injection/service_provider_abc.py | 3 +-- src/cpl_query/_query/all.py | 2 +- src/cpl_query/_query/any.py | 2 +- src/cpl_query/_query/count.py | 2 +- src/cpl_query/_query/distinct.py | 2 +- src/cpl_query/_query/for_each.py | 2 +- src/cpl_query/_query/max_min.py | 2 +- src/cpl_query/_query/order_by.py | 2 +- src/cpl_query/_query/sum.py | 2 +- src/cpl_query/_query/where.py | 2 +- src/cpl_query/cpl_query.json | 2 +- src/cpl_query/extension/ordered_iterable.py | 2 +- src/cpl_query/extension/ordered_iterable_abc.py | 2 +- 24 files changed, 28 insertions(+), 32 deletions(-) diff --git a/.gitignore b/.gitignore index a374536a..1c6827be 100644 --- a/.gitignore +++ b/.gitignore @@ -106,6 +106,7 @@ celerybeat.pid .venv env/ venv/ +venv_*/ ENV/ env.bak/ venv.bak/ diff --git a/src/cpl_cli/command/generate_service.py b/src/cpl_cli/command/generate_service.py index 193ec029..65715d79 100644 --- a/src/cpl_cli/command/generate_service.py +++ b/src/cpl_cli/command/generate_service.py @@ -1,7 +1,6 @@ import os import sys import textwrap -from collections import Callable from cpl_core.configuration.configuration_abc import ConfigurationABC from cpl_core.console.foreground_color_enum import ForegroundColorEnum @@ -108,7 +107,7 @@ class GenerateService(CommandABC): template.write(value) template.close() - def _generate(self, schematic: str, name: str, template: Callable[TemplateFileABC]): + def _generate(self, schematic: str, name: str, template: TemplateFileABC): """ Generates files by given schematic, name and template :param schematic: diff --git a/src/cpl_cli/command_model.py b/src/cpl_cli/command_model.py index 5fabea2a..fd9542d4 100644 --- a/src/cpl_cli/command_model.py +++ b/src/cpl_cli/command_model.py @@ -1,11 +1,9 @@ -from collections import Callable - from cpl_cli.command_abc import CommandABC class CommandModel: - def __init__(self, name: str, aliases: list[str], command: Callable[CommandABC], is_workspace_needed: bool, + def __init__(self, name: str, aliases: list[str], command: CommandABC, is_workspace_needed: bool, is_project_needed: bool, change_cwd: bool): self._name = name self._aliases = aliases @@ -23,7 +21,7 @@ class CommandModel: return self._aliases @property - def command(self) -> Callable[CommandABC]: + def command(self) -> CommandABC: return self._command @property diff --git a/src/cpl_cli/cpl_cli.json b/src/cpl_cli/cpl_cli.json index b18c7a42..9694bc91 100644 --- a/src/cpl_cli/cpl_cli.json +++ b/src/cpl_cli/cpl_cli.json @@ -18,7 +18,7 @@ "Dependencies": [ "cpl-core>=2022.6.1" ], - "PythonVersion": ">=3.8", + "PythonVersion": ">=3.10", "PythonPath": {}, "Classifiers": [] }, diff --git a/src/cpl_core/configuration/configuration.py b/src/cpl_core/configuration/configuration.py index 6844bf26..e11b5771 100644 --- a/src/cpl_core/configuration/configuration.py +++ b/src/cpl_core/configuration/configuration.py @@ -1,7 +1,7 @@ import json import os import sys -from collections import Callable +from collections.abc import Callable from typing import Union, Type, Optional from cpl_core.configuration.configuration_abc import ConfigurationABC @@ -379,7 +379,7 @@ class Configuration(ConfigurationABC): self._config[key_type] = value def get_configuration(self, search_type: Union[str, Type[ConfigurationModelABC]]) -> \ - Union[str, Callable[ConfigurationModelABC]]: + Union[str, ConfigurationModelABC]: if type(search_type) is str: if search_type == ConfigurationVariableNameEnum.environment.value: return self._application_environment.environment_name diff --git a/src/cpl_core/configuration/configuration_abc.py b/src/cpl_core/configuration/configuration_abc.py index 3d332f65..a2961cda 100644 --- a/src/cpl_core/configuration/configuration_abc.py +++ b/src/cpl_core/configuration/configuration_abc.py @@ -1,5 +1,5 @@ from abc import abstractmethod, ABC -from collections import Callable +from collections.abc import Callable from typing import Type, Union, Optional from cpl_core.configuration.console_argument import ConsoleArgument @@ -94,7 +94,7 @@ class ConfigurationABC(ABC): pass @abstractmethod - def get_configuration(self, search_type: Union[str, Type[ConfigurationModelABC]]) -> Union[str, Callable[ConfigurationModelABC]]: + def get_configuration(self, search_type: Union[str, Type[ConfigurationModelABC]]) -> Union[str, ConfigurationModelABC]: r"""Returns value from configuration by given type Parameter @@ -104,6 +104,6 @@ class ConfigurationABC(ABC): Returns ------- - Object of Union[:class:`str`, Callable[:class:`cpl_core.configuration.configuration_model_abc.ConfigurationModelABC`]] + Object of Union[:class:`str`, :class:`cpl_core.configuration.configuration_model_abc.ConfigurationModelABC`] """ pass diff --git a/src/cpl_core/console/console.py b/src/cpl_core/console/console.py index a0b0463d..f7a06291 100644 --- a/src/cpl_core/console/console.py +++ b/src/cpl_core/console/console.py @@ -1,7 +1,7 @@ import os import sys import time -from collections import Callable +from collections.abc import Callable from typing import Union, Optional from art import text2art diff --git a/src/cpl_core/console/console_call.py b/src/cpl_core/console/console_call.py index 7680a880..950f6c64 100644 --- a/src/cpl_core/console/console_call.py +++ b/src/cpl_core/console/console_call.py @@ -1,4 +1,4 @@ -from collections import Callable +from collections.abc import Callable class ConsoleCall: diff --git a/src/cpl_core/cpl_core.json b/src/cpl_core/cpl_core.json index c12118b1..aaff74a4 100644 --- a/src/cpl_core/cpl_core.json +++ b/src/cpl_core/cpl_core.json @@ -28,7 +28,7 @@ "watchdog==2.1.7", "wheel==0.37.1" ], - "PythonVersion": ">=3.8", + "PythonVersion": ">=3.10", "PythonPath": {}, "Classifiers": [] }, diff --git a/src/cpl_core/dependency_injection/service_collection_abc.py b/src/cpl_core/dependency_injection/service_collection_abc.py index 7dcc5df5..2f69691a 100644 --- a/src/cpl_core/dependency_injection/service_collection_abc.py +++ b/src/cpl_core/dependency_injection/service_collection_abc.py @@ -1,5 +1,5 @@ from abc import abstractmethod, ABC -from collections import Callable +from collections.abc import Callable from typing import Type from cpl_core.database.database_settings import DatabaseSettings diff --git a/src/cpl_core/dependency_injection/service_provider.py b/src/cpl_core/dependency_injection/service_provider.py index 04a19b57..a1535f98 100644 --- a/src/cpl_core/dependency_injection/service_provider.py +++ b/src/cpl_core/dependency_injection/service_provider.py @@ -1,4 +1,3 @@ -from collections import Callable import copy from inspect import signature, Parameter from typing import Optional @@ -96,7 +95,7 @@ class ServiceProvider(ServiceProviderABC): sb = ScopeBuilder(ServiceProvider(copy.deepcopy(self._service_descriptors), self._configuration, self._database_context)) return sb.build() - def get_service(self, service_type: type) -> Optional[Callable[object]]: + def get_service(self, service_type: type) -> Optional[object]: result = self._find_service(service_type) if result is None: diff --git a/src/cpl_core/dependency_injection/service_provider_abc.py b/src/cpl_core/dependency_injection/service_provider_abc.py index cc06e529..9ed6fd7f 100644 --- a/src/cpl_core/dependency_injection/service_provider_abc.py +++ b/src/cpl_core/dependency_injection/service_provider_abc.py @@ -1,5 +1,4 @@ from abc import abstractmethod, ABC -from collections import Callable from typing import Type, Optional from cpl_core.dependency_injection.scope_abc import ScopeABC @@ -49,7 +48,7 @@ class ServiceProviderABC(ABC): pass @abstractmethod - def get_service(self, instance_type: Type) -> Optional[Callable[object]]: + def get_service(self, instance_type: Type) -> Optional[object]: r"""Returns instance of given type Parameter diff --git a/src/cpl_query/_query/all.py b/src/cpl_query/_query/all.py index 76aa2fb0..de0571eb 100644 --- a/src/cpl_query/_query/all.py +++ b/src/cpl_query/_query/all.py @@ -1,4 +1,4 @@ -from collections import Callable +from collections.abc import Callable from cpl_query._query.where import where_query from cpl_query.exceptions import ExceptionArgument, ArgumentNoneException diff --git a/src/cpl_query/_query/any.py b/src/cpl_query/_query/any.py index ab63c154..63a9bea5 100644 --- a/src/cpl_query/_query/any.py +++ b/src/cpl_query/_query/any.py @@ -1,4 +1,4 @@ -from collections import Callable +from collections.abc import Callable from cpl_query._query.where import where_query from cpl_query.exceptions import ArgumentNoneException, ExceptionArgument diff --git a/src/cpl_query/_query/count.py b/src/cpl_query/_query/count.py index a4a87096..94fab4a3 100644 --- a/src/cpl_query/_query/count.py +++ b/src/cpl_query/_query/count.py @@ -1,4 +1,4 @@ -from collections import Callable +from collections.abc import Callable from cpl_query._query.where import where_query from cpl_query.exceptions import ArgumentNoneException, ExceptionArgument diff --git a/src/cpl_query/_query/distinct.py b/src/cpl_query/_query/distinct.py index 791ef7c7..db28f9fb 100644 --- a/src/cpl_query/_query/distinct.py +++ b/src/cpl_query/_query/distinct.py @@ -1,4 +1,4 @@ -from collections import Callable +from collections.abc import Callable from cpl_query.exceptions import ArgumentNoneException, ExceptionArgument from cpl_query.extension.iterable_abc import IterableABC diff --git a/src/cpl_query/_query/for_each.py b/src/cpl_query/_query/for_each.py index 62411c4d..ca94a57a 100644 --- a/src/cpl_query/_query/for_each.py +++ b/src/cpl_query/_query/for_each.py @@ -1,4 +1,4 @@ -from collections import Callable +from collections.abc import Callable from cpl_query.exceptions import ExceptionArgument, ArgumentNoneException from cpl_query.extension.iterable_abc import IterableABC diff --git a/src/cpl_query/_query/max_min.py b/src/cpl_query/_query/max_min.py index d9c2c6a5..88ab3db2 100644 --- a/src/cpl_query/_query/max_min.py +++ b/src/cpl_query/_query/max_min.py @@ -1,4 +1,4 @@ -from collections import Callable +from collections.abc import Callable from typing import Union from cpl_query._helper import is_number diff --git a/src/cpl_query/_query/order_by.py b/src/cpl_query/_query/order_by.py index 11089ed9..9e418fc0 100644 --- a/src/cpl_query/_query/order_by.py +++ b/src/cpl_query/_query/order_by.py @@ -1,4 +1,4 @@ -from collections import Callable +from collections.abc import Callable from cpl_query.exceptions import ExceptionArgument, ArgumentNoneException from cpl_query.extension.iterable_abc import IterableABC diff --git a/src/cpl_query/_query/sum.py b/src/cpl_query/_query/sum.py index f8829dad..3d1482bc 100644 --- a/src/cpl_query/_query/sum.py +++ b/src/cpl_query/_query/sum.py @@ -1,4 +1,4 @@ -from collections import Callable +from collections.abc import Callable from typing import Union from cpl_query._helper import is_number diff --git a/src/cpl_query/_query/where.py b/src/cpl_query/_query/where.py index 81020f75..2890e90e 100644 --- a/src/cpl_query/_query/where.py +++ b/src/cpl_query/_query/where.py @@ -1,4 +1,4 @@ -from collections import Callable +from collections.abc import Callable from cpl_query.exceptions import ArgumentNoneException, ExceptionArgument from cpl_query.extension.iterable_abc import IterableABC diff --git a/src/cpl_query/cpl_query.json b/src/cpl_query/cpl_query.json index 321374f2..c8f9fc1b 100644 --- a/src/cpl_query/cpl_query.json +++ b/src/cpl_query/cpl_query.json @@ -18,7 +18,7 @@ "Dependencies": [ "cpl-core>=2022.6.1" ], - "PythonVersion": ">=3.8", + "PythonVersion": ">=3.10", "PythonPath": {}, "Classifiers": [] }, diff --git a/src/cpl_query/extension/ordered_iterable.py b/src/cpl_query/extension/ordered_iterable.py index 11443ac0..3c374ead 100644 --- a/src/cpl_query/extension/ordered_iterable.py +++ b/src/cpl_query/extension/ordered_iterable.py @@ -1,4 +1,4 @@ -from collections import Callable +from collections.abc import Callable from cpl_query._query.order_by import then_by_descending_query, then_by_query from cpl_query.extension.iterable import Iterable diff --git a/src/cpl_query/extension/ordered_iterable_abc.py b/src/cpl_query/extension/ordered_iterable_abc.py index 9a6c5bb1..bd10a917 100644 --- a/src/cpl_query/extension/ordered_iterable_abc.py +++ b/src/cpl_query/extension/ordered_iterable_abc.py @@ -1,5 +1,5 @@ from abc import abstractmethod -from collections import Callable +from collections.abc import Callable from cpl_query.extension.iterable_abc import IterableABC