Updated to python3.10

This commit is contained in:
2022-04-30 17:15:26 +02:00
parent 588f93f7b1
commit fd68d25a1d
24 changed files with 28 additions and 32 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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:

View File

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