diff --git a/HISTORY.md b/HISTORY.md index 92741498..acdeb76d 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -90,3 +90,10 @@ History ------------------ * Add support for `__get_enroute__` method by `EnrouteAnalyzer`. + +0.0.16 (2021-09-20) +------------------ + +* Add support for `Kong` discovery. +* Add support for `minos-microservice-common>=0.1.13`. +* Fix bug related with database queues and plain dates (without timezones). diff --git a/minos/networks/__init__.py b/minos/networks/__init__.py index 879154a8..4ae5e98b 100644 --- a/minos/networks/__init__.py +++ b/minos/networks/__init__.py @@ -1,6 +1,4 @@ -"""minos.networks module.""" - -__version__ = "0.0.15" +__version__ = "0.0.16" from .brokers import ( Broker, @@ -26,7 +24,9 @@ enroute, ) from .discovery import ( + DiscoveryClient, DiscoveryConnector, + KongDiscoveryClient, MinosDiscoveryClient, ) from .exceptions import ( @@ -34,6 +34,7 @@ MinosDiscoveryConnectorException, MinosHandlerException, MinosHandlerNotFoundEnoughEntriesException, + MinosInvalidDiscoveryClient, MinosMultipleEnrouteDecoratorKindsException, MinosNetworkException, MinosRedefinedEnrouteDecoratorException, diff --git a/minos/networks/brokers/__init__.py b/minos/networks/brokers/__init__.py index 9b7404e6..af2120b4 100644 --- a/minos/networks/brokers/__init__.py +++ b/minos/networks/brokers/__init__.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from .abc import ( Broker, BrokerSetup, diff --git a/minos/networks/brokers/abc.py b/minos/networks/brokers/abc.py index a1f6f9b9..5063535e 100644 --- a/minos/networks/brokers/abc.py +++ b/minos/networks/brokers/abc.py @@ -1,16 +1,6 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from abc import ( ABC, ) -from typing import ( - NoReturn, -) from psycopg2.sql import ( SQL, @@ -25,10 +15,10 @@ class BrokerSetup(PostgreSqlMinosDatabase): """Minos Broker Setup Class""" - async def _setup(self) -> NoReturn: + async def _setup(self) -> None: await self._create_broker_table() - async def _create_broker_table(self) -> NoReturn: + async def _create_broker_table(self) -> None: await self.submit_query(_CREATE_TABLE_QUERY, lock=hash("producer_queue")) @@ -44,7 +34,7 @@ async def enqueue(self, topic: str, raw: bytes) -> int: :param raw: Bytes sequence to be send. :return: The identifier of the message in the queue. """ - params = (topic, raw, 0, self.ACTION) + params = (topic, raw, self.ACTION) raw = await self.submit_query_and_fetchone(_INSERT_ENTRY_QUERY, params) await self.submit_query(_NOTIFY_QUERY) return raw[0] @@ -54,17 +44,13 @@ async def enqueue(self, topic: str, raw: bytes) -> int: "CREATE TABLE IF NOT EXISTS producer_queue (" "id BIGSERIAL NOT NULL PRIMARY KEY, " "topic VARCHAR(255) NOT NULL, " - "model BYTEA NOT NULL, " - "retry INTEGER NOT NULL, " + "data BYTEA NOT NULL, " "action VARCHAR(255) NOT NULL, " - "creation_date TIMESTAMP NOT NULL, " - "update_date TIMESTAMP NOT NULL)" + "retry INTEGER NOT NULL DEFAULT 0, " + "created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), " + "updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW())" ) -_INSERT_ENTRY_QUERY = SQL( - "INSERT INTO producer_queue (topic, model, retry, action, creation_date, update_date) " - "VALUES (%s, %s, %s, %s, NOW(), NOW()) " - "RETURNING id" -) +_INSERT_ENTRY_QUERY = SQL("INSERT INTO producer_queue (topic, data, action) VALUES (%s, %s, %s) RETURNING id") _NOTIFY_QUERY = SQL("NOTIFY producer_queue") diff --git a/minos/networks/brokers/command_replies.py b/minos/networks/brokers/command_replies.py index 32b5116f..9390f4f9 100644 --- a/minos/networks/brokers/command_replies.py +++ b/minos/networks/brokers/command_replies.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from __future__ import ( annotations, ) diff --git a/minos/networks/brokers/commands.py b/minos/networks/brokers/commands.py index fd86d625..e8685357 100644 --- a/minos/networks/brokers/commands.py +++ b/minos/networks/brokers/commands.py @@ -1,5 +1,3 @@ -"""minos.networks.brokers.commands module.""" - from __future__ import ( annotations, ) diff --git a/minos/networks/brokers/events.py b/minos/networks/brokers/events.py index acb7bb06..297a0aa5 100644 --- a/minos/networks/brokers/events.py +++ b/minos/networks/brokers/events.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from __future__ import ( annotations, ) diff --git a/minos/networks/brokers/producers.py b/minos/networks/brokers/producers.py index c8f77ae5..24b7ea6e 100644 --- a/minos/networks/brokers/producers.py +++ b/minos/networks/brokers/producers.py @@ -1,5 +1,3 @@ -"""minos.networks.brokers.producers module.""" - from __future__ import ( annotations, ) @@ -165,7 +163,7 @@ async def dispatch_one(self, row: tuple) -> bool: :param row: A row containing the message information. :return: ``True`` if everything was fine or ``False`` otherwise. """ - topic, message, action = row[1], row[2], row[4] + topic, message, action = row[1], row[2], row[3] # noinspection PyBroadException try: @@ -209,7 +207,7 @@ def client(self) -> AIOKafkaProducer: "SELECT * " "FROM producer_queue " "WHERE retry < %s " - "ORDER BY creation_date " + "ORDER BY created_at " "LIMIT %s " "FOR UPDATE " "SKIP LOCKED" @@ -217,7 +215,7 @@ def client(self) -> AIOKafkaProducer: _DELETE_PROCESSED_QUERY = SQL("DELETE FROM producer_queue WHERE id = %s") -_UPDATE_NOT_PROCESSED_QUERY = SQL("UPDATE producer_queue SET retry = retry + 1 WHERE id = %s") +_UPDATE_NOT_PROCESSED_QUERY = SQL("UPDATE producer_queue SET retry = retry + 1, updated_at = NOW() WHERE id = %s") _LISTEN_QUERY = SQL("LISTEN producer_queue") diff --git a/minos/networks/brokers/services.py b/minos/networks/brokers/services.py index d404fab6..1803eb18 100644 --- a/minos/networks/brokers/services.py +++ b/minos/networks/brokers/services.py @@ -1,5 +1,3 @@ -"""minos.networks.brokers.services module.""" - from __future__ import ( annotations, ) diff --git a/minos/networks/decorators/__init__.py b/minos/networks/decorators/__init__.py index 1e981abf..6fdbc8d1 100644 --- a/minos/networks/decorators/__init__.py +++ b/minos/networks/decorators/__init__.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from .analyzers import ( EnrouteAnalyzer, ) diff --git a/minos/networks/decorators/analyzers.py b/minos/networks/decorators/analyzers.py index 77bb782b..9953eee4 100644 --- a/minos/networks/decorators/analyzers.py +++ b/minos/networks/decorators/analyzers.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from inspect import ( getmembers, isfunction, diff --git a/minos/networks/decorators/api.py b/minos/networks/decorators/api.py index 0d740b5b..eeb32988 100644 --- a/minos/networks/decorators/api.py +++ b/minos/networks/decorators/api.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from .definitions import ( BrokerCommandEnrouteDecorator, BrokerEventEnrouteDecorator, diff --git a/minos/networks/decorators/builders.py b/minos/networks/decorators/builders.py index 6eb2994c..356a53d6 100644 --- a/minos/networks/decorators/builders.py +++ b/minos/networks/decorators/builders.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from inspect import ( iscoroutinefunction, ) diff --git a/minos/networks/decorators/definitions/__init__.py b/minos/networks/decorators/definitions/__init__.py index 70adab5a..7dae0e73 100644 --- a/minos/networks/decorators/definitions/__init__.py +++ b/minos/networks/decorators/definitions/__init__.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from .abc import ( EnrouteDecorator, ) diff --git a/minos/networks/decorators/definitions/abc.py b/minos/networks/decorators/definitions/abc.py index 360f4250..42382d41 100644 --- a/minos/networks/decorators/definitions/abc.py +++ b/minos/networks/decorators/definitions/abc.py @@ -1,9 +1,3 @@ -# Copyright (C) 2020 Clariteia SL -# -# This file is part of minos framework. -# -# Minos framework can not be copied and/or distributed without the express -# permission of Clariteia SL. from __future__ import ( annotations, ) @@ -20,7 +14,6 @@ Callable, Final, Iterable, - NoReturn, Optional, Union, ) @@ -36,7 +29,7 @@ EnrouteDecoratorKind, ) -Adapter = Callable[[Request], Union[Response, NoReturn, None, Awaitable[Union[Response, NoReturn, None]]]] +Adapter = Callable[[Request], Union[Optional[Response], Awaitable[Optional[Response]]]] class EnrouteDecorator(ABC): diff --git a/minos/networks/decorators/definitions/broker.py b/minos/networks/decorators/definitions/broker.py index ea191409..e51f16ce 100644 --- a/minos/networks/decorators/definitions/broker.py +++ b/minos/networks/decorators/definitions/broker.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from abc import ( ABC, ) diff --git a/minos/networks/decorators/definitions/kinds.py b/minos/networks/decorators/definitions/kinds.py index 666d45ad..79815597 100644 --- a/minos/networks/decorators/definitions/kinds.py +++ b/minos/networks/decorators/definitions/kinds.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from enum import ( Enum, auto, diff --git a/minos/networks/decorators/definitions/rest.py b/minos/networks/decorators/definitions/rest.py index 8ef6f801..51c473ec 100644 --- a/minos/networks/decorators/definitions/rest.py +++ b/minos/networks/decorators/definitions/rest.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from abc import ( ABC, ) diff --git a/minos/networks/discovery/__init__.py b/minos/networks/discovery/__init__.py index 86b354f0..983c9ec6 100644 --- a/minos/networks/discovery/__init__.py +++ b/minos/networks/discovery/__init__.py @@ -1,11 +1,6 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from .clients import ( + DiscoveryClient, + KongDiscoveryClient, MinosDiscoveryClient, ) from .connectors import ( diff --git a/minos/networks/discovery/clients/__init__.py b/minos/networks/discovery/clients/__init__.py new file mode 100644 index 00000000..4f0e5127 --- /dev/null +++ b/minos/networks/discovery/clients/__init__.py @@ -0,0 +1,9 @@ +from .abc import ( + DiscoveryClient, +) +from .kong import ( + KongDiscoveryClient, +) +from .minos import ( + MinosDiscoveryClient, +) diff --git a/minos/networks/discovery/clients.py b/minos/networks/discovery/clients/abc.py similarity index 81% rename from minos/networks/discovery/clients.py rename to minos/networks/discovery/clients/abc.py index 9b958c2c..2991fd8f 100644 --- a/minos/networks/discovery/clients.py +++ b/minos/networks/discovery/clients/abc.py @@ -1,23 +1,22 @@ -"""minos.networks.discovery.clients module.""" - import logging +from abc import ( + ABC, + abstractmethod, +) from asyncio import ( sleep, ) -from typing import ( - NoReturn, -) import aiohttp -from ..exceptions import ( +from ...exceptions import ( MinosDiscoveryConnectorException, ) logger = logging.getLogger(__name__) -class MinosDiscoveryClient: +class DiscoveryClient(ABC): """Minos Discovery Client class.""" def __init__(self, host: str, port: int): @@ -33,6 +32,7 @@ def route(self) -> str: # noinspection HttpUrlsUsage return f"http://{self.host}:{self.port}" + @abstractmethod async def subscribe( self, host: str, @@ -41,8 +41,8 @@ async def subscribe( endpoints: list[dict[str, str]], retry_tries: int = 3, retry_delay: float = 5, - ) -> NoReturn: - """Perform a subscription query. + ) -> None: + """ Perform a subscription query. :param host: The ip of the microservice to be subscribed. :param port: The port of the microservice to be subscribed. @@ -52,13 +52,18 @@ async def subscribe( :param retry_delay: Seconds to wait between attempts. :return: This method does not return anything. """ - endpoint = f"{self.route}/microservices/{name}" - service_metadata = { - "address": host, - "port": port, - "endpoints": [[endpoint["method"], endpoint["url"]] for endpoint in endpoints], - } + async def _rest_subscribe( + self, + endpoint: str, + service_metadata: dict[str, str], + host: str, + port: int, + name: str, + endpoints: list[dict[str, str]], + retry_tries: int = 3, + retry_delay: float = 5, + ) -> None: logger.debug(f"Subscribing into {endpoint!r}...") try: async with aiohttp.ClientSession() as session: @@ -75,17 +80,19 @@ async def subscribe( else: raise MinosDiscoveryConnectorException("There was a problem while trying to subscribe.") - async def unsubscribe(self, name: str, retry_tries: int = 3, retry_delay: float = 5) -> NoReturn: - """Perform an unsubscribe query. + @abstractmethod + async def unsubscribe(self, name: str, retry_tries: int = 3, retry_delay: float = 5) -> None: + """ Perform an unsubscribe query. :param name: The name of the microservice to be unsubscribed. :param retry_tries: Number of attempts before raising a failure exception. :param retry_delay: Seconds to wait between attempts. :return: This method does not return anything. """ - endpoint = f"{self.route}/microservices/{name}" + async def _rest_unsubscribe(self, endpoint: str, name: str, retry_tries: int = 3, retry_delay: float = 5) -> None: logger.debug(f"Unsubscribing into {endpoint!r}...") + try: async with aiohttp.ClientSession() as session: async with session.delete(endpoint) as response: diff --git a/minos/networks/discovery/clients/kong.py b/minos/networks/discovery/clients/kong.py new file mode 100644 index 00000000..a7da118a --- /dev/null +++ b/minos/networks/discovery/clients/kong.py @@ -0,0 +1,50 @@ +from .abc import ( + DiscoveryClient, +) + + +class KongDiscoveryClient(DiscoveryClient): + async def subscribe( + self, + host: str, + port: int, + name: str, + endpoints: list[dict[str, str]], + retry_tries: int = 3, + retry_delay: float = 5, + ) -> None: + """Perform a subscription query. + + :param host: The ip of the microservice to be subscribed. + :param port: The port of the microservice to be subscribed. + :param name: The name of the microservice to be subscribed. + :param endpoints: List of endpoints exposed by the microservice. + :param retry_tries: Number of attempts before raising a failure exception. + :param retry_delay: Seconds to wait between attempts. + :return: This method does not return anything. + """ + endpoint = f"{self.route}/services" + service_metadata = { + "name": name, + "url": f"http://{host}:{port}", + } + await self._rest_subscribe(endpoint, service_metadata, host, port, name, endpoints, retry_tries, retry_delay) + + endpoint = f"{self.route}/{name}/routes" + service_metadata = { + "paths": [endpoint["url"] for endpoint in endpoints], + } + # TODO Should we use _rest_subscribe here? + await self._rest_subscribe(endpoint, service_metadata, host, port, name, endpoints, retry_tries, retry_delay) + + async def unsubscribe(self, name: str, retry_tries: int = 3, retry_delay: float = 5) -> None: + """ Perform an unsubscribe query. + + :param name: The name of the microservice to be unsubscribed. + :param retry_tries: Number of attempts before raising a failure exception. + :param retry_delay: Seconds to wait between attempts. + :return: This method does not return anything. + """ + endpoint = f"{self.route}/services/{name}" + + await self._rest_unsubscribe(endpoint, name, retry_tries, retry_delay) diff --git a/minos/networks/discovery/clients/minos.py b/minos/networks/discovery/clients/minos.py new file mode 100644 index 00000000..0c4ad5cf --- /dev/null +++ b/minos/networks/discovery/clients/minos.py @@ -0,0 +1,51 @@ +import logging + +from .abc import ( + DiscoveryClient, +) + +logger = logging.getLogger(__name__) + + +class MinosDiscoveryClient(DiscoveryClient): + """Minos Discovery Client class.""" + + async def subscribe( + self, + host: str, + port: int, + name: str, + endpoints: list[dict[str, str]], + retry_tries: int = 3, + retry_delay: float = 5, + ) -> None: + """Perform a subscription query. + + :param host: The ip of the microservice to be subscribed. + :param port: The port of the microservice to be subscribed. + :param name: The name of the microservice to be subscribed. + :param endpoints: List of endpoints exposed by the microservice. + :param retry_tries: Number of attempts before raising a failure exception. + :param retry_delay: Seconds to wait between attempts. + :return: This method does not return anything. + """ + endpoint = f"{self.route}/microservices/{name}" + service_metadata = { + "address": host, + "port": port, + "endpoints": [[endpoint["method"], endpoint["url"]] for endpoint in endpoints], + } + + await self._rest_subscribe(endpoint, service_metadata, host, port, name, endpoints, retry_tries, retry_delay) + + async def unsubscribe(self, name: str, retry_tries: int = 3, retry_delay: float = 5) -> None: + """Perform an unsubscribe query. + + :param name: The name of the microservice to be unsubscribed. + :param retry_tries: Number of attempts before raising a failure exception. + :param retry_delay: Seconds to wait between attempts. + :return: This method does not return anything. + """ + endpoint = f"{self.route}/microservices/{name}" + + await self._rest_unsubscribe(endpoint, name, retry_tries, retry_delay) diff --git a/minos/networks/discovery/connectors.py b/minos/networks/discovery/connectors.py index 2712af21..9774020e 100644 --- a/minos/networks/discovery/connectors.py +++ b/minos/networks/discovery/connectors.py @@ -1,10 +1,11 @@ -"""minos.networks.discovery.connectors module.""" - from __future__ import ( annotations, ) import logging +from inspect import ( + isclass, +) from itertools import ( chain, ) @@ -13,22 +14,27 @@ ) from typing import ( Any, - NoReturn, + Type, ) from minos.common import ( MinosConfig, + MinosImportException, MinosSetup, + import_module, ) from ..decorators import ( EnrouteAnalyzer, ) +from ..exceptions import ( + MinosInvalidDiscoveryClient, +) from ..utils import ( get_host_ip, ) from .clients import ( - MinosDiscoveryClient, + DiscoveryClient, ) logger = logging.getLogger(__name__) @@ -49,7 +55,8 @@ def __init__(self, client, name: str, host: str, port: int, endpoints: list[dict @classmethod def _from_config(cls, *args, config: MinosConfig, **kwargs) -> DiscoveryConnector: - client = MinosDiscoveryClient(host=config.discovery.host, port=config.discovery.port) + client_cls = cls._client_cls_from_config(config) + client = client_cls(host=config.discovery.host, port=config.discovery.port) port = config.rest.port name = config.service.name host = get_host_ip() @@ -57,6 +64,18 @@ def _from_config(cls, *args, config: MinosConfig, **kwargs) -> DiscoveryConnecto return cls(client, name, host, port, endpoints, *args, **kwargs) + @staticmethod + def _client_cls_from_config(config: MinosConfig) -> Type[DiscoveryClient]: + try: + # noinspection PyTypeChecker + client_cls: type = import_module(config.discovery.client) + except MinosImportException: + raise MinosInvalidDiscoveryClient(f"{config.discovery.client} could not be imported.") + + if not isclass(client_cls) or not issubclass(client_cls, DiscoveryClient): + raise MinosInvalidDiscoveryClient(f"{config.discovery.client} not supported.") + return client_cls + @staticmethod def _endpoints_from_config(config: MinosConfig) -> list[dict[str, Any]]: command_decorators = EnrouteAnalyzer(config.commands.service, config).get_rest_command_query() @@ -68,10 +87,10 @@ def _endpoints_from_config(config: MinosConfig) -> list[dict[str, Any]]: endpoints.sort(key=itemgetter("url", "method")) return endpoints - async def _setup(self) -> NoReturn: + async def _setup(self) -> None: await self.subscribe() - async def subscribe(self) -> NoReturn: + async def subscribe(self) -> None: """Send a subscribe operation to the discovery. :return: This method does not return anything. @@ -79,10 +98,10 @@ async def subscribe(self) -> NoReturn: logger.info("Performing discovery subscription...") await self.client.subscribe(self.host, self.port, self.name, self.endpoints) - async def _destroy(self) -> NoReturn: + async def _destroy(self) -> None: await self.unsubscribe() - async def unsubscribe(self) -> NoReturn: + async def unsubscribe(self) -> None: """Send an unsubscribe operation to the discovery. :return: This method does not return anything. diff --git a/minos/networks/exceptions.py b/minos/networks/exceptions.py index a149672a..a7d8b2e9 100644 --- a/minos/networks/exceptions.py +++ b/minos/networks/exceptions.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from minos.common import ( MinosException, ) @@ -18,6 +11,10 @@ class MinosDiscoveryConnectorException(MinosNetworkException): """Exception to be raised when there is a failure while communicating with the discovery.""" +class MinosInvalidDiscoveryClient(MinosNetworkException): + """Exception raised when the configured Discovery Client does not implement de DiscoveryClient interface""" + + class MinosHandlerException(MinosNetworkException): """Base handler exception.""" diff --git a/minos/networks/handlers/__init__.py b/minos/networks/handlers/__init__.py index fa93dda7..021aad98 100644 --- a/minos/networks/handlers/__init__.py +++ b/minos/networks/handlers/__init__.py @@ -1,4 +1,3 @@ -"""minos.networks.handlers module.""" from .abc import ( Handler, HandlerSetup, diff --git a/minos/networks/handlers/abc/__init__.py b/minos/networks/handlers/abc/__init__.py index 091ee2c1..f65da181 100644 --- a/minos/networks/handlers/abc/__init__.py +++ b/minos/networks/handlers/abc/__init__.py @@ -1,4 +1,3 @@ -"""minos.networks.handlers.abc module.""" from .handlers import ( Handler, ) diff --git a/minos/networks/handlers/abc/handlers.py b/minos/networks/handlers/abc/handlers.py index 1ecf319f..404f18fb 100644 --- a/minos/networks/handlers/abc/handlers.py +++ b/minos/networks/handlers/abc/handlers.py @@ -1,5 +1,3 @@ -"""minos.networks.abc.handlers module.""" - from __future__ import ( annotations, ) @@ -16,6 +14,7 @@ from typing import ( Any, Callable, + KeysView, NoReturn, Optional, Type, @@ -77,7 +76,11 @@ def handlers(self) -> dict[str, Optional[Callable]]: return self._handlers @property - def topics(self): + def topics(self) -> KeysView[str]: + """Get an iterable containing the topic names. + + :return: An ``Iterable`` of ``str``. + """ return self.handlers.keys() async def dispatch_forever(self, max_wait: Optional[float] = 60.0) -> NoReturn: @@ -170,11 +173,11 @@ def _build_entries(self, rows: list[tuple]) -> list[HandlerEntry]: kwargs = {"callback_lookup": self.get_action, "data_cls": self.ENTRY_MODEL_CLS} return [HandlerEntry(*row, **kwargs) for row in rows] - async def _dispatch_entries(self, entries: list[HandlerEntry]) -> NoReturn: + async def _dispatch_entries(self, entries: list[HandlerEntry]) -> None: futures = (self._dispatch_one(entry) for entry in entries) await gather(*futures) - async def _dispatch_one(self, entry: HandlerEntry) -> NoReturn: + async def _dispatch_one(self, entry: HandlerEntry) -> None: logger.debug(f"Dispatching '{entry!r}'...") try: await self.dispatch_one(entry) @@ -183,7 +186,7 @@ async def _dispatch_one(self, entry: HandlerEntry) -> NoReturn: entry.exception = exc @abstractmethod - async def dispatch_one(self, entry: HandlerEntry[ENTRY_MODEL_CLS]) -> NoReturn: + async def dispatch_one(self, entry: HandlerEntry[ENTRY_MODEL_CLS]) -> None: """Dispatch one row. :param entry: Entry to be dispatched. @@ -226,14 +229,14 @@ def get_action(self, topic: str) -> Optional[Callable]: "SELECT * " "FROM consumer_queue " "WHERE retry < %s AND topic IN %s " - "ORDER BY creation_date " + "ORDER BY created_at " "LIMIT %s " "FOR UPDATE SKIP LOCKED" ) _DELETE_PROCESSED_QUERY = SQL("DELETE FROM consumer_queue WHERE id = %s") -_UPDATE_NOT_PROCESSED_QUERY = SQL("UPDATE consumer_queue SET retry = retry + 1 WHERE id = %s") +_UPDATE_NOT_PROCESSED_QUERY = SQL("UPDATE consumer_queue SET retry = retry + 1, updated_at = NOW() WHERE id = %s") _LISTEN_QUERY = SQL("LISTEN {}") diff --git a/minos/networks/handlers/abc/setups.py b/minos/networks/handlers/abc/setups.py index f950abf9..a3d0a8cf 100644 --- a/minos/networks/handlers/abc/setups.py +++ b/minos/networks/handlers/abc/setups.py @@ -1,9 +1,3 @@ -"""minos.networks.handlers.abc.setups module.""" - -from typing import ( - NoReturn, -) - from psycopg2.sql import ( SQL, ) @@ -19,17 +13,18 @@ class HandlerSetup(PostgreSqlMinosDatabase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - async def _setup(self) -> NoReturn: + async def _setup(self) -> None: await self._create_event_queue_table() - async def _create_event_queue_table(self) -> NoReturn: + async def _create_event_queue_table(self) -> None: _CREATE_TABLE_QUERY = SQL( "CREATE TABLE IF NOT EXISTS consumer_queue (" '"id" BIGSERIAL NOT NULL PRIMARY KEY, ' '"topic" VARCHAR(255) NOT NULL, ' - '"partition_id" INTEGER,' - '"binary_data" BYTEA NOT NULL, ' + '"partition" INTEGER,' + '"data" BYTEA NOT NULL, ' '"retry" INTEGER NOT NULL DEFAULT 0,' - '"creation_date" TIMESTAMP NOT NULL)' + '"created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(), ' + '"updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW())' ) await self.submit_query(_CREATE_TABLE_QUERY, lock=hash("consumer_queue")) diff --git a/minos/networks/handlers/command_replies/__init__.py b/minos/networks/handlers/command_replies/__init__.py index 3d50da5c..99238638 100644 --- a/minos/networks/handlers/command_replies/__init__.py +++ b/minos/networks/handlers/command_replies/__init__.py @@ -1,11 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" - from .handlers import ( CommandReplyHandler, ) diff --git a/minos/networks/handlers/command_replies/handlers.py b/minos/networks/handlers/command_replies/handlers.py index 926aeced..b78a8f12 100644 --- a/minos/networks/handlers/command_replies/handlers.py +++ b/minos/networks/handlers/command_replies/handlers.py @@ -1,5 +1,3 @@ -"""minos.networks.handlers.command_replies.handlers module.""" - from __future__ import ( annotations, ) @@ -7,7 +5,6 @@ import logging from typing import ( Any, - NoReturn, ) from dependency_injector.wiring import ( @@ -46,9 +43,10 @@ def __init__(self, saga_manager: MinosSagaManager = None, **kwargs: Any): @classmethod def _from_config(cls, *args, config: MinosConfig, **kwargs) -> CommandReplyHandler: handlers = {f"{config.service.name}Reply": None} + # noinspection PyProtectedMember return cls(*args, handlers=handlers, **config.broker.queue._asdict(), **kwargs) - async def dispatch_one(self, entry: HandlerEntry[CommandReply]) -> NoReturn: + async def dispatch_one(self, entry: HandlerEntry[CommandReply]) -> None: """Dispatch one row. :param entry: Entry to be dispatched. diff --git a/minos/networks/handlers/command_replies/services.py b/minos/networks/handlers/command_replies/services.py index 5092ddb5..a4c7e376 100644 --- a/minos/networks/handlers/command_replies/services.py +++ b/minos/networks/handlers/command_replies/services.py @@ -1,5 +1,3 @@ -"""minos.networks.handlers.command_replies.services module.""" - import logging from aiomisc import ( diff --git a/minos/networks/handlers/commands/__init__.py b/minos/networks/handlers/commands/__init__.py index e200491f..2e7e22fb 100644 --- a/minos/networks/handlers/commands/__init__.py +++ b/minos/networks/handlers/commands/__init__.py @@ -1,11 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" - from .handlers import ( CommandHandler, ) diff --git a/minos/networks/handlers/commands/handlers.py b/minos/networks/handlers/commands/handlers.py index fdb817a7..eb6ebbac 100644 --- a/minos/networks/handlers/commands/handlers.py +++ b/minos/networks/handlers/commands/handlers.py @@ -1,9 +1,3 @@ -# Copyright (C) 2020 Clariteia SL -# -# This file is part of minos framework. -# -# Minos framework can not be copied and/or distributed without the express -# permission of Clariteia SL. from __future__ import ( annotations, ) @@ -19,7 +13,6 @@ Any, Awaitable, Callable, - NoReturn, Optional, Tuple, Union, @@ -79,9 +72,10 @@ def _from_config(cls, *args, config: MinosConfig, **kwargs) -> CommandHandler: decorator.topic: fn for decorator, fn in chain(command_decorators.items(), query_decorators.items()) } + # noinspection PyProtectedMember return cls(handlers=handlers, **config.broker.queue._asdict(), **kwargs) - async def dispatch_one(self, entry: HandlerEntry[Command]) -> NoReturn: + async def dispatch_one(self, entry: HandlerEntry[Command]) -> None: """Dispatch one row. :param entry: Entry to be dispatched. diff --git a/minos/networks/handlers/commands/services.py b/minos/networks/handlers/commands/services.py index 0a9bee1a..1442277d 100644 --- a/minos/networks/handlers/commands/services.py +++ b/minos/networks/handlers/commands/services.py @@ -1,5 +1,3 @@ -"""minos.networks.handlers.commands.services module.""" - import logging from aiomisc import ( diff --git a/minos/networks/handlers/consumers.py b/minos/networks/handlers/consumers.py index d8f46a3a..5103ba07 100644 --- a/minos/networks/handlers/consumers.py +++ b/minos/networks/handlers/consumers.py @@ -1,5 +1,3 @@ -"""minos.networks.abc.consumers module.""" - from __future__ import ( annotations, ) @@ -82,6 +80,7 @@ def _from_config(cls, config: MinosConfig, **kwargs) -> Consumer: # replies topics |= {f"{config.service.name}Reply"} + # noinspection PyProtectedMember return cls( topics=topics, broker=config.broker, group_id=config.service.name, **config.broker.queue._asdict(), **kwargs ) @@ -128,6 +127,10 @@ async def remove_topic(self, topic: str) -> None: @property def client(self) -> AIOKafkaConsumer: + """Get the kafka consumer client. + + :return: An ``AIOKafkaConsumer`` instance. + """ if self._client is None: # pragma: no cover self._client = AIOKafkaConsumer( *self._topics, @@ -196,10 +199,6 @@ async def enqueue(self, topic: str, partition: int, binary: bytes) -> int: return row[0] -_INSERT_QUERY = SQL( - "INSERT INTO consumer_queue (topic, partition_id, binary_data, creation_date) " - "VALUES (%s, %s, %s, NOW()) " - "RETURNING id" -) +_INSERT_QUERY = SQL("INSERT INTO consumer_queue (topic, partition, data) VALUES (%s, %s, %s) RETURNING id") _NOTIFY_QUERY = SQL("NOTIFY {}") diff --git a/minos/networks/handlers/dynamic/__init__.py b/minos/networks/handlers/dynamic/__init__.py index 2fa866ad..61210bf0 100644 --- a/minos/networks/handlers/dynamic/__init__.py +++ b/minos/networks/handlers/dynamic/__init__.py @@ -1,4 +1,3 @@ -"""minos.networks.handlers.dynamic module.""" from .handlers import ( DynamicHandler, ) diff --git a/minos/networks/handlers/dynamic/handlers.py b/minos/networks/handlers/dynamic/handlers.py index 5737a4e3..a2664334 100644 --- a/minos/networks/handlers/dynamic/handlers.py +++ b/minos/networks/handlers/dynamic/handlers.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from __future__ import ( annotations, ) @@ -160,6 +153,6 @@ def _build_entries(rows: list[tuple]) -> list[HandlerEntry]: ) _SELECT_NOT_PROCESSED_ROWS_QUERY = SQL( - "SELECT * FROM consumer_queue WHERE topic = %s ORDER BY creation_date LIMIT %s FOR UPDATE SKIP LOCKED" + "SELECT * FROM consumer_queue WHERE topic = %s ORDER BY created_at LIMIT %s FOR UPDATE SKIP LOCKED" ) _DELETE_PROCESSED_QUERY = SQL("DELETE FROM consumer_queue WHERE id = %s") diff --git a/minos/networks/handlers/dynamic/pools.py b/minos/networks/handlers/dynamic/pools.py index 337d4bc7..87956cd3 100644 --- a/minos/networks/handlers/dynamic/pools.py +++ b/minos/networks/handlers/dynamic/pools.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from __future__ import ( annotations, ) diff --git a/minos/networks/handlers/entries.py b/minos/networks/handlers/entries.py index d00ee70e..d47f9c8a 100644 --- a/minos/networks/handlers/entries.py +++ b/minos/networks/handlers/entries.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from __future__ import ( annotations, ) @@ -28,6 +21,7 @@ from minos.common import ( MinosException, Model, + current_datetime, ) logger = logging.getLogger(__name__) @@ -41,24 +35,30 @@ def __init__( self, id: int, topic: str, - partition_id: int, + partition: int, data_bytes: bytes, retry: int = 0, created_at: Optional[datetime] = None, + updated_at: Optional[datetime] = None, data_cls: Type[Model] = Model, callback_lookup: Optional[Callable] = None, exception: Optional[Exception] = None, ): - if created_at is None: - created_at = datetime.now() + if created_at is None or updated_at is None: + now = current_datetime() + if created_at is None: + created_at = now + if updated_at is None: + updated_at = now self.id = id self.topic = topic - self.partition_id = partition_id + self.partition = partition self.data_bytes = data_bytes self.data_cls = data_cls self.retry = retry self.created_at = created_at + self.updated_at = updated_at self.callback_lookup = callback_lookup self.exception = exception diff --git a/minos/networks/handlers/events/__init__.py b/minos/networks/handlers/events/__init__.py index 72d3f625..d5c144df 100644 --- a/minos/networks/handlers/events/__init__.py +++ b/minos/networks/handlers/events/__init__.py @@ -1,5 +1,3 @@ -"""minos.networks.handlers.events module.""" - from .handlers import ( EventHandler, ) diff --git a/minos/networks/handlers/events/handlers.py b/minos/networks/handlers/events/handlers.py index e14cd320..e7833a30 100644 --- a/minos/networks/handlers/events/handlers.py +++ b/minos/networks/handlers/events/handlers.py @@ -1,9 +1,3 @@ -# Copyright (C) 2020 Clariteia SL -# -# This file is part of minos framework. -# -# Minos framework can not be copied and/or distributed without the express -# permission of Clariteia SL. from __future__ import ( annotations, ) @@ -24,8 +18,7 @@ from typing import ( Awaitable, Callable, - NoReturn, - Union, + Optional, ) from minos.common import ( @@ -65,9 +58,10 @@ def _from_config(cls, *args, config: MinosConfig, **kwargs) -> EventHandler: handlers = {decorator.topic: fn for decorator, fn in decorators.items()} + # noinspection PyProtectedMember return cls(handlers=handlers, **config.broker.queue._asdict(), **kwargs) - async def _dispatch_entries(self, entries: list[HandlerEntry[Event]]) -> NoReturn: + async def _dispatch_entries(self, entries: list[HandlerEntry[Event]]) -> None: grouped = defaultdict(list) for entry in entries: grouped[uuid_getter(entry)].append(entry) @@ -82,7 +76,7 @@ async def _dispatch_group(self, entries: list[HandlerEntry[Event]]): for entry in entries: await self._dispatch_one(entry) - async def dispatch_one(self, entry: HandlerEntry[Event]) -> NoReturn: + async def dispatch_one(self, entry: HandlerEntry[Event]) -> None: """Dispatch one row. :param entry: Entry to be dispatched. @@ -94,16 +88,14 @@ async def dispatch_one(self, entry: HandlerEntry[Event]) -> NoReturn: await fn(entry.data) @staticmethod - def get_callback( - fn: Callable[[HandlerRequest], Union[NoReturn, Awaitable[NoReturn]]] - ) -> Callable[[Event], Awaitable[NoReturn]]: + def get_callback(fn: Callable[[HandlerRequest], Optional[Awaitable[None]]]) -> Callable[[Event], Awaitable[None]]: """Get the handler function to be used by the Event Handler. :param fn: The action function. :return: A wrapper function around the given one that is compatible with the Event Handler API. """ - async def _fn(event: Event) -> NoReturn: + async def _fn(event: Event) -> None: try: request = HandlerRequest(event) response = fn(request) diff --git a/minos/networks/handlers/events/services.py b/minos/networks/handlers/events/services.py index dc769bdf..ca5cc068 100644 --- a/minos/networks/handlers/events/services.py +++ b/minos/networks/handlers/events/services.py @@ -1,5 +1,3 @@ -"""minos.networks.handlers.events.services module.""" - import logging from aiomisc import ( diff --git a/minos/networks/handlers/messages.py b/minos/networks/handlers/messages.py index d2daba18..91a8be26 100644 --- a/minos/networks/handlers/messages.py +++ b/minos/networks/handlers/messages.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from __future__ import ( annotations, ) diff --git a/minos/networks/handlers/services.py b/minos/networks/handlers/services.py index bd585b01..0581e568 100644 --- a/minos/networks/handlers/services.py +++ b/minos/networks/handlers/services.py @@ -1,5 +1,3 @@ -"""minos.networks.handlers.services module.""" - import logging from typing import ( Any, diff --git a/minos/networks/messages.py b/minos/networks/messages.py index 51547f00..c9564e17 100644 --- a/minos/networks/messages.py +++ b/minos/networks/messages.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from __future__ import ( annotations, ) diff --git a/minos/networks/rest/__init__.py b/minos/networks/rest/__init__.py index 23f6edb1..33024825 100644 --- a/minos/networks/rest/__init__.py +++ b/minos/networks/rest/__init__.py @@ -1,11 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" - from .handlers import ( RestHandler, ) diff --git a/minos/networks/rest/handlers.py b/minos/networks/rest/handlers.py index 6b9e1acd..2967fff4 100644 --- a/minos/networks/rest/handlers.py +++ b/minos/networks/rest/handlers.py @@ -1,9 +1,3 @@ -# Copyright (C) 2020 Clariteia SL -# -# This file is part of minos framework. -# -# Minos framework can not be copied and/or distributed without the express -# permission of Clariteia SL. from __future__ import ( annotations, ) @@ -21,7 +15,6 @@ from typing import ( Awaitable, Callable, - NoReturn, Optional, Union, ) @@ -122,7 +115,7 @@ def _mount_routes(self, app: web.Application): # Load default routes self._mount_system_health(app) - def _mount_one_route(self, method: str, url: str, action: Callable, app: web.Application) -> NoReturn: + def _mount_one_route(self, method: str, url: str, action: Callable, app: web.Application) -> None: handler = self.get_callback(action) app.router.add_route(method, url, handler) @@ -172,4 +165,4 @@ async def _system_health_handler(request: web.Request) -> web.Response: :return: A `web.json_response` response. """ logger.info(f"Dispatching '{request!s}' from '{request.remote!s}'...") - return web.json_response({"host": request.host}, status=200) + return web.json_response({"host": request.host}) diff --git a/minos/networks/rest/messages.py b/minos/networks/rest/messages.py index d2389599..e6a868c0 100644 --- a/minos/networks/rest/messages.py +++ b/minos/networks/rest/messages.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from __future__ import ( annotations, ) diff --git a/minos/networks/rest/services.py b/minos/networks/rest/services.py index 4333c01a..3a602453 100644 --- a/minos/networks/rest/services.py +++ b/minos/networks/rest/services.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" from aiohttp import ( web, ) diff --git a/minos/networks/snapshots.py b/minos/networks/snapshots.py index 988199a4..12d930a3 100644 --- a/minos/networks/snapshots.py +++ b/minos/networks/snapshots.py @@ -1,36 +1,36 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" +from typing import ( + Optional, +) from aiomisc.service.periodic import ( PeriodicService, ) -from cached_property import ( - cached_property, +from dependency_injector.wiring import ( + Provide, ) from minos.common import ( - PostgreSqlSnapshotBuilder, + MinosSnapshot, ) class SnapshotService(PeriodicService): """Minos Snapshot Service class.""" - def __init__(self, interval: int = 60, **kwargs): + snapshot: MinosSnapshot = Provide["snapshot"] + + def __init__(self, snapshot: Optional[MinosSnapshot] = None, interval: float = 60, **kwargs): super().__init__(interval=interval, **kwargs) - self._init_kwargs = kwargs + + if snapshot is not None: + self.snapshot = snapshot async def start(self) -> None: """Start the service execution. :return: This method does not return anything. """ - await self.dispatcher.setup() + await self.snapshot.setup() await super().start() async def callback(self) -> None: @@ -38,7 +38,7 @@ async def callback(self) -> None: :return: This method does not return anything. """ - await self.dispatcher.dispatch() + await self.snapshot.synchronize() async def stop(self, err: Exception = None) -> None: """Stop the service execution. @@ -47,12 +47,4 @@ async def stop(self, err: Exception = None) -> None: :return: This method does not return anything. """ await super().stop(err) - await self.dispatcher.destroy() - - @cached_property - def dispatcher(self) -> PostgreSqlSnapshotBuilder: - """Get the service dispatcher. - - :return: A ``PostgreSqlSnapshotBuilder`` instance. - """ - return PostgreSqlSnapshotBuilder.from_config(**self._init_kwargs) + await self.snapshot.destroy() diff --git a/minos/networks/utils.py b/minos/networks/utils.py index d1abe00b..3ab9f706 100644 --- a/minos/networks/utils.py +++ b/minos/networks/utils.py @@ -1,5 +1,3 @@ -"""minos.networks.utils module.""" - import re import socket from asyncio import ( diff --git a/poetry.lock b/poetry.lock index d2c57f9e..d7d9b2f4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -19,7 +19,7 @@ speedups = ["aiodns", "brotlipy", "cchardet"] [[package]] name = "aiokafka" -version = "0.7.1" +version = "0.7.2" description = "Kafka integration with asyncio." category = "main" optional = false @@ -33,7 +33,7 @@ snappy = ["python-snappy (>=0.5)"] [[package]] name = "aiomisc" -version = "14.4.1" +version = "14.4.3" description = "aiomisc - miscellaneous utils for asyncio" category = "main" optional = false @@ -48,7 +48,7 @@ asgi = ["aiohttp-asgi"] carbon = ["aiocarbon (>=0.15,<1.0)"] contextvars = ["contextvars (>=2.4,<3.0)"] cron = ["croniter (>=0.3.34,<0.4.0)"] -develop = ["aiocontextvars (==0.2.2)", "aiohttp (<4)", "aiohttp-asgi", "async-generator", "async-timeout", "coverage (==4.5.1)", "coveralls", "croniter (>=0.3.34,<0.4.0)", "fastapi", "freezegun (<1.1)", "mypy (>=0.782,<1.0)", "pylava", "pytest", "pytest-cov (>=2.5.1,<2.6.0)", "pytest-freezegun (>=0.4.2,<0.5.0)", "sphinx (>=3.5.1)", "sphinx-autobuild", "sphinx-intl", "timeout-decorator", "types-croniter", "tox (>=2.4)"] +develop = ["aiocontextvars (==0.2.2)", "aiohttp (<4)", "aiohttp-asgi", "async-timeout", "coverage (==4.5.1)", "coveralls", "croniter (>=0.3.34,<0.4.0)", "fastapi", "freezegun (<1.1)", "mypy (>=0.782,<1.0)", "pylava", "pytest", "pytest-cov (>=2.5.1,<2.6.0)", "pytest-freezegun (>=0.4.2,<0.5.0)", "sphinx (>=3.5.1)", "sphinx-autobuild", "sphinx-intl", "timeout-decorator", "types-croniter", "tox (>=2.4)"] raven = ["raven-aiohttp"] uvloop = ["uvloop (>=0.14,<1)"] @@ -185,7 +185,7 @@ pycparser = "*" [[package]] name = "cfgv" -version = "3.3.0" +version = "3.3.1" description = "Validate configuration and produce human readable error messages." category = "dev" optional = false @@ -201,7 +201,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [[package]] name = "charset-normalizer" -version = "2.0.4" +version = "2.0.5" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." category = "dev" optional = false @@ -231,15 +231,18 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [[package]] name = "colorlog" -version = "5.0.1" +version = "6.4.1" description = "Add colours to the output of Python's logging module." category = "main" optional = false -python-versions = "*" +python-versions = ">=3.6" [package.dependencies] colorama = {version = "*", markers = "sys_platform == \"win32\""} +[package.extras] +development = ["black", "flake8", "mypy", "pytest", "types-colorama"] + [[package]] name = "coverage" version = "5.5" @@ -253,7 +256,7 @@ toml = ["toml"] [[package]] name = "dependency-injector" -version = "4.35.2" +version = "4.36.0" description = "Dependency injection framework for Python" category = "main" optional = false @@ -321,7 +324,7 @@ pyflakes = ">=2.3.0,<2.4.0" [[package]] name = "identify" -version = "2.2.13" +version = "2.2.14" description = "File identification library for Python" category = "dev" optional = false @@ -434,7 +437,7 @@ python-versions = "*" [[package]] name = "minos-microservice-common" -version = "0.1.9" +version = "0.1.13" description = "Python Package with common Classes and Utilities used in Minos Microservices." category = "main" optional = false @@ -476,7 +479,7 @@ python-versions = "*" [[package]] name = "orjson" -version = "3.6.2" +version = "3.6.3" description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy" category = "main" optional = false @@ -511,7 +514,7 @@ python-versions = ">=2.6" [[package]] name = "platformdirs" -version = "2.2.0" +version = "2.3.0" description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." category = "dev" optional = false @@ -523,18 +526,19 @@ test = ["appdirs (==1.4.4)", "pytest (>=6)", "pytest-cov (>=2.7)", "pytest-mock [[package]] name = "pluggy" -version = "0.13.1" +version = "1.0.0" description = "plugin and hook calling mechanisms for python" category = "dev" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +python-versions = ">=3.6" [package.extras] dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] [[package]] name = "pre-commit" -version = "2.14.0" +version = "2.15.0" description = "A framework for managing and maintaining multi-language pre-commit hooks." category = "dev" optional = false @@ -606,7 +610,7 @@ python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" [[package]] name = "pytest" -version = "6.2.4" +version = "6.2.5" description = "pytest: simple powerful testing with Python" category = "dev" optional = false @@ -618,7 +622,7 @@ attrs = ">=19.2.0" colorama = {version = "*", markers = "sys_platform == \"win32\""} iniconfig = "*" packaging = "*" -pluggy = ">=0.12,<1.0.0a1" +pluggy = ">=0.12,<2.0" py = ">=1.8.2" toml = "*" @@ -643,7 +647,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" [[package]] name = "regex" -version = "2021.8.3" +version = "2021.8.28" description = "Alternative regular expression module, to replace re." category = "dev" optional = false @@ -685,7 +689,7 @@ python-versions = "*" [[package]] name = "sphinx" -version = "4.1.2" +version = "4.2.0" description = "Python documentation generator" category = "dev" optional = false @@ -845,7 +849,7 @@ python-versions = "*" [[package]] name = "typing-extensions" -version = "3.10.0.0" +version = "3.10.0.2" description = "Backported and Experimental Type Hints for Python 3.5+" category = "main" optional = false @@ -866,7 +870,7 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] name = "virtualenv" -version = "20.7.2" +version = "20.8.0" description = "Virtual Python Environment builder" category = "dev" optional = false @@ -898,7 +902,7 @@ multidict = ">=4.0" [metadata] lock-version = "1.1" python-versions = "^3.9" -content-hash = "5e97f98c40aad0613f1c898ac4444a838b039d53cd9f06c855006e8c76e5c90c" +content-hash = "6eb8fe705fd1bb8709ec7475c4605438f8d162f3d93cc44e11f36c4543619e68" [metadata.files] aiohttp = [ @@ -941,39 +945,31 @@ aiohttp = [ {file = "aiohttp-3.7.4.post0.tar.gz", hash = "sha256:493d3299ebe5f5a7c66b9819eacdcfbbaaf1a8e84911ddffcdc48888497afecf"}, ] aiokafka = [ - {file = "aiokafka-0.7.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:90a91155aeb28c872b74ecb3c9f671253db10cf23dc3af858bd9ed1630c0d1ae"}, - {file = "aiokafka-0.7.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:02f67258a78e5d9d17470816ea879a653c5efecc0c6686e18d792fbd38e1f70c"}, - {file = "aiokafka-0.7.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:dfd8d58f7418aabc07f1e8c1b904f478bf955919b743d4d44607dbf18a2c54b2"}, - {file = "aiokafka-0.7.1-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:8b5e71d6da8edf0f592080488b198af42fbe9778de077762e4452d574e694efa"}, - {file = "aiokafka-0.7.1-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:5fac6f1168c15b08f3fcb951347343a78d8c130292127d8a4e23466a5d2510f7"}, - {file = "aiokafka-0.7.1-cp36-cp36m-win32.whl", hash = "sha256:4cb2544ca8d5d5a4055c57fbb6c4ecfc82e6f3b670485c291b256c90d506acf3"}, - {file = "aiokafka-0.7.1-cp36-cp36m-win_amd64.whl", hash = "sha256:061799f1b8b005f950012a11948ff8a6ab48114eac91341acd8feec5430f0f31"}, - {file = "aiokafka-0.7.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b7390a9d9d03a2a3dbee0f8fa6735b008408e0f561a279b3df13e9758ab6d67f"}, - {file = "aiokafka-0.7.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:e8276baed94281ef4548f19e039b9b4a8af79afee324bd259d8898638ca15da6"}, - {file = "aiokafka-0.7.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:2294ba68ff87fdf6cf70a5603afb4020c4fc7a39053ccd8e6abdf0aa34ba1ca3"}, - {file = "aiokafka-0.7.1-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:edcf1cdcf9246edd5c4c1b649609a7ac5bfe4276da586aede470b73f9d00b809"}, - {file = "aiokafka-0.7.1-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:c70ed4b09e01d774d1821db30f6fbc6475a41224d0dc1488d018ef97610dc3da"}, - {file = "aiokafka-0.7.1-cp37-cp37m-win32.whl", hash = "sha256:2f1a2fcb5f0643527d77446437d27ed93ae94844c1b324e904a813acce675db8"}, - {file = "aiokafka-0.7.1-cp37-cp37m-win_amd64.whl", hash = "sha256:035d1fb4cb22273bb0a47f31040fabfd9b248f8026dd306dd50e7e69f005a71d"}, - {file = "aiokafka-0.7.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:120d3c477e7e9a53dd55f1a16b9c67e8a51cdc38e5e46fc25aae7d20f78519f2"}, - {file = "aiokafka-0.7.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:6e7d031b8bc08f9d9c4149c6afaedb650082309f01a3b79f0619814cc299fc4d"}, - {file = "aiokafka-0.7.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:49517e2309826c27eaff940384e90773d89c69da023907663cda7853a00fb9ee"}, - {file = "aiokafka-0.7.1-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:95edb38631bf5dbb8cd65fecd8620e11a15534cd6dd22e0dc45488b4266b5452"}, - {file = "aiokafka-0.7.1-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:09cef9cf579193b497d3c65644b71ba1523660b7677805d0efea6c3206e4e643"}, - {file = "aiokafka-0.7.1-cp38-cp38-win32.whl", hash = "sha256:47cda205e8fe16edf126c362a59071d0a4b74dd07bee6f070b26e5d2580cc37b"}, - {file = "aiokafka-0.7.1-cp38-cp38-win_amd64.whl", hash = "sha256:8ebb032a05a6696b25abbe5db677890adca9a3284d13e1975842009c1d7678dd"}, - {file = "aiokafka-0.7.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:45704e5a8c81e4db6333ab6315effc1b83feec1dfc2fc3a28e7c7600b0d80a23"}, - {file = "aiokafka-0.7.1-cp39-cp39-manylinux1_i686.whl", hash = "sha256:90a4cb54ae23ff55758a9ce8f3ba1ec67c6f2328f9197c3bacc61a24f812cf04"}, - {file = "aiokafka-0.7.1-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:567a3b856639bff36b8c74a92dfecd64ace8d07d755bb3ee6d5332273d2a8c6e"}, - {file = "aiokafka-0.7.1-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:b19d00b16637d02cfcee3d5cfdbcfd497702c09ae1f63e194830798cd223f910"}, - {file = "aiokafka-0.7.1-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:f3a2138649ca2427a91dfc0927ddd445a9a6aaf9a9b0972d683cb230923f821f"}, - {file = "aiokafka-0.7.1-cp39-cp39-win32.whl", hash = "sha256:02156dee5156a0c5283d45df0f0e8aa516ec7f3d966d7dfeb35f8ada7c8f8557"}, - {file = "aiokafka-0.7.1-cp39-cp39-win_amd64.whl", hash = "sha256:4c463265252236b7759920998862b56bad3d6eedfdfd3fce0774ad99bb2c4877"}, - {file = "aiokafka-0.7.1.tar.gz", hash = "sha256:b5a6fb1cfd77eac4b397ef5af3765d1d881c86b157137b12ca4f12aef1db433c"}, + {file = "aiokafka-0.7.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:b19f077e12fe23e359f7a7dca9baf8532c63f4c8149703ce4c56de372d17e26c"}, + {file = "aiokafka-0.7.2-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:d801bb2f5a4ae726a433ae74a5d34e7e0d44128de53c9c7eea5cb4cdaaf80175"}, + {file = "aiokafka-0.7.2-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:3b1f1e9ad66883ed809d737d57edfb13f1aeb9b08c6fd6b71afefce712c13dad"}, + {file = "aiokafka-0.7.2-cp36-cp36m-win32.whl", hash = "sha256:383cc7d45b47676fea60dbedee747c5c08dde5c10b1be0afc6598fb21a7891b4"}, + {file = "aiokafka-0.7.2-cp36-cp36m-win_amd64.whl", hash = "sha256:ce23baeaacf501f619967067d2c0d4c2b2b761012f9f9c8a49593e96c7550aff"}, + {file = "aiokafka-0.7.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c96824cef1a480fd2ab4bbd9e9aa737c9191211bab5f7787ef401926d5fda95d"}, + {file = "aiokafka-0.7.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:34eda0b6eb794c36f4100be772f3b120a3c00daaf342f593f32994a762aed7e8"}, + {file = "aiokafka-0.7.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:e6e78206e5d031e6644d3a46153a146d2d2afff4cf9da9a81edb9f8714114b62"}, + {file = "aiokafka-0.7.2-cp37-cp37m-win32.whl", hash = "sha256:ebbb258840f134bad0e6ca8681a87cd292a1f4ed7253a821c16b4e9f2610a04a"}, + {file = "aiokafka-0.7.2-cp37-cp37m-win_amd64.whl", hash = "sha256:16731e8aa0fc70dc35c31041599c9a5237dd5d2c1a4d04af58f30a942191a281"}, + {file = "aiokafka-0.7.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1a9b6ecb606062b3595bc5104b85b42b62621a86d179b75d708279041152f461"}, + {file = "aiokafka-0.7.2-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:cda55f5cfb19ea7d2f55a51d320a57312f152dab3e333fa1fbfcdde7a9e25a53"}, + {file = "aiokafka-0.7.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:7d56627c3250ba2359dfa90f2c8a3ab995795e0116038905b2f8a608cd1fd606"}, + {file = "aiokafka-0.7.2-cp38-cp38-win32.whl", hash = "sha256:be43d7ddd700d501a6f4c59c859baa9888c2d086b69882f542951bae41234f6a"}, + {file = "aiokafka-0.7.2-cp38-cp38-win_amd64.whl", hash = "sha256:594d2a29875f78d56251141ff95a982c5be64844dc9ae619c285f36c57a08c6e"}, + {file = "aiokafka-0.7.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5371bd663f545ced555775e7e49f39a54b243435098a9699582bb3b32884e332"}, + {file = "aiokafka-0.7.2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:b1958277eaa702509591c0674790a8c9aced8fef7723dafae0f9aec6d2da71a5"}, + {file = "aiokafka-0.7.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:7fe02a3868236d84356d5fa7c7625ed3a27e52699477c5ee8bd5dc9b5adb592f"}, + {file = "aiokafka-0.7.2-cp39-cp39-win32.whl", hash = "sha256:a3bfe4ad7d3829a98c8391a9a28f179b47df4f66e26ea5b1c665f872b6e21809"}, + {file = "aiokafka-0.7.2-cp39-cp39-win_amd64.whl", hash = "sha256:6116b68ca975caafd7efd338ffdaec63789e1c334af6174e20edc1d16d14e463"}, + {file = "aiokafka-0.7.2.tar.gz", hash = "sha256:a8fc41d18731d8879483aecb93ae7ebf5457f63daf4c8923ddc046792c2c3096"}, ] aiomisc = [ - {file = "aiomisc-14.4.1-py3-none-any.whl", hash = "sha256:8101da063dc0fb29dca41c91abfc71f512b56bb588a32421e91b21fd14c0e0f3"}, - {file = "aiomisc-14.4.1.tar.gz", hash = "sha256:7ba55acc462b29a7f97bbf5485ff2b6f509c06a6a4e3e5be62c41ee490dfefd0"}, + {file = "aiomisc-14.4.3-py3-none-any.whl", hash = "sha256:d3ffd130705f64bf7ba63b48d975d8b849a950526f40202076d5e3b94b4e6157"}, + {file = "aiomisc-14.4.3.tar.gz", hash = "sha256:3059483a396c554c214e91c1e7c1767802b13489a1e61ed09269bc40d6d68b0d"}, ] aiopg = [ {file = "aiopg-1.3.1-py3-none-any.whl", hash = "sha256:7a3fb1eb399ab0bb0335ddca66b51de31f6bb2251b5af2a45e7fec20040e5eac"}, @@ -1067,16 +1063,16 @@ cffi = [ {file = "cffi-1.14.6.tar.gz", hash = "sha256:c9a875ce9d7fe32887784274dd533c57909b7b1dcadcc128a2ac21331a9765dd"}, ] cfgv = [ - {file = "cfgv-3.3.0-py2.py3-none-any.whl", hash = "sha256:b449c9c6118fe8cca7fa5e00b9ec60ba08145d281d52164230a69211c5d597a1"}, - {file = "cfgv-3.3.0.tar.gz", hash = "sha256:9e600479b3b99e8af981ecdfc80a0296104ee610cab48a5ae4ffd0b668650eb1"}, + {file = "cfgv-3.3.1-py2.py3-none-any.whl", hash = "sha256:c6a0883f3917a037485059700b9e75da2464e6c27051014ad85ba6aaa5884426"}, + {file = "cfgv-3.3.1.tar.gz", hash = "sha256:f5a830efb9ce7a445376bb66ec94c638a9787422f96264c98edc6bdeed8ab736"}, ] chardet = [ {file = "chardet-4.0.0-py2.py3-none-any.whl", hash = "sha256:f864054d66fd9118f2e67044ac8981a54775ec5b67aed0441892edb553d21da5"}, {file = "chardet-4.0.0.tar.gz", hash = "sha256:0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa"}, ] charset-normalizer = [ - {file = "charset-normalizer-2.0.4.tar.gz", hash = "sha256:f23667ebe1084be45f6ae0538e4a5a865206544097e4e8bbcacf42cd02a348f3"}, - {file = "charset_normalizer-2.0.4-py3-none-any.whl", hash = "sha256:0c8911edd15d19223366a194a513099a302055a962bca2cec0f54b8b63175d8b"}, + {file = "charset-normalizer-2.0.5.tar.gz", hash = "sha256:7098e7e862f6370a2a8d1a6398cd359815c45d12626267652c3f13dec58e2367"}, + {file = "charset_normalizer-2.0.5-py3-none-any.whl", hash = "sha256:fa471a601dfea0f492e4f4fca035cd82155e65dc45c9b83bf4322dfab63755dd"}, ] click = [ {file = "click-8.0.1-py3-none-any.whl", hash = "sha256:fba402a4a47334742d782209a7c79bc448911afe1149d07bdabdf480b3e2f4b6"}, @@ -1087,8 +1083,8 @@ colorama = [ {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, ] colorlog = [ - {file = "colorlog-5.0.1-py2.py3-none-any.whl", hash = "sha256:4e6be13d9169254e2ded6526a6a4a1abb8ac564f2fa65b310a98e4ca5bea2c04"}, - {file = "colorlog-5.0.1.tar.gz", hash = "sha256:f17c013a06962b02f4449ee07cfdbe6b287df29efc2c9a1515b4a376f4e588ea"}, + {file = "colorlog-6.4.1-py2.py3-none-any.whl", hash = "sha256:b13da382156711f7973bf7cbd1f40ea544aff51fde5dc3fb8f3fa602c321d645"}, + {file = "colorlog-6.4.1.tar.gz", hash = "sha256:af99440154a01f27c09256760ea3477982bf782721feaa345904e806879df4d8"}, ] coverage = [ {file = "coverage-5.5-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:b6d534e4b2ab35c9f93f46229363e17f63c53ad01330df9f2d6bd1187e5eaacf"}, @@ -1145,68 +1141,68 @@ coverage = [ {file = "coverage-5.5.tar.gz", hash = "sha256:ebe78fe9a0e874362175b02371bdfbee64d8edc42a044253ddf4ee7d3c15212c"}, ] dependency-injector = [ - {file = "dependency-injector-4.35.2.tar.gz", hash = "sha256:56d992b7a6c3c9aedb8cebe0a526d392cee1bbd8a99dfc2257b5bb36171086ee"}, - {file = "dependency_injector-4.35.2-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:7d8bd560c5898617cd6a493379762a41405b88a663c544f1f693637089de0982"}, - {file = "dependency_injector-4.35.2-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:1a49fa5cd8b7d10780c4be54e7843c5c81def1e11df5e8a39d23e7cac896e9f0"}, - {file = "dependency_injector-4.35.2-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:a8cc5882c635442aa1b18e533ab95799eae8cb38aad31336f15d1f4902bef9a9"}, - {file = "dependency_injector-4.35.2-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:578c8213169919316fc9a319a2ed696e13b1c0feb80d63044ffc913d83087575"}, - {file = "dependency_injector-4.35.2-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:d65fc19f4c51de04d90a581b837e39a1e58a24bd74eab47659aaae43ca7a2f0e"}, - {file = "dependency_injector-4.35.2-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:0aeeca1dfc4b406df89e8c5a09500d55c62dc5fef9bf9cb2ebccd2717c51f166"}, - {file = "dependency_injector-4.35.2-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:d5e0bd0abe9a931bcc1844b98c73507e65abc9183a7ca66726bdbeb711795501"}, - {file = "dependency_injector-4.35.2-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:7f2b4822acee5fc820af3040891d41a001143ca18625a9e79fa184680b7c22af"}, - {file = "dependency_injector-4.35.2-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:246d064550d0d3cc037030e3c9ff7bfb4b650564bea7e8f78afe687d6e8f7c62"}, - {file = "dependency_injector-4.35.2-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:cb2db852acfe0358603e7615a3453bc0946c2936f2bf001051608bc30dad59ac"}, - {file = "dependency_injector-4.35.2-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:4acd5aa179330983835083c579960c54960850401fbd6049e9ec62deee192b33"}, - {file = "dependency_injector-4.35.2-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:6920fa3b26eb0903a395a18e928c692001342f194f4a78f59a9ba4f04eb8aa75"}, - {file = "dependency_injector-4.35.2-cp35-cp35m-manylinux2010_i686.whl", hash = "sha256:16fbd076656356f6f303e018bba3e3cd59b08a242f8d371d096530533ed5969b"}, - {file = "dependency_injector-4.35.2-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:50beb9fac8f0537bfa43a5fb36ae84bf4e9a94ad47586488fc51d14d2adc9c03"}, - {file = "dependency_injector-4.35.2-cp35-cp35m-manylinux2014_aarch64.whl", hash = "sha256:ad306c739c873977b23050e901ce6787b7ed0096e33cd6fc1a259caca2d224fd"}, - {file = "dependency_injector-4.35.2-cp35-cp35m-win32.whl", hash = "sha256:869d1022182c3a16329a86209e942641b0112fa6ec4d0b26f00b3bcb104f8978"}, - {file = "dependency_injector-4.35.2-cp35-cp35m-win_amd64.whl", hash = "sha256:635236a3f9f58c7c705788318b7f53511a6e414476a6f888847a88bc14a81b62"}, - {file = "dependency_injector-4.35.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:76d7f435565a62c0c4f957adc085fd5d5174f4376e758a44869eee9bf76c539c"}, - {file = "dependency_injector-4.35.2-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:c610818745e5bb1b5dc7b294e35c2e0622803ec767560a674f7229c35b71c0e6"}, - {file = "dependency_injector-4.35.2-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:ab83505ec72025fba861ea42edc48ba7f5b110765b038f6e8c120abb9a4294c0"}, - {file = "dependency_injector-4.35.2-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:0164767180ebecb34cdf66ced6892c5c54cbedefe35e97b8363274a70ab3da73"}, - {file = "dependency_injector-4.35.2-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:d2ffff77aabfbcbc24abf38a97a64c04310a0164c43d08fca0bd2fe10e748ed6"}, - {file = "dependency_injector-4.35.2-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:8a2afcf51e4cfdfe2066ca29aff1bc8807b683f8d0d70a1246f0875135693bdd"}, - {file = "dependency_injector-4.35.2-cp36-cp36m-win32.whl", hash = "sha256:0a1f3fbc3fcade9cc9f7c0a7792bb6f0878bbd4c56c4161d494c392627b0cc89"}, - {file = "dependency_injector-4.35.2-cp36-cp36m-win_amd64.whl", hash = "sha256:cd77e5fc8fb9b4f0d7ef771c357e05f4bfe3268dfbe288cb57f423e201dbb79b"}, - {file = "dependency_injector-4.35.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:6ceea0734180bf0e9e35bbfaf0fcecca5cb6a1184dc037b3958ce54a78c90723"}, - {file = "dependency_injector-4.35.2-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:d16223d52275a8ba6baae5a330366ddd7f24f5dcc0618596787220635e18dcfa"}, - {file = "dependency_injector-4.35.2-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:29eb57680f924eaa28c075c765b2babd222ae5768d21d2b76075e158dd53bd71"}, - {file = "dependency_injector-4.35.2-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:124c5ccf6273a20724e12db327172f89340afb7f9a99bf94b7914dfbef5cab8a"}, - {file = "dependency_injector-4.35.2-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:26ab4d7fdd57f33c0d641801768216743c398e47e42ac11b092f0c4601b292e5"}, - {file = "dependency_injector-4.35.2-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:0f88765ca96d006229505608f6d0d1e13b4336147c084df727c5989d9d74ccd2"}, - {file = "dependency_injector-4.35.2-cp37-cp37m-win32.whl", hash = "sha256:91ac7f2fc090201c0620be1a731c8ab15b7247274a4087b9c060de41e6af806a"}, - {file = "dependency_injector-4.35.2-cp37-cp37m-win_amd64.whl", hash = "sha256:977004eb17c16e28d100ab67855398fe1e17c5aed6ba96c0230129ed9549beca"}, - {file = "dependency_injector-4.35.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f84601e0aa7633711205cd9e6b3400204fec6a3e35609d59c238c99bdcedf57c"}, - {file = "dependency_injector-4.35.2-cp38-cp38-manylinux1_i686.whl", hash = "sha256:bfca8103712a2f537ff485e082a25df70029018b5a3c7ee3fe43e17e9c7d9c86"}, - {file = "dependency_injector-4.35.2-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:c8c8af4f1c1398c334f7a64421ecb780b90f063cae1ddbf015e929c2d452e9a6"}, - {file = "dependency_injector-4.35.2-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:4e2d7094a51de95757ecf3dc507a0e002ce0624b811cab25e66151b1456fbe78"}, - {file = "dependency_injector-4.35.2-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:88161d04e64bc4f757579aea14e9d65d46f7db166fce93ea56e16fb4aa786b7a"}, - {file = "dependency_injector-4.35.2-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:fdcfc55b1be8a898168902e06a0899456b7ac7bcae786119a48b39734df72060"}, - {file = "dependency_injector-4.35.2-cp38-cp38-win32.whl", hash = "sha256:773f6b5c1d87361fafd26dcbef024cb92f87e3a6bb87db27f2ea0e24b8aab4f7"}, - {file = "dependency_injector-4.35.2-cp38-cp38-win_amd64.whl", hash = "sha256:4982d1efba0821971e65f42e1d0021d62197b08ee86047e7cf4f0d04922c59da"}, - {file = "dependency_injector-4.35.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:89de23d6859039bac0556f6af04ac9ad01d486c3e4148970be93932c3ff7f21b"}, - {file = "dependency_injector-4.35.2-cp39-cp39-manylinux1_i686.whl", hash = "sha256:eb17ddb33a3c951a4b5e41a6f161beec1508b48f3af78219c4d61f21d3c53999"}, - {file = "dependency_injector-4.35.2-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:1ba1020576134d654c21d25d7967f85dac252f5aa659f9adcd5148b44ab76088"}, - {file = "dependency_injector-4.35.2-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:7590c61e57a10ffce9cd44a98b4d8df3d4db411873de9845310251ad9347e5b0"}, - {file = "dependency_injector-4.35.2-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:bf693a92ff49a83cd0d4e76dbde965dc18c8543dfaeb363f7dc542778c7755d1"}, - {file = "dependency_injector-4.35.2-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:4c2fab9d0da82f01d347289cf70b93cc1223a6b9c866e56553c577682467ebc1"}, - {file = "dependency_injector-4.35.2-cp39-cp39-win32.whl", hash = "sha256:3b4edd5b614a912ba092a26cc1ec08d7e5e2317267f88555f3cb39d8ca84a467"}, - {file = "dependency_injector-4.35.2-cp39-cp39-win_amd64.whl", hash = "sha256:906a1049dffa6432fd2b51b29c728338d845eeeb0eff3984fa55f11b91842ed0"}, - {file = "dependency_injector-4.35.2-pp27-pypy_73-macosx_10_9_x86_64.whl", hash = "sha256:8b3654d4851a18199ce4e7748e64e69f85c1ccbbbb1d8c845d1b809130e5bc76"}, - {file = "dependency_injector-4.35.2-pp27-pypy_73-manylinux1_x86_64.whl", hash = "sha256:05d6786d4b823e3e07b85288966325f758c6c0b540381ac83cd414dd28f22e6d"}, - {file = "dependency_injector-4.35.2-pp27-pypy_73-manylinux2010_x86_64.whl", hash = "sha256:a461b1a8d256ec3408aa26db605b636a061aa67048a667fbdae1aa6b2f667fce"}, - {file = "dependency_injector-4.35.2-pp27-pypy_73-win32.whl", hash = "sha256:effce01c5e9b87f124854d9afd42224d453e5a558c0613eb4d2a3efc1c317e8b"}, - {file = "dependency_injector-4.35.2-pp36-pypy36_pp73-macosx_10_9_x86_64.whl", hash = "sha256:3b3ea615f27a6c036b0a4e57671d8834d1b1958ce47cda8c79a9751ca8fbb5c8"}, - {file = "dependency_injector-4.35.2-pp36-pypy36_pp73-manylinux1_x86_64.whl", hash = "sha256:d64477e5ef68d65d5e7a09fce7d4321648300435bb67bc277c0a1c4349c08ed6"}, - {file = "dependency_injector-4.35.2-pp36-pypy36_pp73-manylinux2010_x86_64.whl", hash = "sha256:35969afea56e332790dc42678f003c8fac80a7047b26a5689fa6f887c8771083"}, - {file = "dependency_injector-4.35.2-pp36-pypy36_pp73-win32.whl", hash = "sha256:c0ef2211b385c61a8273bf5f70644f87cc5dbbcf2c725c92039bec0e85d28176"}, - {file = "dependency_injector-4.35.2-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:3724ea891f581599698ac53ac2a550a8c5473e36dd66074c7d491b466d614527"}, - {file = "dependency_injector-4.35.2-pp37-pypy37_pp73-manylinux1_x86_64.whl", hash = "sha256:256c87fe72bfabceaafaae5ac9be1a5777f572688cebc16a11270558c52f3a4e"}, - {file = "dependency_injector-4.35.2-pp37-pypy37_pp73-manylinux2010_x86_64.whl", hash = "sha256:755f6b877c8bfb72851a4034dab984073e90af3500a354c2c3276b3be5a2c95b"}, - {file = "dependency_injector-4.35.2-pp37-pypy37_pp73-win32.whl", hash = "sha256:dde655cf24416920c0d0bcc0ce15f85f333f77bee7dfa4786a7199fa61bc26ce"}, + {file = "dependency-injector-4.36.0.tar.gz", hash = "sha256:a5f6090062c7d19947a65fad932f37992cc8a8558d375f040322b72b244a135f"}, + {file = "dependency_injector-4.36.0-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:01dfc4aaee8bdd6b12e13a052571501eaa2e395c1729f00d956bdf62b34d8436"}, + {file = "dependency_injector-4.36.0-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:7e4b517e71498916fdb6310809cb4ea294abee6c1cec9c3e6e663ef84ea87b5d"}, + {file = "dependency_injector-4.36.0-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:ba13d419d4364851dfc5fbf5ee685d851a42542f67f62a5ede1c1bc164cd6369"}, + {file = "dependency_injector-4.36.0-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:2ff603505bc61a622410055c0a92076d7f2ea95699b3a11ad0ad29269c44aa7a"}, + {file = "dependency_injector-4.36.0-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:52055e6026893945b5ddc1873e09b3bd6d1cda56e164bcaf75285527ee3b8114"}, + {file = "dependency_injector-4.36.0-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:17668003e34afa96a538d23dfc16ce730aa4d04ed7ac8cfd2a252f12f56bd083"}, + {file = "dependency_injector-4.36.0-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:a9502d2530cdf284fe9df87a779ceee7711c6b1cb742e2f972aa59c6ce4c7878"}, + {file = "dependency_injector-4.36.0-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:21ed6b93be233fb4b46c094a3ba260f5c6f852ea2c4c01578fb097a640403783"}, + {file = "dependency_injector-4.36.0-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:460f914fd0db486799e557daf294b8679656fe856c9dd015b5b219efa1a9e517"}, + {file = "dependency_injector-4.36.0-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:413289f9890ab40bf9e053bb08ea956f6c33e6f6052a3607a85c298f713b832d"}, + {file = "dependency_injector-4.36.0-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:f7dc2aa1628ce1a8d14a08c7d60af5027aa1f2dbc1ff500ae2c16fd6b2a64ec3"}, + {file = "dependency_injector-4.36.0-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:50a19b90575820b75ae9a353d0bdaa5f5ec185e00bc1086eccb70e5171f841b4"}, + {file = "dependency_injector-4.36.0-cp35-cp35m-manylinux2010_i686.whl", hash = "sha256:6d29e4663b7f32b344fbb89d300997ce2ded092c00b579ff9af790fb4f280d7b"}, + {file = "dependency_injector-4.36.0-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:c45e78ba34a908cbedb5cb69fc1724762a025ed464c4c9f96c4df6caa4ba9d9d"}, + {file = "dependency_injector-4.36.0-cp35-cp35m-manylinux2014_aarch64.whl", hash = "sha256:6abf2fe5bc1fc49a90f7319ad699565f4606b314a0c549fa5642d96c9bd0c4b3"}, + {file = "dependency_injector-4.36.0-cp35-cp35m-win32.whl", hash = "sha256:0b48f300dc5eb3d6415d9baaea1a783b261fca6d8cd9cf80fb2665fb27818fb3"}, + {file = "dependency_injector-4.36.0-cp35-cp35m-win_amd64.whl", hash = "sha256:a3c4172c2fc3a844fd167b66866a0eddd416ae34195243e63cedd7c71cd52911"}, + {file = "dependency_injector-4.36.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:8456c0898d0295c33d9286cc596320a23c9b6785bd87eeddaaf084933ac86ed3"}, + {file = "dependency_injector-4.36.0-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:4598e854e5c2721c2afa4da580c73e2e6ffc5322e71546ade6eb1c0e9c529b6e"}, + {file = "dependency_injector-4.36.0-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:f457748495a1291d698bd51be75866e23e0e6ac29be91f49cb5609cd808a242d"}, + {file = "dependency_injector-4.36.0-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:ff58262c852e0b6bb7bba4bb7966dbf4a513125e1f95fda6219c2f16a1df49a5"}, + {file = "dependency_injector-4.36.0-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:3464be739ebba073178603a838aa666960aac641315b8e5fbc7d97cb14ae3f7f"}, + {file = "dependency_injector-4.36.0-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:469434029eef09e3efcabaa866f8b92e825dcfe55a417a514833586838c583a9"}, + {file = "dependency_injector-4.36.0-cp36-cp36m-win32.whl", hash = "sha256:767c0e167af67f1301ca4a73777b732416f91a5e7c750ac5206cacbf3b9b913e"}, + {file = "dependency_injector-4.36.0-cp36-cp36m-win_amd64.whl", hash = "sha256:6c6057d04a691cefbff0d08bcb29c5b007c8d9c778c371f0f42ee4164119a95c"}, + {file = "dependency_injector-4.36.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a42bf52a7d3b70eb038972dfbb14bf84303eeed3e54a2f88112e52756edc26a9"}, + {file = "dependency_injector-4.36.0-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:86f3eee745889a0acac0304065071bdefa61f74697f2ac5871f1b6287a677b2b"}, + {file = "dependency_injector-4.36.0-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:20588e57dd761fe23af09087a14d0b3a732d83d9e3da988f6d8c87a94b601073"}, + {file = "dependency_injector-4.36.0-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:c119ca48cf2849e0146bdd06e628998a83d7d859ba94d3ae7c76ebc5897ea1e5"}, + {file = "dependency_injector-4.36.0-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:73541fafdb842814fb57a1986dd2c7ba725e148c0f1b2f1efa5c0625db54d422"}, + {file = "dependency_injector-4.36.0-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:4c17c2caf5587652ba084d118c81c90f363fc18bbedeb17e5014be8e995bb245"}, + {file = "dependency_injector-4.36.0-cp37-cp37m-win32.whl", hash = "sha256:1b0ccff3a2af64e21099f3e22423ffef7000d332a541452ddae6ab7316c408fe"}, + {file = "dependency_injector-4.36.0-cp37-cp37m-win_amd64.whl", hash = "sha256:350534eff52e5c1808e7b090db5c49bac542a5e2708a07930e6a125729164a64"}, + {file = "dependency_injector-4.36.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:4104375d684b557c64d8ce7350bae5d0f93c172d7b06640cf40b689f00faf74b"}, + {file = "dependency_injector-4.36.0-cp38-cp38-manylinux1_i686.whl", hash = "sha256:705c3b830f7234d07183fe7b1eed15ec2178f80fcb8698c0225882bb803758ca"}, + {file = "dependency_injector-4.36.0-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:74cbcdf0399d5a56c92f95c13dfd4ec88996de98a59e4fe18f1561e95e073804"}, + {file = "dependency_injector-4.36.0-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:06080b49672e53b99974b0e36e25e99c097506b54371cc203c3b44717881b64c"}, + {file = "dependency_injector-4.36.0-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:6eaafd241ed533a5a4a9c9551e900bfd949d966eed6cb5c408d3e27680ea8b39"}, + {file = "dependency_injector-4.36.0-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:b3d88af3377b1feb805723fb13f645f7a1a7800497f896098ac370f25390a6a0"}, + {file = "dependency_injector-4.36.0-cp38-cp38-win32.whl", hash = "sha256:c12f666cacb297154348e701cf302a9dff0d6d7b57ab54714bb2328e1de0495e"}, + {file = "dependency_injector-4.36.0-cp38-cp38-win_amd64.whl", hash = "sha256:a05781f827ad8ab5d7b89279886459ffdb0ac9692ba556fc30730f1e5b86bcd5"}, + {file = "dependency_injector-4.36.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c992d332eadd32d8a14378147cc288273c97a5b28e82aadae27a1521b18c2db4"}, + {file = "dependency_injector-4.36.0-cp39-cp39-manylinux1_i686.whl", hash = "sha256:11878ea702897b0c5f7cd4e80b2333106696625e923870efd4f8e6aee0b76fd0"}, + {file = "dependency_injector-4.36.0-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:c8781866cde6e25bae90b37a89ec4c5ea7c62f1d1d7437a780dc6a55b17db354"}, + {file = "dependency_injector-4.36.0-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:55776ffd8247895f6adacb4a49133209af007723d3fd835d65d13f3979ff8971"}, + {file = "dependency_injector-4.36.0-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:d95152477583d4b081bd4965398277eb73b736b94f97f23d65f3a5e0ed98ed5f"}, + {file = "dependency_injector-4.36.0-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:2ee2a37086cba31e43641040483f1c2b00a7dd2f63e892f64988f7a71a3fc4eb"}, + {file = "dependency_injector-4.36.0-cp39-cp39-win32.whl", hash = "sha256:745ebc717dc5196c97c7d2e0592fea4100d047aed3bcc7ee16bfde1bc012dbac"}, + {file = "dependency_injector-4.36.0-cp39-cp39-win_amd64.whl", hash = "sha256:c27c049d9f81dd4936cb3cfd2c1e29f6dec93717cc5d9825073e4b3cb704b7c9"}, + {file = "dependency_injector-4.36.0-pp27-pypy_73-macosx_10_9_x86_64.whl", hash = "sha256:a9b3f202da30c3ba455d54cf061e885d9e8c59c84f523b6fffeff520122778d9"}, + {file = "dependency_injector-4.36.0-pp27-pypy_73-manylinux1_x86_64.whl", hash = "sha256:578f1ae80448950dd7198a77797060baf5ce5a586e41dd1e199aab7b25f46de8"}, + {file = "dependency_injector-4.36.0-pp27-pypy_73-manylinux2010_x86_64.whl", hash = "sha256:888666726461bf2f4a320ff5a36ebc1422da06d9c6fddfe4ccd025d04fb12ffc"}, + {file = "dependency_injector-4.36.0-pp27-pypy_73-win32.whl", hash = "sha256:137ba5afac16506d2f9fe893f875b33dc6ab559feb1202c939a69fa3a929e7a1"}, + {file = "dependency_injector-4.36.0-pp36-pypy36_pp73-macosx_10_9_x86_64.whl", hash = "sha256:06e8584879b47d6ca9ab809c5f38c5eca5a29b0821d610462e22c3a7efe06546"}, + {file = "dependency_injector-4.36.0-pp36-pypy36_pp73-manylinux1_x86_64.whl", hash = "sha256:c4edb61749149ab34248c055f06407a1a66e26b423c57107cc167a28ad85b7ab"}, + {file = "dependency_injector-4.36.0-pp36-pypy36_pp73-manylinux2010_x86_64.whl", hash = "sha256:17cb9786e1201041c903ebcc1c6743f999d00dbc4b2bbb8b0b46b84e2425c30b"}, + {file = "dependency_injector-4.36.0-pp36-pypy36_pp73-win32.whl", hash = "sha256:c7c1a0477529e09f6da2ed86496be39543509dec1f1045564b895e65f90a58ab"}, + {file = "dependency_injector-4.36.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:38b4fec1f1992d340a8c45e79b422aca3d94c16929a2f000594c437ecef253fe"}, + {file = "dependency_injector-4.36.0-pp37-pypy37_pp73-manylinux1_x86_64.whl", hash = "sha256:0ebcd4051f5610eeeff62554124f8823ca420a90b08dc3a946e8654a13fb7569"}, + {file = "dependency_injector-4.36.0-pp37-pypy37_pp73-manylinux2010_x86_64.whl", hash = "sha256:2e148d796ac1e232ff0eac7e01c007bd2f242ccc48607fb1b4c3b37aac26a61a"}, + {file = "dependency_injector-4.36.0-pp37-pypy37_pp73-win32.whl", hash = "sha256:1ac471c4883da871e327c97ce6cb4f2465fe4ed39f5a866661b33f400763f4d6"}, ] distlib = [ {file = "distlib-0.3.2-py2.py3-none-any.whl", hash = "sha256:23e223426b28491b1ced97dc3bbe183027419dfc7982b4fa2f05d5f3ff10711c"}, @@ -1244,8 +1240,8 @@ flake8 = [ {file = "flake8-3.9.2.tar.gz", hash = "sha256:07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b6b1d78057c576b"}, ] identify = [ - {file = "identify-2.2.13-py2.py3-none-any.whl", hash = "sha256:7199679b5be13a6b40e6e19ea473e789b11b4e3b60986499b1f589ffb03c217c"}, - {file = "identify-2.2.13.tar.gz", hash = "sha256:7bc6e829392bd017236531963d2d937d66fc27cadc643ac0aba2ce9f26157c79"}, + {file = "identify-2.2.14-py2.py3-none-any.whl", hash = "sha256:113a76a6ba614d2a3dd408b3504446bcfac0370da5995aa6a17fd7c6dffde02d"}, + {file = "identify-2.2.14.tar.gz", hash = "sha256:32f465f3c48083f345ad29a9df8419a4ce0674bf4a8c3245191d65c83634bdbf"}, ] idna = [ {file = "idna-3.2-py3-none-any.whl", hash = "sha256:14475042e284991034cb48e06f6851428fb14c4dc953acd9be9a5e95c7b6dd7a"}, @@ -1340,8 +1336,8 @@ mccabe = [ {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, ] minos-microservice-common = [ - {file = "minos_microservice_common-0.1.9-py3-none-any.whl", hash = "sha256:99b25bc64f961f409dd6d2aacb52a3556196816af9cf94317049e155dd87f3df"}, - {file = "minos_microservice_common-0.1.9.tar.gz", hash = "sha256:8f946126eb9987fdf69e8d6e6855d3c0618624d0ad94acbbaae9d9abd61fd051"}, + {file = "minos_microservice_common-0.1.13-py3-none-any.whl", hash = "sha256:6d9557d793530b44d38cde881825b9373e6600344bfaf233d6c1257cd2d71d8a"}, + {file = "minos_microservice_common-0.1.13.tar.gz", hash = "sha256:0f66dd3f5d69cf0cb3f66a76ff7293157c4f60566ce9b824c9ce33cdc6f0918c"}, ] mistune = [ {file = "mistune-0.8.4-py2.py3-none-any.whl", hash = "sha256:88a1051873018da288eee8538d476dffe1262495144b33ecb586c4ab266bb8d4"}, @@ -1391,23 +1387,27 @@ nodeenv = [ {file = "nodeenv-1.6.0.tar.gz", hash = "sha256:3ef13ff90291ba2a4a7a4ff9a979b63ffdd00a464dbe04acf0ea6471517a4c2b"}, ] orjson = [ - {file = "orjson-3.6.2-cp310-cp310-manylinux_2_24_x86_64.whl", hash = "sha256:35ac55f5020b4858cb6d42840352f32480db5c53487c91119d46527de5790eba"}, - {file = "orjson-3.6.2-cp37-cp37m-macosx_10_7_x86_64.whl", hash = "sha256:1bd5952e351de0838b43be8117268594730695b85d94e620f7a8b93a78cc1ef9"}, - {file = "orjson-3.6.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:4f1a1c258991e66a35dd79b06c250851111e23f74289ce00952926463e706ea5"}, - {file = "orjson-3.6.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ee3fe3b00faeb107a86c52c62376ace95828c99c349634f6afa5c027186b8cb2"}, - {file = "orjson-3.6.2-cp37-cp37m-manylinux_2_24_x86_64.whl", hash = "sha256:3a6863b9c90ed8fcf53ec5b815cf430f21892924f340798836fa742c8500c1e7"}, - {file = "orjson-3.6.2-cp37-none-win_amd64.whl", hash = "sha256:5672ac288f483e247127124e63f216a3d0794c4089065694bdef878749225e73"}, - {file = "orjson-3.6.2-cp38-cp38-macosx_10_7_x86_64.whl", hash = "sha256:2f798eac3aa650f7a7a21e2f649c7a677307f6d189c146faf8054a4ddd157f36"}, - {file = "orjson-3.6.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:2a43449bece3937dc33d3bc8001186b81e6b931fa549842501392aad8682e92d"}, - {file = "orjson-3.6.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:695ed754094e272620a9d99feab32b7fedce4d08ce5a9a2926aa20440462eac6"}, - {file = "orjson-3.6.2-cp38-cp38-manylinux_2_24_x86_64.whl", hash = "sha256:ac8ae7fa45ced9a16d4f763f07e47d9132ce8a6ca7202b1f6ce4cac2397a6751"}, - {file = "orjson-3.6.2-cp38-none-win_amd64.whl", hash = "sha256:c82b07169db04998ba26e805456ef695dc6ff2c6a8bd10be81067d83dc2db763"}, - {file = "orjson-3.6.2-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:cb9dabb597e4cfaaff00174d91c036440c00d756d139c0e5098f59fb64f1dd38"}, - {file = "orjson-3.6.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:321895a624088b79c1d6639f747425345b08c749c445f388abd34d1580fb1e53"}, - {file = "orjson-3.6.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:da38fe4aaa4e1bfed0d8027b24a0bb905baaa5219b9dcf3480485e28940c1874"}, - {file = "orjson-3.6.2-cp39-cp39-manylinux_2_24_x86_64.whl", hash = "sha256:a055ad8e21701ef4e3baaed7f639bcd76c41029b59152c9683cdeebd17116879"}, - {file = "orjson-3.6.2-cp39-none-win_amd64.whl", hash = "sha256:ca66ff5044b6025927eab4d0eb134989614a1ed2bc0fa0e0cfbda5d4a6ccb1a6"}, - {file = "orjson-3.6.2.tar.gz", hash = "sha256:f58e8898dbc751c89a6fdd17d32e277b9d5bcf3b0f4e64e028ec962200d9d0ca"}, + {file = "orjson-3.6.3-cp310-cp310-manylinux_2_24_aarch64.whl", hash = "sha256:5f78ed46b179585272a5670537f2203dbb7b3e2f8e4db1be72839cc423e2daef"}, + {file = "orjson-3.6.3-cp310-cp310-manylinux_2_24_x86_64.whl", hash = "sha256:a99f310960e3acdda72ba1e98df8bf8c9145d90a0f72719786f43f4ea6937846"}, + {file = "orjson-3.6.3-cp37-cp37m-macosx_10_7_x86_64.whl", hash = "sha256:8a5e46418f51f03060f91d743b59aed70c8d02a5012428365cfa20b7f670e903"}, + {file = "orjson-3.6.3-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:084de43ca9b19ad58c618c9f1ff93784e0190df2d88a02ae24c3cdebe9f2e9f7"}, + {file = "orjson-3.6.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b68a601f49c0328bf16498309e56ab87c1d6c2bb0287abf70329eb958d565c62"}, + {file = "orjson-3.6.3-cp37-cp37m-manylinux_2_24_aarch64.whl", hash = "sha256:9e4a26212851ea8ff81dee7e4e0da7e1e63b5b4f4330a8b4f27e99f1ba3f758b"}, + {file = "orjson-3.6.3-cp37-cp37m-manylinux_2_24_x86_64.whl", hash = "sha256:5eb9d7f2f45e12cbc7500da4176f2d3221a73891b4be505fe79c52cbb800e872"}, + {file = "orjson-3.6.3-cp37-none-win_amd64.whl", hash = "sha256:39aa7d42c9760fba36c37adb1d9c6752696ce9443c5dcb65222dd0994b5735e1"}, + {file = "orjson-3.6.3-cp38-cp38-macosx_10_7_x86_64.whl", hash = "sha256:8d4430e0cc390c1d745aea3827fd0c6fd7aa5f0690de30a2fe25c406aa5efa20"}, + {file = "orjson-3.6.3-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:be79e0ddea7f3a47332ec9573365c0b8a8cce4357e9682050f53c1bc75c1571f"}, + {file = "orjson-3.6.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fce5ada0f8dd7c9e16c675626a29dfc5cc766e1eb67d8021b1e77d0861e4e850"}, + {file = "orjson-3.6.3-cp38-cp38-manylinux_2_24_aarch64.whl", hash = "sha256:1014a6f514b39dc414fce60568c9e7f635de97a1f1f5972ebc38f88a6160944a"}, + {file = "orjson-3.6.3-cp38-cp38-manylinux_2_24_x86_64.whl", hash = "sha256:c3beff02a339f194274ec1fcf03e2c1563e84f297b568eb3d45751722454a52e"}, + {file = "orjson-3.6.3-cp38-none-win_amd64.whl", hash = "sha256:8f105e9290f901a618a0ced87f785fce2fcf6ab753699de081d82ee05c90f038"}, + {file = "orjson-3.6.3-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:7936bef5589c9955ebee3423df51709d5f3b37ef54b830239bddb9fa5ead99f4"}, + {file = "orjson-3.6.3-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:82e3afbf404cb91774f894ed7bf52fd83bb1cc6bd72221711f4ce4e7774f0560"}, + {file = "orjson-3.6.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c702c78c33416fc8a138c5ec36eef5166ecfe8990c8f99c97551cd37c396e4d"}, + {file = "orjson-3.6.3-cp39-cp39-manylinux_2_24_aarch64.whl", hash = "sha256:4606907b9aaec9fea6159ac14f838dbd2851f18b05fb414c4b3143bff9f2bb0d"}, + {file = "orjson-3.6.3-cp39-cp39-manylinux_2_24_x86_64.whl", hash = "sha256:4ebb464b8b557a1401a03da6f41761544886db95b52280e60d25549da7427453"}, + {file = "orjson-3.6.3-cp39-none-win_amd64.whl", hash = "sha256:720a7d7ba1dcf32bbd8fb380370b1fdd06ed916caea48403edd64f2ccf7883c1"}, + {file = "orjson-3.6.3.tar.gz", hash = "sha256:353cc079cedfe990ea2d2186306f766e0d47bba63acd072e22d6df96c67be993"}, ] packaging = [ {file = "packaging-21.0-py3-none-any.whl", hash = "sha256:c86254f9220d55e31cc94d69bade760f0847da8000def4dfe1c6b872fd14ff14"}, @@ -1422,16 +1422,16 @@ pbr = [ {file = "pbr-5.6.0.tar.gz", hash = "sha256:42df03e7797b796625b1029c0400279c7c34fd7df24a7d7818a1abb5b38710dd"}, ] platformdirs = [ - {file = "platformdirs-2.2.0-py3-none-any.whl", hash = "sha256:4666d822218db6a262bdfdc9c39d21f23b4cfdb08af331a81e92751daf6c866c"}, - {file = "platformdirs-2.2.0.tar.gz", hash = "sha256:632daad3ab546bd8e6af0537d09805cec458dce201bccfe23012df73332e181e"}, + {file = "platformdirs-2.3.0-py3-none-any.whl", hash = "sha256:8003ac87717ae2c7ee1ea5a84a1a61e87f3fbd16eb5aadba194ea30a9019f648"}, + {file = "platformdirs-2.3.0.tar.gz", hash = "sha256:15b056538719b1c94bdaccb29e5f81879c7f7f0f4a153f46086d155dffcd4f0f"}, ] pluggy = [ - {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, - {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, + {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, + {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, ] pre-commit = [ - {file = "pre_commit-2.14.0-py2.py3-none-any.whl", hash = "sha256:ec3045ae62e1aa2eecfb8e86fa3025c2e3698f77394ef8d2011ce0aedd85b2d4"}, - {file = "pre_commit-2.14.0.tar.gz", hash = "sha256:2386eeb4cf6633712c7cc9ede83684d53c8cafca6b59f79c738098b51c6d206c"}, + {file = "pre_commit-2.15.0-py2.py3-none-any.whl", hash = "sha256:a4ed01000afcb484d9eb8d504272e642c4c4099bbad3a6b27e519bd6a3e928a6"}, + {file = "pre_commit-2.15.0.tar.gz", hash = "sha256:3c25add78dbdfb6a28a651780d5c311ac40dd17f160eb3954a0c59da40a505a7"}, ] psycopg2-binary = [ {file = "psycopg2-binary-2.9.1.tar.gz", hash = "sha256:b0221ca5a9837e040ebf61f48899926b5783668b7807419e4adae8175a31f773"}, @@ -1489,8 +1489,8 @@ pyparsing = [ {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, ] pytest = [ - {file = "pytest-6.2.4-py3-none-any.whl", hash = "sha256:91ef2131a9bd6be8f76f1f08eac5c5317221d6ad1e143ae03894b862e8976890"}, - {file = "pytest-6.2.4.tar.gz", hash = "sha256:50bcad0a0b9c5a72c8e4e7c9855a3ad496ca6a881a3641b4260605450772c54b"}, + {file = "pytest-6.2.5-py3-none-any.whl", hash = "sha256:7310f8d27bc79ced999e760ca304d69f6ba6c6649c0b60fb0e04a4a77cacc134"}, + {file = "pytest-6.2.5.tar.gz", hash = "sha256:131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89"}, ] pytz = [ {file = "pytz-2021.1-py2.py3-none-any.whl", hash = "sha256:eb10ce3e7736052ed3623d49975ce333bcd712c7bb19a58b9e2089d4057d0798"}, @@ -1528,39 +1528,47 @@ pyyaml = [ {file = "PyYAML-5.4.1.tar.gz", hash = "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e"}, ] regex = [ - {file = "regex-2021.8.3-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:8764a78c5464ac6bde91a8c87dd718c27c1cabb7ed2b4beaf36d3e8e390567f9"}, - {file = "regex-2021.8.3-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4551728b767f35f86b8e5ec19a363df87450c7376d7419c3cac5b9ceb4bce576"}, - {file = "regex-2021.8.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:577737ec3d4c195c4aef01b757905779a9e9aee608fa1cf0aec16b5576c893d3"}, - {file = "regex-2021.8.3-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:c856ec9b42e5af4fe2d8e75970fcc3a2c15925cbcc6e7a9bcb44583b10b95e80"}, - {file = "regex-2021.8.3-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3835de96524a7b6869a6c710b26c90e94558c31006e96ca3cf6af6751b27dca1"}, - {file = "regex-2021.8.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:cea56288eeda8b7511d507bbe7790d89ae7049daa5f51ae31a35ae3c05408531"}, - {file = "regex-2021.8.3-cp36-cp36m-win32.whl", hash = "sha256:a4eddbe2a715b2dd3849afbdeacf1cc283160b24e09baf64fa5675f51940419d"}, - {file = "regex-2021.8.3-cp36-cp36m-win_amd64.whl", hash = "sha256:57fece29f7cc55d882fe282d9de52f2f522bb85290555b49394102f3621751ee"}, - {file = "regex-2021.8.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a5c6dbe09aff091adfa8c7cfc1a0e83fdb8021ddb2c183512775a14f1435fe16"}, - {file = "regex-2021.8.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ff4a8ad9638b7ca52313d8732f37ecd5fd3c8e3aff10a8ccb93176fd5b3812f6"}, - {file = "regex-2021.8.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b63e3571b24a7959017573b6455e05b675050bbbea69408f35f3cb984ec54363"}, - {file = "regex-2021.8.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:fbc20975eee093efa2071de80df7f972b7b35e560b213aafabcec7c0bd00bd8c"}, - {file = "regex-2021.8.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:14caacd1853e40103f59571f169704367e79fb78fac3d6d09ac84d9197cadd16"}, - {file = "regex-2021.8.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:bb350eb1060591d8e89d6bac4713d41006cd4d479f5e11db334a48ff8999512f"}, - {file = "regex-2021.8.3-cp37-cp37m-win32.whl", hash = "sha256:18fdc51458abc0a974822333bd3a932d4e06ba2a3243e9a1da305668bd62ec6d"}, - {file = "regex-2021.8.3-cp37-cp37m-win_amd64.whl", hash = "sha256:026beb631097a4a3def7299aa5825e05e057de3c6d72b139c37813bfa351274b"}, - {file = "regex-2021.8.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:16d9eaa8c7e91537516c20da37db975f09ac2e7772a0694b245076c6d68f85da"}, - {file = "regex-2021.8.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3905c86cc4ab6d71635d6419a6f8d972cab7c634539bba6053c47354fd04452c"}, - {file = "regex-2021.8.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:937b20955806381e08e54bd9d71f83276d1f883264808521b70b33d98e4dec5d"}, - {file = "regex-2021.8.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:28e8af338240b6f39713a34e337c3813047896ace09d51593d6907c66c0708ba"}, - {file = "regex-2021.8.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3c09d88a07483231119f5017904db8f60ad67906efac3f1baa31b9b7f7cca281"}, - {file = "regex-2021.8.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:85f568892422a0e96235eb8ea6c5a41c8ccbf55576a2260c0160800dbd7c4f20"}, - {file = "regex-2021.8.3-cp38-cp38-win32.whl", hash = "sha256:bf6d987edd4a44dd2fa2723fca2790f9442ae4de2c8438e53fcb1befdf5d823a"}, - {file = "regex-2021.8.3-cp38-cp38-win_amd64.whl", hash = "sha256:8fe58d9f6e3d1abf690174fd75800fda9bdc23d2a287e77758dc0e8567e38ce6"}, - {file = "regex-2021.8.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7976d410e42be9ae7458c1816a416218364e06e162b82e42f7060737e711d9ce"}, - {file = "regex-2021.8.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9569da9e78f0947b249370cb8fadf1015a193c359e7e442ac9ecc585d937f08d"}, - {file = "regex-2021.8.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:459bbe342c5b2dec5c5223e7c363f291558bc27982ef39ffd6569e8c082bdc83"}, - {file = "regex-2021.8.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:4f421e3cdd3a273bace013751c345f4ebeef08f05e8c10757533ada360b51a39"}, - {file = "regex-2021.8.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ea212df6e5d3f60341aef46401d32fcfded85593af1d82b8b4a7a68cd67fdd6b"}, - {file = "regex-2021.8.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:a3b73390511edd2db2d34ff09aa0b2c08be974c71b4c0505b4a048d5dc128c2b"}, - {file = "regex-2021.8.3-cp39-cp39-win32.whl", hash = "sha256:f35567470ee6dbfb946f069ed5f5615b40edcbb5f1e6e1d3d2b114468d505fc6"}, - {file = "regex-2021.8.3-cp39-cp39-win_amd64.whl", hash = "sha256:bfa6a679410b394600eafd16336b2ce8de43e9b13f7fb9247d84ef5ad2b45e91"}, - {file = "regex-2021.8.3.tar.gz", hash = "sha256:8935937dad2c9b369c3d932b0edbc52a62647c2afb2fafc0c280f14a8bf56a6a"}, + {file = "regex-2021.8.28-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9d05ad5367c90814099000442b2125535e9d77581855b9bee8780f1b41f2b1a2"}, + {file = "regex-2021.8.28-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f3bf1bc02bc421047bfec3343729c4bbbea42605bcfd6d6bfe2c07ade8b12d2a"}, + {file = "regex-2021.8.28-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5f6a808044faae658f546dd5f525e921de9fa409de7a5570865467f03a626fc0"}, + {file = "regex-2021.8.28-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:a617593aeacc7a691cc4af4a4410031654f2909053bd8c8e7db837f179a630eb"}, + {file = "regex-2021.8.28-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:79aef6b5cd41feff359acaf98e040844613ff5298d0d19c455b3d9ae0bc8c35a"}, + {file = "regex-2021.8.28-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:0fc1f8f06977c2d4f5e3d3f0d4a08089be783973fc6b6e278bde01f0544ff308"}, + {file = "regex-2021.8.28-cp310-cp310-win32.whl", hash = "sha256:6eebf512aa90751d5ef6a7c2ac9d60113f32e86e5687326a50d7686e309f66ed"}, + {file = "regex-2021.8.28-cp310-cp310-win_amd64.whl", hash = "sha256:ac88856a8cbccfc14f1b2d0b829af354cc1743cb375e7f04251ae73b2af6adf8"}, + {file = "regex-2021.8.28-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:c206587c83e795d417ed3adc8453a791f6d36b67c81416676cad053b4104152c"}, + {file = "regex-2021.8.28-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8690ed94481f219a7a967c118abaf71ccc440f69acd583cab721b90eeedb77c"}, + {file = "regex-2021.8.28-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:328a1fad67445550b982caa2a2a850da5989fd6595e858f02d04636e7f8b0b13"}, + {file = "regex-2021.8.28-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:c7cb4c512d2d3b0870e00fbbac2f291d4b4bf2634d59a31176a87afe2777c6f0"}, + {file = "regex-2021.8.28-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:66256b6391c057305e5ae9209941ef63c33a476b73772ca967d4a2df70520ec1"}, + {file = "regex-2021.8.28-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:8e44769068d33e0ea6ccdf4b84d80c5afffe5207aa4d1881a629cf0ef3ec398f"}, + {file = "regex-2021.8.28-cp36-cp36m-win32.whl", hash = "sha256:08d74bfaa4c7731b8dac0a992c63673a2782758f7cfad34cf9c1b9184f911354"}, + {file = "regex-2021.8.28-cp36-cp36m-win_amd64.whl", hash = "sha256:abb48494d88e8a82601af905143e0de838c776c1241d92021e9256d5515b3645"}, + {file = "regex-2021.8.28-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b4c220a1fe0d2c622493b0a1fd48f8f991998fb447d3cd368033a4b86cf1127a"}, + {file = "regex-2021.8.28-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d4a332404baa6665b54e5d283b4262f41f2103c255897084ec8f5487ce7b9e8e"}, + {file = "regex-2021.8.28-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c61dcc1cf9fd165127a2853e2c31eb4fb961a4f26b394ac9fe5669c7a6592892"}, + {file = "regex-2021.8.28-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:ee329d0387b5b41a5dddbb6243a21cb7896587a651bebb957e2d2bb8b63c0791"}, + {file = "regex-2021.8.28-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f60667673ff9c249709160529ab39667d1ae9fd38634e006bec95611f632e759"}, + {file = "regex-2021.8.28-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:b844fb09bd9936ed158ff9df0ab601e2045b316b17aa8b931857365ea8586906"}, + {file = "regex-2021.8.28-cp37-cp37m-win32.whl", hash = "sha256:4cde065ab33bcaab774d84096fae266d9301d1a2f5519d7bd58fc55274afbf7a"}, + {file = "regex-2021.8.28-cp37-cp37m-win_amd64.whl", hash = "sha256:1413b5022ed6ac0d504ba425ef02549a57d0f4276de58e3ab7e82437892704fc"}, + {file = "regex-2021.8.28-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ed4b50355b066796dacdd1cf538f2ce57275d001838f9b132fab80b75e8c84dd"}, + {file = "regex-2021.8.28-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:28fc475f560d8f67cc8767b94db4c9440210f6958495aeae70fac8faec631797"}, + {file = "regex-2021.8.28-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bdc178caebd0f338d57ae445ef8e9b737ddf8fbc3ea187603f65aec5b041248f"}, + {file = "regex-2021.8.28-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:999ad08220467b6ad4bd3dd34e65329dd5d0df9b31e47106105e407954965256"}, + {file = "regex-2021.8.28-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:808ee5834e06f57978da3e003ad9d6292de69d2bf6263662a1a8ae30788e080b"}, + {file = "regex-2021.8.28-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:d5111d4c843d80202e62b4fdbb4920db1dcee4f9366d6b03294f45ed7b18b42e"}, + {file = "regex-2021.8.28-cp38-cp38-win32.whl", hash = "sha256:473858730ef6d6ff7f7d5f19452184cd0caa062a20047f6d6f3e135a4648865d"}, + {file = "regex-2021.8.28-cp38-cp38-win_amd64.whl", hash = "sha256:31a99a4796bf5aefc8351e98507b09e1b09115574f7c9dbb9cf2111f7220d2e2"}, + {file = "regex-2021.8.28-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:04f6b9749e335bb0d2f68c707f23bb1773c3fb6ecd10edf0f04df12a8920d468"}, + {file = "regex-2021.8.28-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9b006628fe43aa69259ec04ca258d88ed19b64791693df59c422b607b6ece8bb"}, + {file = "regex-2021.8.28-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:121f4b3185feaade3f85f70294aef3f777199e9b5c0c0245c774ae884b110a2d"}, + {file = "regex-2021.8.28-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:a577a21de2ef8059b58f79ff76a4da81c45a75fe0bfb09bc8b7bb4293fa18983"}, + {file = "regex-2021.8.28-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1743345e30917e8c574f273f51679c294effba6ad372db1967852f12c76759d8"}, + {file = "regex-2021.8.28-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:e1e8406b895aba6caa63d9fd1b6b1700d7e4825f78ccb1e5260551d168db38ed"}, + {file = "regex-2021.8.28-cp39-cp39-win32.whl", hash = "sha256:ed283ab3a01d8b53de3a05bfdf4473ae24e43caee7dcb5584e86f3f3e5ab4374"}, + {file = "regex-2021.8.28-cp39-cp39-win_amd64.whl", hash = "sha256:610b690b406653c84b7cb6091facb3033500ee81089867ee7d59e675f9ca2b73"}, + {file = "regex-2021.8.28.tar.gz", hash = "sha256:f585cbbeecb35f35609edccb95efd95a3e35824cd7752b586503f7e6087303f1"}, ] requests = [ {file = "requests-2.26.0-py2.py3-none-any.whl", hash = "sha256:6c1246513ecd5ecd4528a0906f910e8f0f9c6b8ec72030dc9fd154dc1a6efd24"}, @@ -1575,8 +1583,8 @@ snowballstemmer = [ {file = "snowballstemmer-2.1.0.tar.gz", hash = "sha256:e997baa4f2e9139951b6f4c631bad912dfd3c792467e2f03d7239464af90e914"}, ] sphinx = [ - {file = "Sphinx-4.1.2-py3-none-any.whl", hash = "sha256:46d52c6cee13fec44744b8c01ed692c18a640f6910a725cbb938bc36e8d64544"}, - {file = "Sphinx-4.1.2.tar.gz", hash = "sha256:3092d929cd807926d846018f2ace47ba2f3b671b309c7a89cd3306e80c826b13"}, + {file = "Sphinx-4.2.0-py3-none-any.whl", hash = "sha256:98a535c62a4fcfcc362528592f69b26f7caec587d32cd55688db580be0287ae0"}, + {file = "Sphinx-4.2.0.tar.gz", hash = "sha256:94078db9184491e15bce0a56d9186e0aec95f16ac20b12d00e06d4e36f1058a6"}, ] sphinx-autodoc-typehints = [ {file = "sphinx-autodoc-typehints-1.12.0.tar.gz", hash = "sha256:193617d9dbe0847281b1399d369e74e34cd959c82e02c7efde077fca908a9f52"}, @@ -1651,17 +1659,17 @@ typed-ast = [ {file = "typed_ast-1.4.3.tar.gz", hash = "sha256:fb1bbeac803adea29cedd70781399c99138358c26d05fcbd23c13016b7f5ec65"}, ] typing-extensions = [ - {file = "typing_extensions-3.10.0.0-py2-none-any.whl", hash = "sha256:0ac0f89795dd19de6b97debb0c6af1c70987fd80a2d62d1958f7e56fcc31b497"}, - {file = "typing_extensions-3.10.0.0-py3-none-any.whl", hash = "sha256:779383f6086d90c99ae41cf0ff39aac8a7937a9283ce0a414e5dd782f4c94a84"}, - {file = "typing_extensions-3.10.0.0.tar.gz", hash = "sha256:50b6f157849174217d0656f99dc82fe932884fb250826c18350e159ec6cdf342"}, + {file = "typing_extensions-3.10.0.2-py2-none-any.whl", hash = "sha256:d8226d10bc02a29bcc81df19a26e56a9647f8b0a6d4a83924139f4a8b01f17b7"}, + {file = "typing_extensions-3.10.0.2-py3-none-any.whl", hash = "sha256:f1d25edafde516b146ecd0613dabcc61409817af4766fbbcfb8d1ad4ec441a34"}, + {file = "typing_extensions-3.10.0.2.tar.gz", hash = "sha256:49f75d16ff11f1cd258e1b988ccff82a3ca5570217d7ad8c5f48205dd99a677e"}, ] urllib3 = [ {file = "urllib3-1.26.6-py2.py3-none-any.whl", hash = "sha256:39fb8672126159acb139a7718dd10806104dec1e2f0f6c88aab05d17df10c8d4"}, {file = "urllib3-1.26.6.tar.gz", hash = "sha256:f57b4c16c62fa2760b7e3d97c35b255512fb6b59a259730f36ba32ce9f8e342f"}, ] virtualenv = [ - {file = "virtualenv-20.7.2-py2.py3-none-any.whl", hash = "sha256:e4670891b3a03eb071748c569a87cceaefbf643c5bac46d996c5a45c34aa0f06"}, - {file = "virtualenv-20.7.2.tar.gz", hash = "sha256:9ef4e8ee4710826e98ff3075c9a4739e2cb1040de6a2a8d35db0055840dc96a0"}, + {file = "virtualenv-20.8.0-py2.py3-none-any.whl", hash = "sha256:a4b987ec31c3c9996cf1bc865332f967fe4a0512c41b39652d6224f696e69da5"}, + {file = "virtualenv-20.8.0.tar.gz", hash = "sha256:4da4ac43888e97de9cf4fdd870f48ed864bbfd133d2c46cbdec941fed4a25aef"}, ] yarl = [ {file = "yarl-1.6.3-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:0355a701b3998dcd832d0dc47cc5dedf3874f966ac7f870e0f3a6788d802d434"}, diff --git a/pyproject.toml b/pyproject.toml index 28f944ad..72191161 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "minos_microservice_networks" -version = "0.0.15" +version = "0.0.16" description = "Python Package with the common network classes and utilities used in Minos Microservice." readme = "README.md" repository = "https://github.com/clariteia/minos_microservice_network" @@ -36,7 +36,7 @@ aiomisc = "^14.0.3" aiopg = "^1.2.1" aiohttp = "^3.7.4" dependency-injector = "^4.32.2" -minos-microservice-common = "^0.1.8" +minos-microservice-common = "^0.1.13" [tool.poetry.dev-dependencies] black = "^19.10b" diff --git a/setup.cfg b/setup.cfg index 182145c9..0583cda9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,7 +33,7 @@ filename = ./examples/**/*.py max-line-length = 120 per-file-ignores = - ./**/__init__.py:F401 + ./**/__init__.py:F401,W391 [isort] known_first_party=minos diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index 1099d5d0..6a38c18c 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -20,7 +20,8 @@ services: depends_on: - zookeeper environment: - KAFKA_ADVERTISED_HOST_NAME: localhost + KAFKA_ADVERTISED_HOST_NAME: kafka + KAFKA_ADVERTISED_PORT: 9092 KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 KAFKA_DELETE_TOPIC_ENABLE: "true" volumes: diff --git a/tests/test_config.yml b/tests/test_config.yml index 4fa2bb8e..7bf89312 100644 --- a/tests/test_config.yml +++ b/tests/test_config.yml @@ -1,5 +1,6 @@ service: name: Order + aggregate: tests.utils.Order rest: host: localhost port: 8080 @@ -35,7 +36,7 @@ queries: saga: storage: path: "./order.lmdb" - items: [] # FIXME: remove parameter. discovery: + client: minos.networks.MinosDiscoveryClient host: discovery-service port: 8080 diff --git a/tests/test_networks/__init__.py b/tests/test_networks/__init__.py index fed3716d..8b137891 100644 --- a/tests/test_networks/__init__.py +++ b/tests/test_networks/__init__.py @@ -1,7 +1 @@ -""" -Copyright (C) 2021 Clariteia SL -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" diff --git a/tests/test_networks/test_brokers/__init__.py b/tests/test_networks/test_brokers/__init__.py index fed3716d..8b137891 100644 --- a/tests/test_networks/test_brokers/__init__.py +++ b/tests/test_networks/test_brokers/__init__.py @@ -1,7 +1 @@ -""" -Copyright (C) 2021 Clariteia SL -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" diff --git a/tests/test_networks/test_brokers/test_abc.py b/tests/test_networks/test_brokers/test_abc.py index 40916ad7..8edaacc8 100644 --- a/tests/test_networks/test_brokers/test_abc.py +++ b/tests/test_networks/test_brokers/test_abc.py @@ -1,15 +1,4 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" - import unittest -from typing import ( - NoReturn, -) from unittest.mock import ( AsyncMock, call, @@ -38,7 +27,7 @@ class _FakeBroker(Broker): ACTION = "fake" - async def send(self, items: list[Model], **kwargs) -> NoReturn: + async def send(self, items: list[Model], **kwargs) -> None: """For testing purposes""" @@ -75,11 +64,7 @@ def setUp(self) -> None: self.broker = _FakeBroker(**self.broker_queue_db) async def test_enqueue(self): - query = SQL( - "INSERT INTO producer_queue (topic, model, retry, action, creation_date, update_date) " - "VALUES (%s, %s, %s, %s, NOW(), NOW()) " - "RETURNING id" - ) + query = SQL("INSERT INTO producer_queue (topic, data, action) VALUES (%s, %s, %s) RETURNING id") mock = AsyncMock(return_value=(56,)) @@ -91,7 +76,7 @@ async def test_enqueue(self): self.assertEqual(56, identifier) self.assertEqual(1, mock.call_count) - self.assertEqual(call(query, ("test_topic", b"test", 0, "fake")), mock.call_args) + self.assertEqual(call(query, ("test_topic", b"test", "fake")), mock.call_args) if __name__ == "__main__": diff --git a/tests/test_networks/test_brokers/test_command_replies.py b/tests/test_networks/test_brokers/test_command_replies.py index 30bd0b46..f281bccc 100644 --- a/tests/test_networks/test_brokers/test_command_replies.py +++ b/tests/test_networks/test_brokers/test_command_replies.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" import unittest from unittest.mock import ( AsyncMock, diff --git a/tests/test_networks/test_brokers/test_commands.py b/tests/test_networks/test_brokers/test_commands.py index b1ed0960..18c9ddd1 100644 --- a/tests/test_networks/test_brokers/test_commands.py +++ b/tests/test_networks/test_brokers/test_commands.py @@ -1,5 +1,3 @@ -"""tests.test_networks.test_brokers.test_commands module.""" - import unittest from unittest.mock import ( AsyncMock, diff --git a/tests/test_networks/test_brokers/test_events.py b/tests/test_networks/test_brokers/test_events.py index 886f4b47..c0b5cfee 100644 --- a/tests/test_networks/test_brokers/test_events.py +++ b/tests/test_networks/test_brokers/test_events.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" import unittest from unittest.mock import ( AsyncMock, diff --git a/tests/test_networks/test_brokers/test_producers.py b/tests/test_networks/test_brokers/test_producers.py index f2e2b20e..9f92f8ac 100644 --- a/tests/test_networks/test_brokers/test_producers.py +++ b/tests/test_networks/test_brokers/test_producers.py @@ -1,5 +1,3 @@ -"""tests.test_networks.test_broker.test_producers module.""" - import asyncio import unittest from asyncio import ( @@ -53,7 +51,7 @@ async def test_dispatch_one_internal_true(self): self.consumer.enqueue = mock async with self.producer: - ok = await self.producer.dispatch_one((0, "GetOrder", bytes(), 0, "command")) + ok = await self.producer.dispatch_one((0, "GetOrder", bytes(), "command")) self.assertTrue(ok) self.assertEqual(1, mock.call_count) @@ -66,7 +64,7 @@ async def test_dispatch_one_internal_false(self): self.producer.publish = publish_mock async with self.producer: - ok = await self.producer.dispatch_one((0, "GetOrder", bytes(), 0, "command")) + ok = await self.producer.dispatch_one((0, "GetOrder", bytes(), "command")) self.assertTrue(ok) self.assertEqual(1, publish_mock.call_count) @@ -77,7 +75,7 @@ async def test_dispatch_one_external_true(self): self.producer.publish = mock async with self.producer: - ok = await self.producer.dispatch_one((0, "GetProduct", bytes(), 0, "command")) + ok = await self.producer.dispatch_one((0, "GetProduct", bytes(), "command")) self.assertTrue(ok) self.assertEqual(1, mock.call_count) @@ -87,7 +85,7 @@ async def test_dispatch_one_external_true_event(self): mock = AsyncMock() self.producer.publish = mock async with self.producer: - ok = await self.producer.dispatch_one((0, "TicketAdded", bytes(), 0, "event")) + ok = await self.producer.dispatch_one((0, "TicketAdded", bytes(), "event")) self.assertTrue(ok) self.assertEqual(1, mock.call_count) self.assertEqual(call("TicketAdded", bytes()), mock.call_args) @@ -95,7 +93,7 @@ async def test_dispatch_one_external_true_event(self): async def test_dispatch_one_external_false(self): self.producer.publish = AsyncMock(return_value=False) async with self.producer: - ok = await self.producer.dispatch_one((0, "GetOrder", bytes(), 0, "event")) + ok = await self.producer.dispatch_one((0, "GetOrder", bytes(), "event")) self.assertFalse(ok) async def test_publish_true(self): diff --git a/tests/test_networks/test_brokers/test_services.py b/tests/test_networks/test_brokers/test_services.py index a84b0a7f..9cc622cc 100644 --- a/tests/test_networks/test_brokers/test_services.py +++ b/tests/test_networks/test_brokers/test_services.py @@ -1,5 +1,3 @@ -"""tests.test_networks.test_brokers.test_services module.""" - import unittest from unittest.mock import ( AsyncMock, diff --git a/tests/test_networks/test_decorators/__init__.py b/tests/test_networks/test_decorators/__init__.py index fed3716d..8b137891 100644 --- a/tests/test_networks/test_decorators/__init__.py +++ b/tests/test_networks/test_decorators/__init__.py @@ -1,7 +1 @@ -""" -Copyright (C) 2021 Clariteia SL -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" diff --git a/tests/test_networks/test_decorators/test_analyzers.py b/tests/test_networks/test_decorators/test_analyzers.py index 1668d71b..adb57b4e 100644 --- a/tests/test_networks/test_decorators/test_analyzers.py +++ b/tests/test_networks/test_decorators/test_analyzers.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" import unittest from minos.common import ( diff --git a/tests/test_networks/test_decorators/test_api.py b/tests/test_networks/test_decorators/test_api.py index 1b729e54..4b055068 100644 --- a/tests/test_networks/test_decorators/test_api.py +++ b/tests/test_networks/test_decorators/test_api.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" import unittest from minos.networks import ( diff --git a/tests/test_networks/test_decorators/test_builders.py b/tests/test_networks/test_decorators/test_builders.py index c82796e5..b18a3588 100644 --- a/tests/test_networks/test_decorators/test_builders.py +++ b/tests/test_networks/test_decorators/test_builders.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" import unittest from minos.common import ( diff --git a/tests/test_networks/test_decorators/test_definitions/__init__.py b/tests/test_networks/test_decorators/test_definitions/__init__.py index fed3716d..8b137891 100644 --- a/tests/test_networks/test_decorators/test_definitions/__init__.py +++ b/tests/test_networks/test_decorators/test_definitions/__init__.py @@ -1,7 +1 @@ -""" -Copyright (C) 2021 Clariteia SL -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" diff --git a/tests/test_networks/test_decorators/test_definitions/test_abc.py b/tests/test_networks/test_decorators/test_definitions/test_abc.py index 84c7677b..cb8f5059 100644 --- a/tests/test_networks/test_decorators/test_definitions/test_abc.py +++ b/tests/test_networks/test_decorators/test_definitions/test_abc.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" import unittest from typing import ( Iterable, diff --git a/tests/test_networks/test_discovery/test_clients/test_kong.py b/tests/test_networks/test_discovery/test_clients/test_kong.py new file mode 100644 index 00000000..24322b81 --- /dev/null +++ b/tests/test_networks/test_discovery/test_clients/test_kong.py @@ -0,0 +1,100 @@ +import unittest +from collections import ( + namedtuple, +) +from unittest.mock import ( + call, + patch, +) + +from minos.networks import ( + KongDiscoveryClient, + MinosDiscoveryConnectorException, +) + +_Response = namedtuple("Response", ["ok"]) + + +async def _fn(*args, **kwargs): + return _Response(True) + + +async def _fn_failure(*args, **kwargs): + return _Response(False) + + +async def _fn_raises(*args, **kwargs): + raise ValueError + + +class TestKong(unittest.IsolatedAsyncioTestCase): + def setUp(self) -> None: + self.client = KongDiscoveryClient("123.456.123.1", 1234) + + def test_route(self): + # noinspection HttpUrlsUsage + self.assertEqual("http://123.456.123.1:1234", self.client.route) + + @patch("aiohttp.ClientSession.post") + async def test_subscribe(self, mock): + mock.return_value.__aenter__ = _fn + + await self.client.subscribe( + "56.56.56.56", 56, "test", [{"url": "/foo", "method": "POST"}, {"url": "/bar", "method": "GET"}] + ) + + self.assertEqual(2, mock.call_count) + + # noinspection HttpUrlsUsage + expected_service = call( + "http://123.456.123.1:1234/services", json={"name": "test", "url": "http://56.56.56.56:56"}, + ) + self.assertEqual(expected_service, mock.call_args_list[0]) + + # noinspection HttpUrlsUsage + expected_paths = call("http://123.456.123.1:1234/test/routes", json={"paths": ["/foo", "/bar"]},) + self.assertEqual(expected_paths, mock.call_args_list[1]) + + @patch("aiohttp.ClientSession.post") + async def test_subscribe_raises_failure(self, mock): + mock.return_value.__aenter__ = _fn_failure + + with self.assertRaises(MinosDiscoveryConnectorException): + await self.client.subscribe("56.56.56.56", 56, "test", [{"url": "/foo", "method": "POST"}], retry_delay=0) + self.assertEqual(3, mock.call_count) + + @patch("aiohttp.ClientSession.post") + async def test_subscribe_raises_exception(self, mock): + mock.return_value.__aenter__ = _fn_raises + + with self.assertRaises(MinosDiscoveryConnectorException): + await self.client.subscribe("56.56.56.56", 56, "test", [{"url": "/foo", "method": "POST"}], retry_delay=0) + self.assertEqual(3, mock.call_count) + + @patch("aiohttp.ClientSession.delete") + async def test_unsubscribe(self, mock): + mock.return_value.__aenter__ = _fn + await self.client.unsubscribe("test") + self.assertEqual(1, mock.call_count) + # noinspection HttpUrlsUsage + self.assertEqual(call("http://123.456.123.1:1234/services/test"), mock.call_args) + + @patch("aiohttp.ClientSession.delete") + async def test_unsubscribe_raises_failure(self, mock): + mock.return_value.__aenter__ = _fn_failure + + with self.assertRaises(MinosDiscoveryConnectorException): + await self.client.unsubscribe("test", retry_delay=0) + self.assertEqual(3, mock.call_count) + + @patch("aiohttp.ClientSession.delete") + async def test_unsubscribe_raises_exception(self, mock): + mock.return_value.__aenter__ = _fn_raises + + with self.assertRaises(MinosDiscoveryConnectorException): + await self.client.unsubscribe("test", retry_delay=0) + self.assertEqual(3, mock.call_count) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/test_networks/test_discovery/test_clients.py b/tests/test_networks/test_discovery/test_clients/test_minos_discovery.py similarity index 98% rename from tests/test_networks/test_discovery/test_clients.py rename to tests/test_networks/test_discovery/test_clients/test_minos_discovery.py index 96e45d10..314958d3 100644 --- a/tests/test_networks/test_discovery/test_clients.py +++ b/tests/test_networks/test_discovery/test_clients/test_minos_discovery.py @@ -1,5 +1,3 @@ -"""tests.test_networks.test_discovery.test_clients module.""" - import unittest from collections import ( namedtuple, diff --git a/tests/test_networks/test_discovery/test_connectors.py b/tests/test_networks/test_discovery/test_connectors.py index 79d3a545..db7b5b7d 100644 --- a/tests/test_networks/test_discovery/test_connectors.py +++ b/tests/test_networks/test_discovery/test_connectors.py @@ -1,5 +1,3 @@ -"""tests.test_networks.test_discovery.test_connectors module.""" - import unittest from unittest.mock import ( AsyncMock, @@ -12,6 +10,7 @@ from minos.networks import ( DiscoveryConnector, MinosDiscoveryClient, + MinosInvalidDiscoveryClient, get_host_ip, ) from tests.utils import ( @@ -27,6 +26,16 @@ def setUp(self) -> None: self.ip = get_host_ip() self.discovery = DiscoveryConnector.from_config(config=self.config) + def test_config_minos_client_does_not_exist(self): + config = MinosConfig(self.CONFIG_FILE_PATH, minos_discovery_client="wrong-client") + with self.assertRaises(MinosInvalidDiscoveryClient): + DiscoveryConnector.from_config(config=config) + + def test_config_minos_client_not_supported(self): + config = MinosConfig(self.CONFIG_FILE_PATH, minos_discovery_client="minos.common.Aggregate") + with self.assertRaises(MinosInvalidDiscoveryClient): + DiscoveryConnector.from_config(config) + def test_client(self): self.assertIsInstance(self.discovery.client, MinosDiscoveryClient) diff --git a/tests/test_networks/test_exceptions.py b/tests/test_networks/test_exceptions.py index 580d5881..0cb86fe9 100644 --- a/tests/test_networks/test_exceptions.py +++ b/tests/test_networks/test_exceptions.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" import unittest from minos.common import ( diff --git a/tests/test_networks/test_handlers/test_abc/__init__.py b/tests/test_networks/test_handlers/test_abc/__init__.py index fed3716d..8b137891 100644 --- a/tests/test_networks/test_handlers/test_abc/__init__.py +++ b/tests/test_networks/test_handlers/test_abc/__init__.py @@ -1,7 +1 @@ -""" -Copyright (C) 2021 Clariteia SL -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" diff --git a/tests/test_networks/test_handlers/test_abc/test_handlers.py b/tests/test_networks/test_handlers/test_abc/test_handlers.py index 82f2017f..2f916f0d 100644 --- a/tests/test_networks/test_handlers/test_abc/test_handlers.py +++ b/tests/test_networks/test_handlers/test_abc/test_handlers.py @@ -1,5 +1,3 @@ -"""tests.tests_networks.test_handlers.test_abc.test_handlers module.""" - import unittest from asyncio import ( TimeoutError, @@ -10,8 +8,8 @@ from collections import ( namedtuple, ) -from typing import ( - NoReturn, +from inspect import ( + isawaitable, ) from unittest.mock import ( AsyncMock, @@ -52,13 +50,15 @@ def __init__(self, *args, **kwargs): self.call_count = 0 self.call_args = None - async def dispatch_one(self, entry: HandlerEntry) -> NoReturn: + async def dispatch_one(self, entry: HandlerEntry) -> None: """For testing purposes.""" self.call_count += 1 self.call_args = (entry,) if entry.topic == "DeleteOrder": raise ValueError() - entry.callback(entry.data) + result = entry.callback(entry.data) + if isawaitable(result): + await result class TestHandler(PostgresAsyncTestCase): @@ -192,9 +192,7 @@ async def _insert_one(self, instance): async with aiopg.connect(**self.broker_queue_db) as connect: async with connect.cursor() as cur: await cur.execute( - "INSERT INTO consumer_queue (topic, partition_id, binary_data, creation_date) " - "VALUES (%s, %s, %s, NOW()) " - "RETURNING id;", + "INSERT INTO consumer_queue (topic, partition, data) VALUES (%s, %s, %s) RETURNING id;", (instance.topic, 0, instance.avro_bytes), ) return (await cur.fetchone())[0] diff --git a/tests/test_networks/test_handlers/test_abc/test_setups.py b/tests/test_networks/test_handlers/test_abc/test_setups.py index fd29491c..e4ed3006 100644 --- a/tests/test_networks/test_handlers/test_abc/test_setups.py +++ b/tests/test_networks/test_handlers/test_abc/test_setups.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" import unittest import aiopg diff --git a/tests/test_networks/test_handlers/test_command_replies/__init__.py b/tests/test_networks/test_handlers/test_command_replies/__init__.py index fed3716d..8b137891 100644 --- a/tests/test_networks/test_handlers/test_command_replies/__init__.py +++ b/tests/test_networks/test_handlers/test_command_replies/__init__.py @@ -1,7 +1 @@ -""" -Copyright (C) 2021 Clariteia SL -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" diff --git a/tests/test_networks/test_handlers/test_command_replies/test_handlers.py b/tests/test_networks/test_handlers/test_command_replies/test_handlers.py index f548be76..d5c9d02a 100644 --- a/tests/test_networks/test_handlers/test_command_replies/test_handlers.py +++ b/tests/test_networks/test_handlers/test_command_replies/test_handlers.py @@ -1,5 +1,3 @@ -"""tests.test_networks.test_handlers.test_command_replies.test_handlers module.""" - import unittest from unittest.mock import ( AsyncMock, diff --git a/tests/test_networks/test_handlers/test_command_replies/test_services.py b/tests/test_networks/test_handlers/test_command_replies/test_services.py index b2f74ebf..a9fb60d0 100644 --- a/tests/test_networks/test_handlers/test_command_replies/test_services.py +++ b/tests/test_networks/test_handlers/test_command_replies/test_services.py @@ -1,5 +1,3 @@ -"""tests.test_networks.test_handlers.test_command_replies.test_services module.""" - import unittest from unittest.mock import ( AsyncMock, diff --git a/tests/test_networks/test_handlers/test_commands/__init__.py b/tests/test_networks/test_handlers/test_commands/__init__.py index fed3716d..8b137891 100644 --- a/tests/test_networks/test_handlers/test_commands/__init__.py +++ b/tests/test_networks/test_handlers/test_commands/__init__.py @@ -1,7 +1 @@ -""" -Copyright (C) 2021 Clariteia SL -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" diff --git a/tests/test_networks/test_handlers/test_commands/test_services.py b/tests/test_networks/test_handlers/test_commands/test_services.py index 0b9daf85..17578005 100644 --- a/tests/test_networks/test_handlers/test_commands/test_services.py +++ b/tests/test_networks/test_handlers/test_commands/test_services.py @@ -1,5 +1,3 @@ -"""tests.test_networks.test_handlers.test_commands.test_services module.""" - import unittest from unittest.mock import ( AsyncMock, diff --git a/tests/test_networks/test_handlers/test_consumers.py b/tests/test_networks/test_handlers/test_consumers.py index d2d70363..a31ca353 100644 --- a/tests/test_networks/test_handlers/test_consumers.py +++ b/tests/test_networks/test_handlers/test_consumers.py @@ -1,5 +1,3 @@ -"""tests.test_networks.tests_handlers.test_consumers module.""" - import unittest from unittest.mock import ( MagicMock, @@ -126,11 +124,7 @@ async def test_handle_single_message(self): self.assertEqual(call("AddOrder", 0, b"test"), mock.call_args) async def test_enqueue(self): - query = SQL( - "INSERT INTO consumer_queue (topic, partition_id, binary_data, creation_date) " - "VALUES (%s, %s, %s, NOW()) " - "RETURNING id" - ) + query = SQL("INSERT INTO consumer_queue (topic, partition, data) VALUES (%s, %s, %s) RETURNING id") mock = MagicMock(side_effect=self.consumer.submit_query_and_fetchone) diff --git a/tests/test_networks/test_handlers/test_dynamic/__init__.py b/tests/test_networks/test_handlers/test_dynamic/__init__.py index fed3716d..8b137891 100644 --- a/tests/test_networks/test_handlers/test_dynamic/__init__.py +++ b/tests/test_networks/test_handlers/test_dynamic/__init__.py @@ -1,7 +1 @@ -""" -Copyright (C) 2021 Clariteia SL -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" diff --git a/tests/test_networks/test_handlers/test_dynamic/test_handlers.py b/tests/test_networks/test_handlers/test_dynamic/test_handlers.py index 962ba724..b0991550 100644 --- a/tests/test_networks/test_handlers/test_dynamic/test_handlers.py +++ b/tests/test_networks/test_handlers/test_dynamic/test_handlers.py @@ -1,5 +1,3 @@ -"""tests.test_networks.test_handlers.test_dynamic.test_handlers module.""" - import unittest from asyncio import ( gather, @@ -88,9 +86,7 @@ async def _insert_one(self, instance): async with aiopg.connect(**self.broker_queue_db) as connect: async with connect.cursor() as cur: await cur.execute( - "INSERT INTO consumer_queue (topic, partition_id, binary_data, creation_date) " - "VALUES (%s, %s, %s, NOW()) " - "RETURNING id;", + "INSERT INTO consumer_queue (topic, partition, data) VALUES (%s, %s, %s) RETURNING id;", (instance.topic, 0, instance.value), ) return (await cur.fetchone())[0] @@ -99,7 +95,7 @@ def _assert_equal_entries(self, expected, observed): self.assertEqual(expected.id, observed.id) self.assertEqual(expected.topic, observed.topic) self.assertEqual(expected.callback, observed.callback) - self.assertEqual(expected.partition_id, observed.partition_id) + self.assertEqual(expected.partition, observed.partition) self.assertEqual(expected.data, observed.data) self.assertEqual(expected.retry, observed.retry) self.assertAlmostEqual(expected.created_at, observed.created_at, delta=timedelta(seconds=2)) diff --git a/tests/test_networks/test_handlers/test_dynamic/test_pools.py b/tests/test_networks/test_handlers/test_dynamic/test_pools.py index 33da84e3..9fc62233 100644 --- a/tests/test_networks/test_handlers/test_dynamic/test_pools.py +++ b/tests/test_networks/test_handlers/test_dynamic/test_pools.py @@ -1,5 +1,3 @@ -"""tests.test_networks.test_handlers.test_dynamic.test_pools module.""" - import unittest from kafka import ( diff --git a/tests/test_networks/test_handlers/test_events/__init__.py b/tests/test_networks/test_handlers/test_events/__init__.py index fed3716d..8b137891 100644 --- a/tests/test_networks/test_handlers/test_events/__init__.py +++ b/tests/test_networks/test_handlers/test_events/__init__.py @@ -1,7 +1 @@ -""" -Copyright (C) 2021 Clariteia SL -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" diff --git a/tests/test_networks/test_handlers/test_events/test_handlers.py b/tests/test_networks/test_handlers/test_events/test_handlers.py index a8fd4862..c685ecb0 100644 --- a/tests/test_networks/test_handlers/test_events/test_handlers.py +++ b/tests/test_networks/test_handlers/test_events/test_handlers.py @@ -21,6 +21,7 @@ AggregateDiff, Event, FieldDiffContainer, + current_datetime, ) from minos.common.testing import ( PostgresAsyncTestCase, @@ -129,8 +130,14 @@ async def _fn2(request): for i in range(1, 6): events.extend( [ - Event("TicketAdded", AggregateDiff(uuid1, "Foo", i, Action.CREATE, FieldDiffContainer.empty())), - Event("TicketAdded", AggregateDiff(uuid2, "Foo", i, Action.CREATE, FieldDiffContainer.empty())), + Event( + "TicketAdded", + AggregateDiff(uuid1, "Foo", i, Action.CREATE, current_datetime(), FieldDiffContainer.empty()), + ), + Event( + "TicketAdded", + AggregateDiff(uuid2, "Foo", i, Action.CREATE, current_datetime(), FieldDiffContainer.empty()), + ), ] ) shuffle(events) @@ -148,9 +155,7 @@ async def _insert_one(self, instance): async with aiopg.connect(**self.broker_queue_db) as connect: async with connect.cursor() as cur: await cur.execute( - "INSERT INTO consumer_queue (topic, partition_id, binary_data, creation_date) " - "VALUES (%s, %s, %s, NOW()) " - "RETURNING id;", + "INSERT INTO consumer_queue (topic, partition, data) VALUES (%s, %s, %s) RETURNING id;", (instance.topic, 0, instance.avro_bytes), ) return (await cur.fetchone())[0] diff --git a/tests/test_networks/test_handlers/test_events/test_services.py b/tests/test_networks/test_handlers/test_events/test_services.py index 26ca3575..6c3c1ff2 100644 --- a/tests/test_networks/test_handlers/test_events/test_services.py +++ b/tests/test_networks/test_handlers/test_events/test_services.py @@ -1,5 +1,3 @@ -"""tests.test_networks.test_handlers.test_events.test_services module.""" - import unittest from unittest.mock import ( AsyncMock, diff --git a/tests/test_networks/test_handlers/test_messages.py b/tests/test_networks/test_handlers/test_messages.py index 056b5fcb..c7de83fe 100644 --- a/tests/test_networks/test_handlers/test_messages.py +++ b/tests/test_networks/test_handlers/test_messages.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" import unittest from uuid import ( uuid4, diff --git a/tests/test_networks/test_handlers/test_services.py b/tests/test_networks/test_handlers/test_services.py index 2c307d75..4e17a67f 100644 --- a/tests/test_networks/test_handlers/test_services.py +++ b/tests/test_networks/test_handlers/test_services.py @@ -1,5 +1,3 @@ -"""tests.test_networks.test_handlers.test_dynamic.test_services module.""" - import unittest from minos.common.testing import ( diff --git a/tests/test_networks/test_messages.py b/tests/test_networks/test_messages.py index e9ae899b..fba66c0f 100644 --- a/tests/test_networks/test_messages.py +++ b/tests/test_networks/test_messages.py @@ -1,11 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" - import unittest from abc import ( ABC, diff --git a/tests/test_networks/test_rest/test_messages.py b/tests/test_networks/test_rest/test_messages.py index 5be5b4d5..70a99082 100644 --- a/tests/test_networks/test_rest/test_messages.py +++ b/tests/test_networks/test_rest/test_messages.py @@ -1,10 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" import unittest import uuid from json import ( diff --git a/tests/test_networks/test_snapshots.py b/tests/test_networks/test_snapshots.py index 245d497a..e01f508c 100644 --- a/tests/test_networks/test_snapshots.py +++ b/tests/test_networks/test_snapshots.py @@ -1,11 +1,3 @@ -""" -Copyright (C) 2021 Clariteia SL - -This file is part of minos framework. - -Minos framework can not be copied and/or distributed without the express permission of Clariteia SL. -""" - import unittest from unittest.mock import ( MagicMock, @@ -15,10 +7,6 @@ PeriodicService, ) -from minos.common import ( - MinosConfigException, - PostgreSqlSnapshotBuilder, -) from minos.common.testing import ( PostgresAsyncTestCase, ) @@ -27,7 +15,7 @@ ) from tests.utils import ( BASE_PATH, - FakeRepository, + FakeSnapshot, ) @@ -36,38 +24,33 @@ class TestSnapshotService(PostgresAsyncTestCase): def setUp(self) -> None: super().setUp() - self.repository = FakeRepository() + self.snapshot = FakeSnapshot() def test_is_instance(self): - service = SnapshotService(interval=0.1, loop=None, config=self.config, repository=self.repository) + service = SnapshotService(self.snapshot, interval=0.1, config=self.config) self.assertIsInstance(service, PeriodicService) - def test_dispatcher_config_raises(self): - service = SnapshotService(interval=0.1) - with self.assertRaises(MinosConfigException): - # noinspection PyStatementEffect - service.dispatcher - def test_dispatcher_config(self): - service = SnapshotService(interval=0.1, loop=None, config=self.config, repository=self.repository) - dispatcher = service.dispatcher - self.assertIsInstance(dispatcher, PostgreSqlSnapshotBuilder) - self.assertFalse(dispatcher.already_setup) + service = SnapshotService(self.snapshot, interval=0.1, config=self.config) + snapshot = service.snapshot + self.assertEqual(snapshot, self.snapshot) + self.assertFalse(snapshot.already_setup) async def test_start(self): - service = SnapshotService(interval=0.1, loop=None, config=self.config, repository=self.repository) - service.dispatcher.setup = MagicMock(side_effect=service.dispatcher.setup) + service = SnapshotService(self.snapshot, interval=0.1, loop=None, config=self.config) + service.snapshot.setup = MagicMock(side_effect=service.snapshot.setup) await service.start() - self.assertTrue(1, service.dispatcher.setup.call_count) + self.assertTrue(1, service.snapshot.setup.call_count) await service.stop() async def test_callback(self): - service = SnapshotService(interval=0.1, loop=None, config=self.config, repository=self.repository) - await service.dispatcher.setup() - service.dispatcher.dispatch = MagicMock(side_effect=service.dispatcher.dispatch) + service = SnapshotService(self.snapshot, interval=0.1, config=self.config) + await service.snapshot.setup() + mock = MagicMock(side_effect=service.snapshot.synchronize) + service.snapshot.synchronize = mock await service.callback() - self.assertEqual(1, service.dispatcher.dispatch.call_count) - await service.dispatcher.destroy() + self.assertEqual(1, mock.call_count) + await service.snapshot.destroy() if __name__ == "__main__": diff --git a/tests/test_networks/test_utils.py b/tests/test_networks/test_utils.py index 5e759b6c..d233f470 100644 --- a/tests/test_networks/test_utils.py +++ b/tests/test_networks/test_utils.py @@ -1,5 +1,3 @@ -"""tests.test_networks.test_utils module.""" - import unittest from asyncio import ( Queue, diff --git a/tests/utils.py b/tests/utils.py index 3fa21ca7..e9d1c3fb 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,18 +1,11 @@ -"""tests.utils module.""" - -import uuid from collections import ( namedtuple, ) -from datetime import ( - datetime, -) from pathlib import ( Path, ) from typing import ( AsyncIterator, - NoReturn, Optional, ) from uuid import ( @@ -26,16 +19,20 @@ from minos.common import ( Action, + Aggregate, AggregateDiff, CommandReply, CommandStatus, + Condition, FieldDiff, FieldDiffContainer, MinosBroker, MinosModel, MinosRepository, MinosSagaManager, + MinosSnapshot, RepositoryEntry, + current_datetime, ) from minos.networks import ( EnrouteDecorator, @@ -47,7 +44,9 @@ BASE_PATH = Path(__file__).parent -FAKE_AGGREGATE_DIFF = AggregateDiff(uuid4(), "Foo", 3, Action.CREATE, FieldDiffContainer({FieldDiff("doors", int, 5)})) +FAKE_AGGREGATE_DIFF = AggregateDiff( + uuid4(), "Foo", 3, Action.CREATE, current_datetime(), FieldDiffContainer({FieldDiff("doors", int, 5)}) +) class FakeModel(MinosModel): @@ -111,10 +110,10 @@ async def destroy(self): class FakeSagaManager(MinosSagaManager): """For testing purposes.""" - async def _run_new(self, name: str, **kwargs) -> NoReturn: + async def _run_new(self, name: str, **kwargs) -> None: """For testing purposes.""" - async def _load_and_run(self, reply: CommandReply, **kwargs) -> NoReturn: + async def _load_and_run(self, reply: CommandReply, **kwargs) -> None: """For testing purposes.""" @@ -138,7 +137,7 @@ async def send( reply_topic: str = None, status: CommandStatus = None, **kwargs, - ) -> NoReturn: + ) -> None: """For testing purposes.""" self.call_count += 1 self.items = items @@ -163,7 +162,7 @@ async def _submit(self, entry: RepositoryEntry) -> RepositoryEntry: entry.id = self.id_counter entry.version += 1 entry.aggregate_uuid = 9999 - entry.created_at = datetime.now() + entry.created_at = current_datetime() return entry @@ -196,7 +195,7 @@ def create_ticket(self, request: Request) -> Response: @classmethod @enroute.rest.command(url="orders/", method="DELETE") @enroute.broker.command(topic="DeleteTicket") - def delete_ticket(cls, request: Request) -> NoReturn: + def delete_ticket(cls, request: Request) -> None: """For testing purposes.""" return @@ -236,7 +235,7 @@ def __init__(self, content): @cached_property def user(self) -> Optional[UUID]: - return uuid.uuid4() + return uuid4() async def content(self, **kwargs): """For testing purposes""" @@ -247,3 +246,20 @@ def __eq__(self, other) -> bool: def __repr__(self) -> str: return f"FakeRequest({self._content!r})" + + +class FakeSnapshot(MinosSnapshot): + """For testing purposes.""" + + async def get(self, aggregate_name: str, uuid: UUID, **kwargs) -> Aggregate: + """For testing purposes.""" + + async def find(self, aggregate_name: str, condition: Condition, **kwargs) -> AsyncIterator[Aggregate]: + """For testing purposes.""" + + async def synchronize(self, **kwargs) -> None: + """For testing purposes.""" + + +class Order(Aggregate): + """For testing purposes"""