2022.6 #88

Merged
edraft merged 158 commits from 2022.6 into master 2022-06-29 17:50:07 +02:00
24 changed files with 28 additions and 32 deletions
Showing only changes of commit fd68d25a1d - Show all commits

1
.gitignore vendored
View File

@ -106,6 +106,7 @@ celerybeat.pid
.venv .venv
env/ env/
venv/ venv/
venv_*/
ENV/ ENV/
env.bak/ env.bak/
venv.bak/ venv.bak/

View File

@ -1,7 +1,6 @@
import os import os
import sys import sys
import textwrap import textwrap
from collections import Callable
from cpl_core.configuration.configuration_abc import ConfigurationABC from cpl_core.configuration.configuration_abc import ConfigurationABC
from cpl_core.console.foreground_color_enum import ForegroundColorEnum from cpl_core.console.foreground_color_enum import ForegroundColorEnum
@ -108,7 +107,7 @@ class GenerateService(CommandABC):
template.write(value) template.write(value)
template.close() 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 Generates files by given schematic, name and template
:param schematic: :param schematic:

View File

@ -1,11 +1,9 @@
from collections import Callable
from cpl_cli.command_abc import CommandABC from cpl_cli.command_abc import CommandABC
class CommandModel: 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): is_project_needed: bool, change_cwd: bool):
self._name = name self._name = name
self._aliases = aliases self._aliases = aliases
@ -23,7 +21,7 @@ class CommandModel:
return self._aliases return self._aliases
@property @property
def command(self) -> Callable[CommandABC]: def command(self) -> CommandABC:
return self._command return self._command
@property @property

View File

@ -18,7 +18,7 @@
"Dependencies": [ "Dependencies": [
"cpl-core>=2022.6.1" "cpl-core>=2022.6.1"
], ],
"PythonVersion": ">=3.8", "PythonVersion": ">=3.10",
"PythonPath": {}, "PythonPath": {},
"Classifiers": [] "Classifiers": []
}, },

View File

@ -1,7 +1,7 @@
import json import json
import os import os
import sys import sys
from collections import Callable from collections.abc import Callable
from typing import Union, Type, Optional from typing import Union, Type, Optional
from cpl_core.configuration.configuration_abc import ConfigurationABC from cpl_core.configuration.configuration_abc import ConfigurationABC
@ -379,7 +379,7 @@ class Configuration(ConfigurationABC):
self._config[key_type] = value self._config[key_type] = value
def get_configuration(self, search_type: Union[str, Type[ConfigurationModelABC]]) -> \ def get_configuration(self, search_type: Union[str, Type[ConfigurationModelABC]]) -> \
Union[str, Callable[ConfigurationModelABC]]: Union[str, ConfigurationModelABC]:
if type(search_type) is str: if type(search_type) is str:
if search_type == ConfigurationVariableNameEnum.environment.value: if search_type == ConfigurationVariableNameEnum.environment.value:
return self._application_environment.environment_name return self._application_environment.environment_name

View File

@ -1,5 +1,5 @@
from abc import abstractmethod, ABC from abc import abstractmethod, ABC
from collections import Callable from collections.abc import Callable
from typing import Type, Union, Optional from typing import Type, Union, Optional
from cpl_core.configuration.console_argument import ConsoleArgument from cpl_core.configuration.console_argument import ConsoleArgument
@ -94,7 +94,7 @@ class ConfigurationABC(ABC):
pass pass
@abstractmethod @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 r"""Returns value from configuration by given type
Parameter Parameter
@ -104,6 +104,6 @@ class ConfigurationABC(ABC):
Returns 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 pass

View File

@ -1,7 +1,7 @@
import os import os
import sys import sys
import time import time
from collections import Callable from collections.abc import Callable
from typing import Union, Optional from typing import Union, Optional
from art import text2art from art import text2art

View File

@ -1,4 +1,4 @@
from collections import Callable from collections.abc import Callable
class ConsoleCall: class ConsoleCall:

View File

@ -28,7 +28,7 @@
"watchdog==2.1.7", "watchdog==2.1.7",
"wheel==0.37.1" "wheel==0.37.1"
], ],
"PythonVersion": ">=3.8", "PythonVersion": ">=3.10",
"PythonPath": {}, "PythonPath": {},
"Classifiers": [] "Classifiers": []
}, },

View File

@ -1,5 +1,5 @@
from abc import abstractmethod, ABC from abc import abstractmethod, ABC
from collections import Callable from collections.abc import Callable
from typing import Type from typing import Type
from cpl_core.database.database_settings import DatabaseSettings from cpl_core.database.database_settings import DatabaseSettings

View File

@ -1,4 +1,3 @@
from collections import Callable
import copy import copy
from inspect import signature, Parameter from inspect import signature, Parameter
from typing import Optional from typing import Optional
@ -96,7 +95,7 @@ class ServiceProvider(ServiceProviderABC):
sb = ScopeBuilder(ServiceProvider(copy.deepcopy(self._service_descriptors), self._configuration, self._database_context)) sb = ScopeBuilder(ServiceProvider(copy.deepcopy(self._service_descriptors), self._configuration, self._database_context))
return sb.build() 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) result = self._find_service(service_type)
if result is None: if result is None:

View File

@ -1,5 +1,4 @@
from abc import abstractmethod, ABC from abc import abstractmethod, ABC
from collections import Callable
from typing import Type, Optional from typing import Type, Optional
from cpl_core.dependency_injection.scope_abc import ScopeABC from cpl_core.dependency_injection.scope_abc import ScopeABC
@ -49,7 +48,7 @@ class ServiceProviderABC(ABC):
pass pass
@abstractmethod @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 r"""Returns instance of given type
Parameter Parameter

View File

@ -1,4 +1,4 @@
from collections import Callable from collections.abc import Callable
from cpl_query._query.where import where_query from cpl_query._query.where import where_query
from cpl_query.exceptions import ExceptionArgument, ArgumentNoneException from cpl_query.exceptions import ExceptionArgument, ArgumentNoneException

View File

@ -1,4 +1,4 @@
from collections import Callable from collections.abc import Callable
from cpl_query._query.where import where_query from cpl_query._query.where import where_query
from cpl_query.exceptions import ArgumentNoneException, ExceptionArgument from cpl_query.exceptions import ArgumentNoneException, ExceptionArgument

View File

@ -1,4 +1,4 @@
from collections import Callable from collections.abc import Callable
from cpl_query._query.where import where_query from cpl_query._query.where import where_query
from cpl_query.exceptions import ArgumentNoneException, ExceptionArgument from cpl_query.exceptions import ArgumentNoneException, ExceptionArgument

View File

@ -1,4 +1,4 @@
from collections import Callable from collections.abc import Callable
from cpl_query.exceptions import ArgumentNoneException, ExceptionArgument from cpl_query.exceptions import ArgumentNoneException, ExceptionArgument
from cpl_query.extension.iterable_abc import IterableABC from cpl_query.extension.iterable_abc import IterableABC

View File

@ -1,4 +1,4 @@
from collections import Callable from collections.abc import Callable
from cpl_query.exceptions import ExceptionArgument, ArgumentNoneException from cpl_query.exceptions import ExceptionArgument, ArgumentNoneException
from cpl_query.extension.iterable_abc import IterableABC from cpl_query.extension.iterable_abc import IterableABC

View File

@ -1,4 +1,4 @@
from collections import Callable from collections.abc import Callable
from typing import Union from typing import Union
from cpl_query._helper import is_number from cpl_query._helper import is_number

View File

@ -1,4 +1,4 @@
from collections import Callable from collections.abc import Callable
from cpl_query.exceptions import ExceptionArgument, ArgumentNoneException from cpl_query.exceptions import ExceptionArgument, ArgumentNoneException
from cpl_query.extension.iterable_abc import IterableABC from cpl_query.extension.iterable_abc import IterableABC

View File

@ -1,4 +1,4 @@
from collections import Callable from collections.abc import Callable
from typing import Union from typing import Union
from cpl_query._helper import is_number from cpl_query._helper import is_number

View File

@ -1,4 +1,4 @@
from collections import Callable from collections.abc import Callable
from cpl_query.exceptions import ArgumentNoneException, ExceptionArgument from cpl_query.exceptions import ArgumentNoneException, ExceptionArgument
from cpl_query.extension.iterable_abc import IterableABC from cpl_query.extension.iterable_abc import IterableABC

View File

@ -18,7 +18,7 @@
"Dependencies": [ "Dependencies": [
"cpl-core>=2022.6.1" "cpl-core>=2022.6.1"
], ],
"PythonVersion": ">=3.8", "PythonVersion": ">=3.10",
"PythonPath": {}, "PythonPath": {},
"Classifiers": [] "Classifiers": []
}, },

View File

@ -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._query.order_by import then_by_descending_query, then_by_query
from cpl_query.extension.iterable import Iterable from cpl_query.extension.iterable import Iterable

View File

@ -1,5 +1,5 @@
from abc import abstractmethod from abc import abstractmethod
from collections import Callable from collections.abc import Callable
from cpl_query.extension.iterable_abc import IterableABC from cpl_query.extension.iterable_abc import IterableABC