From 60b18a44dd743441d4e321bcbb46ac0fdb2af1f4 Mon Sep 17 00:00:00 2001 From: Santiago Fraire Date: Wed, 27 Jul 2022 14:52:05 +0200 Subject: [PATCH] fix: add mypy and some type hints --- examples/consume_multiple_topics.py | 6 +- examples/fastapi_example/__main__.py | 1 + examples/fastapi_example/app.py | 5 +- examples/fastapi_example/streaming/streams.py | 3 +- examples/json_serialization.py | 9 +- examples/simple.py | 5 +- kstreams/__init__.py | 2 +- kstreams/clients.py | 7 +- kstreams/create.py | 3 +- kstreams/engine.py | 15 +- kstreams/prometheus/monitor.py | 6 +- kstreams/prometheus/tasks.py | 9 +- kstreams/serializers.py | 3 +- kstreams/singlenton.py | 5 +- kstreams/streams.py | 15 +- kstreams/test_utils/structs.py | 3 +- kstreams/test_utils/test_clients.py | 10 +- kstreams/test_utils/test_utils.py | 13 +- kstreams/test_utils/topics.py | 4 +- kstreams/utils.py | 8 +- poetry.lock | 309 +++++++++--------- pyproject.toml | 21 +- scripts/{lint => format} | 0 scripts/test | 6 +- setup.cfg | 8 - tests/conftest.py | 7 +- tests/test_client.py | 7 +- tests/test_consumer.py | 5 +- tests/test_kstreams.py | 6 +- tests/test_monitor.py | 4 +- tests/test_producer.py | 5 +- tests/test_serialization.py | 15 +- tests/test_stream_engine.py | 7 +- 33 files changed, 285 insertions(+), 247 deletions(-) rename scripts/{lint => format} (100%) diff --git a/examples/consume_multiple_topics.py b/examples/consume_multiple_topics.py index cb7f7d52..f2342604 100644 --- a/examples/consume_multiple_topics.py +++ b/examples/consume_multiple_topics.py @@ -1,9 +1,9 @@ -from kstreams import create_engine, Stream - import asyncio import json -topics = ["local--kstreams", "local--hello-world"] +from kstreams import Stream, create_engine + +topics = ["local--kstreams-2", "local--hello-world"] stream_engine = create_engine(title="my-stream-engine") diff --git a/examples/fastapi_example/__main__.py b/examples/fastapi_example/__main__.py index 6cf1de49..a238c81e 100644 --- a/examples/fastapi_example/__main__.py +++ b/examples/fastapi_example/__main__.py @@ -1,4 +1,5 @@ import logging + import uvicorn diff --git a/examples/fastapi_example/app.py b/examples/fastapi_example/app.py index 6623d165..4e8f3289 100644 --- a/examples/fastapi_example/app.py +++ b/examples/fastapi_example/app.py @@ -1,7 +1,8 @@ -from .streaming.streams import stream_engine from fastapi import FastAPI from starlette.responses import Response -from starlette_prometheus import metrics, PrometheusMiddleware +from starlette_prometheus import PrometheusMiddleware, metrics + +from .streaming.streams import stream_engine def create_app(): diff --git a/examples/fastapi_example/streaming/streams.py b/examples/fastapi_example/streaming/streams.py index b0612616..b511e6bc 100644 --- a/examples/fastapi_example/streaming/streams.py +++ b/examples/fastapi_example/streaming/streams.py @@ -1,6 +1,7 @@ -from .engine import stream_engine from kstreams import Stream +from .engine import stream_engine + @stream_engine.stream("local--kstream") async def stream(stream: Stream): diff --git a/examples/json_serialization.py b/examples/json_serialization.py index b5babf9d..63cf89c7 100644 --- a/examples/json_serialization.py +++ b/examples/json_serialization.py @@ -1,10 +1,11 @@ -from kstreams import consts, create_engine, Stream -from kstreams.custom_types import Headers +import asyncio +import json from typing import Any, Dict, Optional import aiokafka -import asyncio -import json + +from kstreams import Stream, consts, create_engine +from kstreams.custom_types import Headers class JsonSerializer: diff --git a/examples/simple.py b/examples/simple.py index 12e703d5..132a7e79 100644 --- a/examples/simple.py +++ b/examples/simple.py @@ -1,9 +1,10 @@ +import asyncio + from aiokafka.structs import RecordMetadata + from kstreams import create_engine from kstreams.streams import Stream -import asyncio - topic = "local--py-streams" stream_engine = create_engine(title="my-stream-engine") diff --git a/kstreams/__init__.py b/kstreams/__init__.py index 21cc49b2..3bb5b4fa 100644 --- a/kstreams/__init__.py +++ b/kstreams/__init__.py @@ -1,4 +1,4 @@ from .clients import Consumer, ConsumerType, Producer, ProducerType # noqa: F401 -from .create import create_engine, StreamEngine # noqa: F401 +from .create import StreamEngine, create_engine # noqa: F401 from .prometheus.monitor import PrometheusMonitor, PrometheusMonitorType # noqa: F401 from .streams import KafkaConsumer, KafkaStream, Stream # noqa: F401 diff --git a/kstreams/clients.py b/kstreams/clients.py index 072b40ff..5c927fc2 100644 --- a/kstreams/clients.py +++ b/kstreams/clients.py @@ -1,9 +1,10 @@ -from . import conf, utils -from pkgsettings import PrefixedSettings +import logging from typing import Callable, Optional, TypeVar import aiokafka -import logging +from pkgsettings import PrefixedSettings + +from . import conf, utils logger = logging.getLogger(__name__) diff --git a/kstreams/create.py b/kstreams/create.py index 3111c804..64c5aeb1 100644 --- a/kstreams/create.py +++ b/kstreams/create.py @@ -1,8 +1,9 @@ +from typing import Optional + from .clients import Consumer, ConsumerType, Producer, ProducerType from .engine import StreamEngine from .prometheus.monitor import PrometheusMonitor, PrometheusMonitorType from .serializers import ValueDeserializer, ValueSerializer -from typing import Optional def create_engine( diff --git a/kstreams/engine.py b/kstreams/engine.py index 437f3664..ef390725 100644 --- a/kstreams/engine.py +++ b/kstreams/engine.py @@ -1,3 +1,11 @@ +import asyncio +import inspect +import logging +from typing import Any, Coroutine, Dict, List, Optional, Type, Union + +from kstreams.clients import ConsumerType, ProducerType +from kstreams.utils import encode_headers + from .custom_types import DecoratedCallable, Headers from .exceptions import DuplicateStreamException from .prometheus.monitor import PrometheusMonitorType @@ -5,13 +13,6 @@ from .serializers import ValueDeserializer, ValueSerializer from .singlenton import Singleton from .streams import KafkaStream, Stream -from kstreams.clients import ConsumerType, ProducerType -from kstreams.utils import encode_headers -from typing import Any, Coroutine, Dict, List, Optional, Type, Union - -import asyncio -import inspect -import logging logger = logging.getLogger(__name__) diff --git a/kstreams/prometheus/monitor.py b/kstreams/prometheus/monitor.py index 2fe450e1..fc4067bb 100644 --- a/kstreams/prometheus/monitor.py +++ b/kstreams/prometheus/monitor.py @@ -1,7 +1,9 @@ -from kstreams.singlenton import Singleton -from prometheus_client import Gauge from typing import Dict, TypeVar +from prometheus_client import Gauge + +from kstreams.singlenton import Singleton + PrometheusMonitorType = TypeVar("PrometheusMonitorType", bound="PrometheusMonitor") diff --git a/kstreams/prometheus/tasks.py b/kstreams/prometheus/tasks.py index 7c281bc6..2312acda 100644 --- a/kstreams/prometheus/tasks.py +++ b/kstreams/prometheus/tasks.py @@ -1,9 +1,10 @@ -from .monitor import PrometheusMonitorType +import asyncio +from typing import Any, DefaultDict, List + from kstreams.clients import Consumer from kstreams.streams import KafkaStream -from typing import DefaultDict, List -import asyncio +from .monitor import PrometheusMonitorType async def metrics_task(streams: List[KafkaStream], monitor: PrometheusMonitorType): @@ -43,7 +44,7 @@ async def generate_consumer_metrics(consumer: Consumer, monitor: PrometheusMonit } """ - metrics = DefaultDict(str) + metrics: DefaultDict[Any, dict] = DefaultDict(dict) topic_partitions = consumer.assignment() for topic_partition in topic_partitions: diff --git a/kstreams/serializers.py b/kstreams/serializers.py index 87ee7057..d59258a0 100644 --- a/kstreams/serializers.py +++ b/kstreams/serializers.py @@ -1,8 +1,9 @@ -from .custom_types import Headers from typing import Any, Dict, Optional, Protocol import aiokafka +from .custom_types import Headers + class ValueDeserializer(Protocol): async def deserialize( diff --git a/kstreams/singlenton.py b/kstreams/singlenton.py index 9767a5c7..fa4983d8 100644 --- a/kstreams/singlenton.py +++ b/kstreams/singlenton.py @@ -1,5 +1,8 @@ +from typing import Dict + + class Singleton(type): - _instances = {} + _instances: Dict = {} def __call__(cls, *args, **kwargs): if cls not in cls._instances: diff --git a/kstreams/streams.py b/kstreams/streams.py index c32ef83d..a0747dfe 100644 --- a/kstreams/streams.py +++ b/kstreams/streams.py @@ -1,6 +1,7 @@ -from .clients import Consumer, ConsumerType -from .serializers import ValueDeserializer -from aiokafka import errors, structs +import asyncio +import inspect +import logging +import uuid from typing import ( Any, AsyncGenerator, @@ -13,10 +14,10 @@ Union, ) -import asyncio -import inspect -import logging -import uuid +from aiokafka import errors, structs + +from .clients import Consumer, ConsumerType +from .serializers import ValueDeserializer logger = logging.getLogger(__name__) diff --git a/kstreams/test_utils/structs.py b/kstreams/test_utils/structs.py index e22c9471..bf078672 100644 --- a/kstreams/test_utils/structs.py +++ b/kstreams/test_utils/structs.py @@ -1,7 +1,8 @@ from dataclasses import dataclass -from kstreams.custom_types import KafkaHeaders from typing import Generic, NamedTuple, Optional, TypeVar +from kstreams.custom_types import KafkaHeaders + KT = TypeVar("KT") VT = TypeVar("VT") diff --git a/kstreams/test_utils/test_clients.py b/kstreams/test_utils/test_clients.py index d0938ccf..379b61aa 100644 --- a/kstreams/test_utils/test_clients.py +++ b/kstreams/test_utils/test_clients.py @@ -1,10 +1,12 @@ -from .structs import ConsumerRecord, RecordMetadata, TopicPartition -from .topics import TopicManager from datetime import datetime +from typing import Any, Coroutine, Dict, List, Optional, Tuple, Union + from kstreams.clients import Consumer, Producer from kstreams.custom_types import Headers from kstreams.serializers import ValueSerializer -from typing import Any, Coroutine, Dict, List, Optional, Tuple, Union + +from .structs import ConsumerRecord, RecordMetadata, TopicPartition +from .topics import TopicManager class Base: @@ -84,6 +86,8 @@ async def getone( ) -> Union[bytes, Dict]: # The return type must be fixed later on for topic_partition in self._assigments: topic = TopicManager.get_topic(topic_partition.topic) + if topic is None: + raise AttributeError("There should be a topic") if not topic.consumed: break diff --git a/kstreams/test_utils/test_utils.py b/kstreams/test_utils/test_utils.py index f7281f3f..f8d63849 100644 --- a/kstreams/test_utils/test_utils.py +++ b/kstreams/test_utils/test_utils.py @@ -1,14 +1,15 @@ -from .structs import RecordMetadata -from .test_clients import TestConsumer, TestProducer -from .topics import TopicManager +import asyncio +from types import TracebackType +from typing import Any, Dict, List, Optional, Type + from kstreams.create import create_engine from kstreams.custom_types import Headers from kstreams.serializers import ValueSerializer from kstreams.streams import Stream -from types import TracebackType -from typing import Any, Dict, List, Optional, Type -import asyncio +from .structs import RecordMetadata +from .test_clients import TestConsumer, TestProducer +from .topics import TopicManager class TestStreamClient: diff --git a/kstreams/test_utils/topics.py b/kstreams/test_utils/topics.py index d4b1279f..281bd5a4 100644 --- a/kstreams/test_utils/topics.py +++ b/kstreams/test_utils/topics.py @@ -1,8 +1,8 @@ -from . import test_clients +import asyncio from dataclasses import dataclass from typing import Any, ClassVar, Dict, Optional -import asyncio +from . import test_clients @dataclass diff --git a/kstreams/utils.py b/kstreams/utils.py index 9e692883..b2216cd5 100644 --- a/kstreams/utils.py +++ b/kstreams/utils.py @@ -1,10 +1,10 @@ -from kstreams import custom_types -from kstreams.conf import settings -from tempfile import NamedTemporaryFile - import contextlib import ssl import typing +from tempfile import NamedTemporaryFile + +from kstreams import custom_types +from kstreams.conf import settings class EmptySSLDataException(Exception): diff --git a/poetry.lock b/poetry.lock index 8bece8b1..9f48c7a5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -40,20 +40,9 @@ python-versions = "*" [package.extras] test = ["coverage", "flake8", "pexpect", "wheel"] -[[package]] -name = "asgiref" -version = "3.5.2" -description = "ASGI specs, helper code, and adapters" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.extras] -tests = ["pytest", "pytest-asyncio", "mypy (>=0.800)"] - [[package]] name = "atomicwrites" -version = "1.4.0" +version = "1.4.1" description = "Atomic file writes." category = "dev" optional = false @@ -103,6 +92,14 @@ category = "dev" optional = false python-versions = ">=3.6" +[[package]] +name = "chardet" +version = "5.0.0" +description = "Universal encoding detector for Python 3" +category = "dev" +optional = false +python-versions = ">=3.6" + [[package]] name = "charset-normalizer" version = "2.1.0" @@ -147,7 +144,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [[package]] name = "commitizen" -version = "2.27.1" +version = "2.29.2" description = "Python commitizen client tool" category = "dev" optional = false @@ -155,6 +152,7 @@ python-versions = ">=3.6.2,<4.0.0" [package.dependencies] argcomplete = ">=1.12.1,<2.0.0" +chardet = ">=5.0.0,<6.0.0" colorama = ">=0.4.1,<0.5.0" decli = ">=0.5.2,<0.6.0" jinja2 = ">=2.10.3" @@ -167,7 +165,7 @@ typing-extensions = ">=4.0.1,<5.0.0" [[package]] name = "coverage" -version = "6.4.1" +version = "6.4.2" description = "Code coverage measurement for Python" category = "dev" optional = false @@ -204,16 +202,16 @@ test = ["pytest (>=6.2.4,<7.0.0)", "pytest-cov (>=2.12.0,<4.0.0)", "mypy (==0.91 [[package]] name = "flake8" -version = "3.9.2" +version = "4.0.1" description = "the modular source code checker: pep8 pyflakes and co" category = "dev" optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" +python-versions = ">=3.6" [package.dependencies] mccabe = ">=0.6.0,<0.7.0" -pycodestyle = ">=2.7.0,<2.8.0" -pyflakes = ">=2.3.0,<2.4.0" +pycodestyle = ">=2.8.0,<2.9.0" +pyflakes = ">=2.4.0,<2.5.0" [[package]] name = "future" @@ -255,7 +253,7 @@ python-versions = ">=3.5" [[package]] name = "importlib-metadata" -version = "4.11.4" +version = "4.12.0" description = "Read metadata from Python packages" category = "dev" optional = false @@ -267,7 +265,7 @@ zipp = ">=0.5" [package.extras] docs = ["sphinx", "jaraco.packaging (>=9)", "rst.linker (>=1.9)"] perf = ["ipython"] -testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)", "importlib-resources (>=1.3)"] +testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.3)", "packaging", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)", "importlib-resources (>=1.3)"] [[package]] name = "iniconfig" @@ -371,7 +369,7 @@ python-versions = ">=3.6" [[package]] name = "mkdocs" -version = "1.3.0" +version = "1.3.1" description = "Project documentation with Markdown." category = "dev" optional = false @@ -382,7 +380,7 @@ click = ">=3.3" ghp-import = ">=1.0" importlib-metadata = ">=4.3" Jinja2 = ">=2.10.2" -Markdown = ">=3.2.1" +Markdown = ">=3.2.1,<3.4" mergedeep = ">=1.3.4" packaging = ">=20.5" PyYAML = ">=3.10" @@ -416,6 +414,24 @@ category = "dev" optional = false python-versions = ">=3.6" +[[package]] +name = "mypy" +version = "0.961" +description = "Optional static typing for Python" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +mypy-extensions = ">=0.4.3" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = ">=3.10" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +python2 = ["typed-ast (>=1.4.0,<2)"] +reports = ["lxml"] + [[package]] name = "mypy-extensions" version = "0.4.3" @@ -503,7 +519,7 @@ twisted = ["twisted"] [[package]] name = "prompt-toolkit" -version = "3.0.29" +version = "3.0.30" description = "Library for building powerful interactive command lines in Python" category = "dev" optional = false @@ -522,11 +538,11 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [[package]] name = "pycodestyle" -version = "2.7.0" +version = "2.8.0" description = "Python style guide checker" category = "dev" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [[package]] name = "pydantic" @@ -545,7 +561,7 @@ email = ["email-validator (>=1.0.3)"] [[package]] name = "pyflakes" -version = "2.3.1" +version = "2.4.0" description = "passive checker of Python programs" category = "dev" optional = false @@ -777,7 +793,7 @@ python-versions = ">=3.7" [[package]] name = "tomlkit" -version = "0.11.0" +version = "0.11.1" description = "Style preserving TOML library" category = "dev" optional = false @@ -785,7 +801,7 @@ python-versions = ">=3.6,<4.0" [[package]] name = "typing-extensions" -version = "4.2.0" +version = "4.3.0" description = "Backported and Experimental Type Hints for Python 3.7+" category = "main" optional = false @@ -793,7 +809,7 @@ python-versions = ">=3.7" [[package]] name = "urllib3" -version = "1.26.10" +version = "1.26.11" description = "HTTP library with thread-safe connection pooling, file post, and more." category = "dev" optional = false @@ -806,19 +822,18 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] name = "uvicorn" -version = "0.17.6" +version = "0.18.2" description = "The lightning-fast ASGI server." category = "dev" optional = false python-versions = ">=3.7" [package.dependencies] -asgiref = ">=3.4.0" click = ">=7.0" h11 = ">=0.8" [package.extras] -standard = ["websockets (>=10.0)", "httptools (>=0.4.0)", "watchgod (>=0.6)", "python-dotenv (>=0.13)", "PyYAML (>=5.1)", "uvloop (>=0.14.0,!=0.15.0,!=0.15.1)", "colorama (>=0.4)"] +standard = ["websockets (>=10.0)", "httptools (>=0.4.0)", "watchfiles (>=0.13)", "python-dotenv (>=0.13)", "PyYAML (>=5.1)", "uvloop (>=0.14.0,!=0.15.0,!=0.15.1)", "colorama (>=0.4)"] [[package]] name = "watchdog" @@ -841,31 +856,34 @@ python-versions = "*" [[package]] name = "werkzeug" -version = "2.1.2" +version = "2.2.0" description = "The comprehensive WSGI web application library." category = "dev" optional = false python-versions = ">=3.7" +[package.dependencies] +MarkupSafe = ">=2.1.1" + [package.extras] watchdog = ["watchdog"] [[package]] name = "zipp" -version = "3.8.0" +version = "3.8.1" description = "Backport of pathlib-compatible object wrapper for zip files" category = "dev" optional = false python-versions = ">=3.7" [package.extras] -docs = ["sphinx", "jaraco.packaging (>=9)", "rst.linker (>=1.9)"] -testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)"] +docs = ["sphinx", "jaraco.packaging (>=9)", "rst.linker (>=1.9)", "jaraco.tidelift (>=1.4)"] +testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.3)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)"] [metadata] lock-version = "1.1" python-versions = "^3.8" -content-hash = "94ec780b95e581b6a71f7258689b003d21140c7fcaa7ee7ff26885ab7a0db286" +content-hash = "7af9a400578c3fa7a34e033b5f30d9e3755a2f6f8d90d22dcb0f0a930df9b825" [metadata.files] aiokafka = [ @@ -899,88 +917,65 @@ argcomplete = [ {file = "argcomplete-1.12.3-py2.py3-none-any.whl", hash = "sha256:291f0beca7fd49ce285d2f10e4c1c77e9460cf823eef2de54df0c0fec88b0d81"}, {file = "argcomplete-1.12.3.tar.gz", hash = "sha256:2c7dbffd8c045ea534921e63b0be6fe65e88599990d8dc408ac8c542b72a5445"}, ] -asgiref = [ - {file = "asgiref-3.5.2-py3-none-any.whl", hash = "sha256:1d2880b792ae8757289136f1db2b7b99100ce959b2aa57fd69dab783d05afac4"}, - {file = "asgiref-3.5.2.tar.gz", hash = "sha256:4a29362a6acebe09bf1d6640db38c1dc3d9217c68e6f9f6204d72667fc19a424"}, -] -atomicwrites = [ - {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, - {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, -] +atomicwrites = [] attrs = [ {file = "attrs-21.4.0-py2.py3-none-any.whl", hash = "sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4"}, {file = "attrs-21.4.0.tar.gz", hash = "sha256:626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd"}, ] -black = [] -certifi = [] +black = [ + {file = "black-22.6.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f586c26118bc6e714ec58c09df0157fe2d9ee195c764f630eb0d8e7ccce72e69"}, + {file = "black-22.6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b270a168d69edb8b7ed32c193ef10fd27844e5c60852039599f9184460ce0807"}, + {file = "black-22.6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6797f58943fceb1c461fb572edbe828d811e719c24e03375fd25170ada53825e"}, + {file = "black-22.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c85928b9d5f83b23cee7d0efcb310172412fbf7cb9d9ce963bd67fd141781def"}, + {file = "black-22.6.0-cp310-cp310-win_amd64.whl", hash = "sha256:f6fe02afde060bbeef044af7996f335fbe90b039ccf3f5eb8f16df8b20f77666"}, + {file = "black-22.6.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cfaf3895a9634e882bf9d2363fed5af8888802d670f58b279b0bece00e9a872d"}, + {file = "black-22.6.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94783f636bca89f11eb5d50437e8e17fbc6a929a628d82304c80fa9cd945f256"}, + {file = "black-22.6.0-cp36-cp36m-win_amd64.whl", hash = "sha256:2ea29072e954a4d55a2ff58971b83365eba5d3d357352a07a7a4df0d95f51c78"}, + {file = "black-22.6.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e439798f819d49ba1c0bd9664427a05aab79bfba777a6db94fd4e56fae0cb849"}, + {file = "black-22.6.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:187d96c5e713f441a5829e77120c269b6514418f4513a390b0499b0987f2ff1c"}, + {file = "black-22.6.0-cp37-cp37m-win_amd64.whl", hash = "sha256:074458dc2f6e0d3dab7928d4417bb6957bb834434516f21514138437accdbe90"}, + {file = "black-22.6.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:a218d7e5856f91d20f04e931b6f16d15356db1c846ee55f01bac297a705ca24f"}, + {file = "black-22.6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:568ac3c465b1c8b34b61cd7a4e349e93f91abf0f9371eda1cf87194663ab684e"}, + {file = "black-22.6.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:6c1734ab264b8f7929cef8ae5f900b85d579e6cbfde09d7387da8f04771b51c6"}, + {file = "black-22.6.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c9a3ac16efe9ec7d7381ddebcc022119794872abce99475345c5a61aa18c45ad"}, + {file = "black-22.6.0-cp38-cp38-win_amd64.whl", hash = "sha256:b9fd45787ba8aa3f5e0a0a98920c1012c884622c6c920dbe98dbd05bc7c70fbf"}, + {file = "black-22.6.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:7ba9be198ecca5031cd78745780d65a3f75a34b2ff9be5837045dce55db83d1c"}, + {file = "black-22.6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a3db5b6409b96d9bd543323b23ef32a1a2b06416d525d27e0f67e74f1446c8f2"}, + {file = "black-22.6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:560558527e52ce8afba936fcce93a7411ab40c7d5fe8c2463e279e843c0328ee"}, + {file = "black-22.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b154e6bbde1e79ea3260c4b40c0b7b3109ffcdf7bc4ebf8859169a6af72cd70b"}, + {file = "black-22.6.0-cp39-cp39-win_amd64.whl", hash = "sha256:4af5bc0e1f96be5ae9bd7aaec219c901a94d6caa2484c21983d043371c733fc4"}, + {file = "black-22.6.0-py3-none-any.whl", hash = "sha256:ac609cf8ef5e7115ddd07d85d988d074ed00e10fbc3445aee393e70164a2219c"}, + {file = "black-22.6.0.tar.gz", hash = "sha256:6c6d39e28aed379aec40da1c65434c77d75e65bb59a1e1c283de545fb4e7c6c9"}, +] +certifi = [ + {file = "certifi-2022.6.15-py3-none-any.whl", hash = "sha256:fe86415d55e84719d75f8b69414f6438ac3547d2078ab91b67e779ef69378412"}, + {file = "certifi-2022.6.15.tar.gz", hash = "sha256:84c85a9078b11105f04f3036a9482ae10e4621616db313fe045dd24743a0820d"}, +] +chardet = [] charset-normalizer = [] click = [ {file = "click-8.1.3-py3-none-any.whl", hash = "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"}, {file = "click-8.1.3.tar.gz", hash = "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e"}, ] -codecov = [] +codecov = [ + {file = "codecov-2.1.12-py2.py3-none-any.whl", hash = "sha256:585dc217dc3d8185198ceb402f85d5cb5dbfa0c5f350a5abcdf9e347776a5b47"}, + {file = "codecov-2.1.12-py3.8.egg", hash = "sha256:782a8e5352f22593cbc5427a35320b99490eb24d9dcfa2155fd99d2b75cfb635"}, + {file = "codecov-2.1.12.tar.gz", hash = "sha256:a0da46bb5025426da895af90938def8ee12d37fcbcbbbc15b6dc64cf7ebc51c1"}, +] colorama = [ {file = "colorama-0.4.5-py2.py3-none-any.whl", hash = "sha256:854bf444933e37f5824ae7bfc1e98d5bce2ebe4160d46b5edf346a89358e99da"}, {file = "colorama-0.4.5.tar.gz", hash = "sha256:e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4"}, ] -commitizen = [ - {file = "commitizen-2.27.1-py3-none-any.whl", hash = "sha256:046d512c5bc795cce625211434721946f21abf713f48753f2353ec1a3e114c3f"}, - {file = "commitizen-2.27.1.tar.gz", hash = "sha256:71a3e1fea37ced781bc440bd7d464abd5b797da8e762c1b9b632e007c2019b50"}, -] -coverage = [ - {file = "coverage-6.4.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f1d5aa2703e1dab4ae6cf416eb0095304f49d004c39e9db1d86f57924f43006b"}, - {file = "coverage-6.4.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4ce1b258493cbf8aec43e9b50d89982346b98e9ffdfaae8ae5793bc112fb0068"}, - {file = "coverage-6.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:83c4e737f60c6936460c5be330d296dd5b48b3963f48634c53b3f7deb0f34ec4"}, - {file = "coverage-6.4.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:84e65ef149028516c6d64461b95a8dbcfce95cfd5b9eb634320596173332ea84"}, - {file = "coverage-6.4.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f69718750eaae75efe506406c490d6fc5a6161d047206cc63ce25527e8a3adad"}, - {file = "coverage-6.4.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e57816f8ffe46b1df8f12e1b348f06d164fd5219beba7d9433ba79608ef011cc"}, - {file = "coverage-6.4.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:01c5615d13f3dd3aa8543afc069e5319cfa0c7d712f6e04b920431e5c564a749"}, - {file = "coverage-6.4.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:75ab269400706fab15981fd4bd5080c56bd5cc07c3bccb86aab5e1d5a88dc8f4"}, - {file = "coverage-6.4.1-cp310-cp310-win32.whl", hash = "sha256:a7f3049243783df2e6cc6deafc49ea123522b59f464831476d3d1448e30d72df"}, - {file = "coverage-6.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:ee2ddcac99b2d2aec413e36d7a429ae9ebcadf912946b13ffa88e7d4c9b712d6"}, - {file = "coverage-6.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:fb73e0011b8793c053bfa85e53129ba5f0250fdc0392c1591fd35d915ec75c46"}, - {file = "coverage-6.4.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:106c16dfe494de3193ec55cac9640dd039b66e196e4641fa8ac396181578b982"}, - {file = "coverage-6.4.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:87f4f3df85aa39da00fd3ec4b5abeb7407e82b68c7c5ad181308b0e2526da5d4"}, - {file = "coverage-6.4.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:961e2fb0680b4f5ad63234e0bf55dfb90d302740ae9c7ed0120677a94a1590cb"}, - {file = "coverage-6.4.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:cec3a0f75c8f1031825e19cd86ee787e87cf03e4fd2865c79c057092e69e3a3b"}, - {file = "coverage-6.4.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:129cd05ba6f0d08a766d942a9ed4b29283aff7b2cccf5b7ce279d50796860bb3"}, - {file = "coverage-6.4.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:bf5601c33213d3cb19d17a796f8a14a9eaa5e87629a53979a5981e3e3ae166f6"}, - {file = "coverage-6.4.1-cp37-cp37m-win32.whl", hash = "sha256:269eaa2c20a13a5bf17558d4dc91a8d078c4fa1872f25303dddcbba3a813085e"}, - {file = "coverage-6.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:f02cbbf8119db68455b9d763f2f8737bb7db7e43720afa07d8eb1604e5c5ae28"}, - {file = "coverage-6.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ffa9297c3a453fba4717d06df579af42ab9a28022444cae7fa605af4df612d54"}, - {file = "coverage-6.4.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:145f296d00441ca703a659e8f3eb48ae39fb083baba2d7ce4482fb2723e050d9"}, - {file = "coverage-6.4.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d67d44996140af8b84284e5e7d398e589574b376fb4de8ccd28d82ad8e3bea13"}, - {file = "coverage-6.4.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2bd9a6fc18aab8d2e18f89b7ff91c0f34ff4d5e0ba0b33e989b3cd4194c81fd9"}, - {file = "coverage-6.4.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3384f2a3652cef289e38100f2d037956194a837221edd520a7ee5b42d00cc605"}, - {file = "coverage-6.4.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9b3e07152b4563722be523e8cd0b209e0d1a373022cfbde395ebb6575bf6790d"}, - {file = "coverage-6.4.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:1480ff858b4113db2718848d7b2d1b75bc79895a9c22e76a221b9d8d62496428"}, - {file = "coverage-6.4.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:865d69ae811a392f4d06bde506d531f6a28a00af36f5c8649684a9e5e4a85c83"}, - {file = "coverage-6.4.1-cp38-cp38-win32.whl", hash = "sha256:664a47ce62fe4bef9e2d2c430306e1428ecea207ffd68649e3b942fa8ea83b0b"}, - {file = "coverage-6.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:26dff09fb0d82693ba9e6231248641d60ba606150d02ed45110f9ec26404ed1c"}, - {file = "coverage-6.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d9c80df769f5ec05ad21ea34be7458d1dc51ff1fb4b2219e77fe24edf462d6df"}, - {file = "coverage-6.4.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:39ee53946bf009788108b4dd2894bf1349b4e0ca18c2016ffa7d26ce46b8f10d"}, - {file = "coverage-6.4.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f5b66caa62922531059bc5ac04f836860412f7f88d38a476eda0a6f11d4724f4"}, - {file = "coverage-6.4.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fd180ed867e289964404051a958f7cccabdeed423f91a899829264bb7974d3d3"}, - {file = "coverage-6.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:84631e81dd053e8a0d4967cedab6db94345f1c36107c71698f746cb2636c63e3"}, - {file = "coverage-6.4.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:8c08da0bd238f2970230c2a0d28ff0e99961598cb2e810245d7fc5afcf1254e8"}, - {file = "coverage-6.4.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:d42c549a8f41dc103a8004b9f0c433e2086add8a719da00e246e17cbe4056f72"}, - {file = "coverage-6.4.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:309ce4a522ed5fca432af4ebe0f32b21d6d7ccbb0f5fcc99290e71feba67c264"}, - {file = "coverage-6.4.1-cp39-cp39-win32.whl", hash = "sha256:fdb6f7bd51c2d1714cea40718f6149ad9be6a2ee7d93b19e9f00934c0f2a74d9"}, - {file = "coverage-6.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:342d4aefd1c3e7f620a13f4fe563154d808b69cccef415415aece4c786665397"}, - {file = "coverage-6.4.1-pp36.pp37.pp38-none-any.whl", hash = "sha256:4803e7ccf93230accb928f3a68f00ffa80a88213af98ed338a57ad021ef06815"}, - {file = "coverage-6.4.1.tar.gz", hash = "sha256:4321f075095a096e70aff1d002030ee612b65a205a0a0f5b815280d5dc58100c"}, -] +commitizen = [] +coverage = [] decli = [ {file = "decli-0.5.2-py3-none-any.whl", hash = "sha256:d3207bc02d0169bf6ed74ccca09ce62edca0eb25b0ebf8bf4ae3fb8333e15ca0"}, {file = "decli-0.5.2.tar.gz", hash = "sha256:f2cde55034a75c819c630c7655a844c612f2598c42c21299160465df6ad463ad"}, ] -fastapi = [ - {file = "fastapi-0.75.2-py3-none-any.whl", hash = "sha256:a70d31f4249b6b42dbe267667d22f83af645b2d857876c97f83ca9573215784f"}, - {file = "fastapi-0.75.2.tar.gz", hash = "sha256:b5dac161ee19d33346040d3f44d8b7a9ac09b37df9efff95891f5e7641fa482f"}, -] +fastapi = [] flake8 = [ - {file = "flake8-3.9.2-py2.py3-none-any.whl", hash = "sha256:bf8fd333346d844f616e8d47905ef3a3384edae6b4e9beb0c5101e25e3110907"}, - {file = "flake8-3.9.2.tar.gz", hash = "sha256:07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b6b1d78057c576b"}, + {file = "flake8-4.0.1-py2.py3-none-any.whl", hash = "sha256:479b1304f72536a55948cb40a32dce8bb0ffe3501e26eaf292c7e60eb5e0428d"}, + {file = "flake8-4.0.1.tar.gz", hash = "sha256:806e034dda44114815e23c16ef92f95c91e4c71100ff52813adf7132a6ad870d"}, ] future = [ {file = "future-0.18.2.tar.gz", hash = "sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d"}, @@ -998,8 +993,8 @@ idna = [ {file = "idna-3.3.tar.gz", hash = "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"}, ] importlib-metadata = [ - {file = "importlib_metadata-4.11.4-py3-none-any.whl", hash = "sha256:c58c8eb8a762858f49e18436ff552e83914778e50e9d2f1660535ffb364552ec"}, - {file = "importlib_metadata-4.11.4.tar.gz", hash = "sha256:5d26852efe48c0a32b0509ffbc583fda1a2266545a78d104a6f4aff3db17d700"}, + {file = "importlib_metadata-4.12.0-py3-none-any.whl", hash = "sha256:7401a975809ea1fdc658c3aa4f78cc2195a0e019c5cbc4c06122884e9ae80c23"}, + {file = "importlib_metadata-4.12.0.tar.gz", hash = "sha256:637245b8bab2b6502fcbc752cc4b7a6f6243bb02b31c5c26156ad103d3d45670"}, ] iniconfig = [ {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, @@ -1075,13 +1070,38 @@ mergedeep = [ {file = "mergedeep-1.3.4-py3-none-any.whl", hash = "sha256:70775750742b25c0d8f36c55aed03d24c3384d17c951b3175d898bd778ef0307"}, {file = "mergedeep-1.3.4.tar.gz", hash = "sha256:0096d52e9dad9939c3d975a774666af186eda617e6ca84df4c94dec30004f2a8"}, ] -mkdocs = [ - {file = "mkdocs-1.3.0-py3-none-any.whl", hash = "sha256:26bd2b03d739ac57a3e6eed0b7bcc86168703b719c27b99ad6ca91dc439aacde"}, - {file = "mkdocs-1.3.0.tar.gz", hash = "sha256:b504405b04da38795fec9b2e5e28f6aa3a73bb0960cb6d5d27ead28952bd35ea"}, -] +mkdocs = [] mkdocs-material = [] mkdocs-material-extensions = [] -mypy-extensions = [] +mypy = [ + {file = "mypy-0.961-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:697540876638ce349b01b6786bc6094ccdaba88af446a9abb967293ce6eaa2b0"}, + {file = "mypy-0.961-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b117650592e1782819829605a193360a08aa99f1fc23d1d71e1a75a142dc7e15"}, + {file = "mypy-0.961-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:bdd5ca340beffb8c44cb9dc26697628d1b88c6bddf5c2f6eb308c46f269bb6f3"}, + {file = "mypy-0.961-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:3e09f1f983a71d0672bbc97ae33ee3709d10c779beb613febc36805a6e28bb4e"}, + {file = "mypy-0.961-cp310-cp310-win_amd64.whl", hash = "sha256:e999229b9f3198c0c880d5e269f9f8129c8862451ce53a011326cad38b9ccd24"}, + {file = "mypy-0.961-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:b24be97351084b11582fef18d79004b3e4db572219deee0212078f7cf6352723"}, + {file = "mypy-0.961-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f4a21d01fc0ba4e31d82f0fff195682e29f9401a8bdb7173891070eb260aeb3b"}, + {file = "mypy-0.961-cp36-cp36m-win_amd64.whl", hash = "sha256:439c726a3b3da7ca84a0199a8ab444cd8896d95012c4a6c4a0d808e3147abf5d"}, + {file = "mypy-0.961-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5a0b53747f713f490affdceef835d8f0cb7285187a6a44c33821b6d1f46ed813"}, + {file = "mypy-0.961-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:0e9f70df36405c25cc530a86eeda1e0867863d9471fe76d1273c783df3d35c2e"}, + {file = "mypy-0.961-cp37-cp37m-win_amd64.whl", hash = "sha256:b88f784e9e35dcaa075519096dc947a388319cb86811b6af621e3523980f1c8a"}, + {file = "mypy-0.961-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:d5aaf1edaa7692490f72bdb9fbd941fbf2e201713523bdb3f4038be0af8846c6"}, + {file = "mypy-0.961-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9f5f5a74085d9a81a1f9c78081d60a0040c3efb3f28e5c9912b900adf59a16e6"}, + {file = "mypy-0.961-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:f4b794db44168a4fc886e3450201365c9526a522c46ba089b55e1f11c163750d"}, + {file = "mypy-0.961-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:64759a273d590040a592e0f4186539858c948302c653c2eac840c7a3cd29e51b"}, + {file = "mypy-0.961-cp38-cp38-win_amd64.whl", hash = "sha256:63e85a03770ebf403291ec50097954cc5caf2a9205c888ce3a61bd3f82e17569"}, + {file = "mypy-0.961-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5f1332964963d4832a94bebc10f13d3279be3ce8f6c64da563d6ee6e2eeda932"}, + {file = "mypy-0.961-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:006be38474216b833eca29ff6b73e143386f352e10e9c2fbe76aa8549e5554f5"}, + {file = "mypy-0.961-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9940e6916ed9371809b35b2154baf1f684acba935cd09928952310fbddaba648"}, + {file = "mypy-0.961-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:a5ea0875a049de1b63b972456542f04643daf320d27dc592d7c3d9cd5d9bf950"}, + {file = "mypy-0.961-cp39-cp39-win_amd64.whl", hash = "sha256:1ece702f29270ec6af25db8cf6185c04c02311c6bb21a69f423d40e527b75c56"}, + {file = "mypy-0.961-py3-none-any.whl", hash = "sha256:03c6cc893e7563e7b2949b969e63f02c000b32502a1b4d1314cabe391aa87d66"}, + {file = "mypy-0.961.tar.gz", hash = "sha256:f730d56cb924d371c26b8eaddeea3cc07d78ff51c521c6d04899ac6904b75492"}, +] +mypy-extensions = [ + {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, + {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, +] packaging = [ {file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"}, {file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"}, @@ -1090,28 +1110,37 @@ parso = [ {file = "parso-0.7.1-py2.py3-none-any.whl", hash = "sha256:97218d9159b2520ff45eb78028ba8b50d2bc61dcc062a9682666f2dc4bd331ea"}, {file = "parso-0.7.1.tar.gz", hash = "sha256:caba44724b994a8a5e086460bb212abc5a8bc46951bf4a9a1210745953622eb9"}, ] -pathspec = [] +pathspec = [ + {file = "pathspec-0.9.0-py2.py3-none-any.whl", hash = "sha256:7d15c4ddb0b5c802d161efc417ec1a2558ea2653c2e8ad9c19098201dc1c993a"}, + {file = "pathspec-0.9.0.tar.gz", hash = "sha256:e564499435a2673d586f6b2130bb5b95f04a3ba06f81b8f895b651a3c76aabb1"}, +] pkgsettings = [ {file = "pkgsettings-0.12.1-py3-none-any.whl", hash = "sha256:bac409ee7e35b8b3e40fc029e346e266bbd4b007b42482b2ec388d1fe7e717c9"}, {file = "pkgsettings-0.12.1.tar.gz", hash = "sha256:71f25cc85109e96a20e6119fac7ddc78a22c6d858166e3662f95eb11d3e366f3"}, ] -platformdirs = [] +platformdirs = [ + {file = "platformdirs-2.5.2-py3-none-any.whl", hash = "sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788"}, + {file = "platformdirs-2.5.2.tar.gz", hash = "sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19"}, +] pluggy = [ {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, ] -prometheus-client = [] +prometheus-client = [ + {file = "prometheus_client-0.12.0-py2.py3-none-any.whl", hash = "sha256:317453ebabff0a1b02df7f708efbab21e3489e7072b61cb6957230dd004a0af0"}, + {file = "prometheus_client-0.12.0.tar.gz", hash = "sha256:1b12ba48cee33b9b0b9de64a1047cbd3c5f2d0ab6ebcead7ddda613a750ec3c5"}, +] prompt-toolkit = [ - {file = "prompt_toolkit-3.0.29-py3-none-any.whl", hash = "sha256:62291dad495e665fca0bda814e342c69952086afb0f4094d0893d357e5c78752"}, - {file = "prompt_toolkit-3.0.29.tar.gz", hash = "sha256:bd640f60e8cecd74f0dc249713d433ace2ddc62b65ee07f96d358e0b152b6ea7"}, + {file = "prompt_toolkit-3.0.30-py3-none-any.whl", hash = "sha256:d8916d3f62a7b67ab353a952ce4ced6a1d2587dfe9ef8ebc30dd7c386751f289"}, + {file = "prompt_toolkit-3.0.30.tar.gz", hash = "sha256:859b283c50bde45f5f97829f77a4674d1c1fcd88539364f1b28a37805cfd89c0"}, ] py = [ {file = "py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"}, {file = "py-1.11.0.tar.gz", hash = "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"}, ] pycodestyle = [ - {file = "pycodestyle-2.7.0-py2.py3-none-any.whl", hash = "sha256:514f76d918fcc0b55c6680472f0a37970994e07bbb80725808c17089be302068"}, - {file = "pycodestyle-2.7.0.tar.gz", hash = "sha256:c389c1d06bf7904078ca03399a4816f974a1d590090fecea0c63ec26ebaf1cef"}, + {file = "pycodestyle-2.8.0-py2.py3-none-any.whl", hash = "sha256:720f8b39dde8b293825e7ff02c475f3077124006db4f440dcbc9a20b76548a20"}, + {file = "pycodestyle-2.8.0.tar.gz", hash = "sha256:eddd5847ef438ea1c7870ca7eb78a9d47ce0cdb4851a5523949f2601d0cbbe7f"}, ] pydantic = [ {file = "pydantic-1.9.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c8098a724c2784bf03e8070993f6d46aa2eeca031f8d8a048dff277703e6e193"}, @@ -1151,14 +1180,17 @@ pydantic = [ {file = "pydantic-1.9.1.tar.gz", hash = "sha256:1ed987c3ff29fff7fd8c3ea3a3ea877ad310aae2ef9889a119e22d3f2db0691a"}, ] pyflakes = [ - {file = "pyflakes-2.3.1-py2.py3-none-any.whl", hash = "sha256:7893783d01b8a89811dd72d7dfd4d84ff098e5eed95cfa8905b22bbffe52efc3"}, - {file = "pyflakes-2.3.1.tar.gz", hash = "sha256:f5bc8ecabc05bb9d291eb5203d6810b49040f6ff446a756326104746cc00c1db"}, + {file = "pyflakes-2.4.0-py2.py3-none-any.whl", hash = "sha256:3bb3a3f256f4b7968c9c788781e4ff07dce46bdf12339dcda61053375426ee2e"}, + {file = "pyflakes-2.4.0.tar.gz", hash = "sha256:05a85c2872edf37a4ed30b0cce2f6093e1d0581f8c19d7393122da7e25b2b24c"}, ] pygments = [ {file = "Pygments-2.12.0-py3-none-any.whl", hash = "sha256:dc9c10fb40944260f6ed4c688ece0cd2048414940f1cea51b8b226318411c519"}, {file = "Pygments-2.12.0.tar.gz", hash = "sha256:5eb116118f9612ff1ee89ac96437bb6b49e8f04d8a13b514ba26f620208e26eb"}, ] -pymdown-extensions = [] +pymdown-extensions = [ + {file = "pymdown_extensions-9.5-py3-none-any.whl", hash = "sha256:ec141c0f4983755349f0c8710416348d1a13753976c028186ed14f190c8061c4"}, + {file = "pymdown_extensions-9.5.tar.gz", hash = "sha256:3ef2d998c0d5fa7eb09291926d90d69391283561cf6306f85cd588a5eb5befa0"}, +] pyparsing = [ {file = "pyparsing-3.0.9-py3-none-any.whl", hash = "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"}, {file = "pyparsing-3.0.9.tar.gz", hash = "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"}, @@ -1176,10 +1208,7 @@ pytest-cov = [ {file = "pytest-cov-2.12.1.tar.gz", hash = "sha256:261ceeb8c227b726249b376b8526b600f38667ee314f910353fa318caa01f4d7"}, {file = "pytest_cov-2.12.1-py2.py3-none-any.whl", hash = "sha256:261bb9e47e65bd099c89c3edf92972865210c36813f80ede5277dceb77a4a62a"}, ] -pytest-httpserver = [ - {file = "pytest_httpserver-0.3.8-py3-none-any.whl", hash = "sha256:8588edd98a7cec8b5fb481ad1180df0e928648816213c242974a318842d0befe"}, - {file = "pytest_httpserver-0.3.8.tar.gz", hash = "sha256:d896a6556e426240837891b0552040ed4148e393ddf63f675b60d47bcd2d3f39"}, -] +pytest-httpserver = [] python-dateutil = [ {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, @@ -1232,11 +1261,11 @@ sniffio = [ {file = "sniffio-1.2.0-py3-none-any.whl", hash = "sha256:471b71698eac1c2112a40ce2752bb2f4a4814c22a54a3eed3676bc0f5ca9f663"}, {file = "sniffio-1.2.0.tar.gz", hash = "sha256:c4666eecec1d3f50960c6bdf61ab7bc350648da6c126e3cf6898d8cd4ddcd3de"}, ] -starlette = [ - {file = "starlette-0.17.1-py3-none-any.whl", hash = "sha256:26a18cbda5e6b651c964c12c88b36d9898481cd428ed6e063f5f29c418f73050"}, - {file = "starlette-0.17.1.tar.gz", hash = "sha256:57eab3cc975a28af62f6faec94d355a410634940f10b30d68d31cb5ec1b44ae8"}, +starlette = [] +starlette-prometheus = [ + {file = "starlette-prometheus-0.9.0.tar.gz", hash = "sha256:a52fb0f1df52b44a7a677a792759337ef0ce0d59ddf3e684a7d6459a93a90e99"}, + {file = "starlette_prometheus-0.9.0-py3-none-any.whl", hash = "sha256:b4702e4ec67dce508d28551db0e45f12f58411afdb5d1078c92ff74331915381"}, ] -starlette-prometheus = [] termcolor = [ {file = "termcolor-1.1.0.tar.gz", hash = "sha256:1d6d69ce66211143803fbc56652b41d73b4a400a2891d7bf7a1cdf4c02de613b"}, ] @@ -1244,20 +1273,14 @@ toml = [ {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, ] -tomli = [] -tomlkit = [ - {file = "tomlkit-0.11.0-py3-none-any.whl", hash = "sha256:0f4050db66fd445b885778900ce4dd9aea8c90c4721141fde0d6ade893820ef1"}, - {file = "tomlkit-0.11.0.tar.gz", hash = "sha256:71ceb10c0eefd8b8f11fe34e8a51ad07812cb1dc3de23247425fbc9ddc47b9dd"}, -] -typing-extensions = [ - {file = "typing_extensions-4.2.0-py3-none-any.whl", hash = "sha256:6657594ee297170d19f67d55c05852a874e7eb634f4f753dbd667855e07c1708"}, - {file = "typing_extensions-4.2.0.tar.gz", hash = "sha256:f1c24655a0da0d1b67f07e17a5e6b2a105894e6824b92096378bb3668ef02376"}, +tomli = [ + {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, + {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] +tomlkit = [] +typing-extensions = [] urllib3 = [] -uvicorn = [ - {file = "uvicorn-0.17.6-py3-none-any.whl", hash = "sha256:19e2a0e96c9ac5581c01eb1a79a7d2f72bb479691acd2b8921fce48ed5b961a6"}, - {file = "uvicorn-0.17.6.tar.gz", hash = "sha256:5180f9d059611747d841a4a4c4ab675edf54c8489e97f96d0583ee90ac3bfc23"}, -] +uvicorn = [] watchdog = [ {file = "watchdog-2.1.9-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a735a990a1095f75ca4f36ea2ef2752c99e6ee997c46b0de507ba40a09bf7330"}, {file = "watchdog-2.1.9-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6b17d302850c8d412784d9246cfe8d7e3af6bcd45f958abb2d08a6f8bedf695d"}, @@ -1289,11 +1312,5 @@ wcwidth = [ {file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"}, {file = "wcwidth-0.2.5.tar.gz", hash = "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"}, ] -werkzeug = [ - {file = "Werkzeug-2.1.2-py3-none-any.whl", hash = "sha256:72a4b735692dd3135217911cbeaa1be5fa3f62bffb8745c5215420a03dc55255"}, - {file = "Werkzeug-2.1.2.tar.gz", hash = "sha256:1ce08e8093ed67d638d63879fd1ba3735817f7a80de3674d293f5984f25fb6e6"}, -] -zipp = [ - {file = "zipp-3.8.0-py3-none-any.whl", hash = "sha256:c4f6e5bbf48e74f7a38e7cc5b0480ff42b0ae5178957d564d18932525d5cf099"}, - {file = "zipp-3.8.0.tar.gz", hash = "sha256:56bf8aadb83c24db6c4b577e13de374ccfb67da2078beba1d037c17980bf43ad"}, -] +werkzeug = [] +zipp = [] diff --git a/pyproject.toml b/pyproject.toml index 36700cf9..9ffcaf6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ description = "Build simple kafka streams applications" authors = ["Marcos Schroh "] license = "Apache-2.0" readme = "README.md" -keywords = ["stream", "kafka", "event streaming"] +keywords = ["stream", "processing", "kafka", "event streaming"] classifiers = [ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", @@ -29,10 +29,10 @@ pydantic = "^1.9.0" [tool.poetry.dev-dependencies] pytest = "^6.1" +mypy = "^0.961" isort = "^5.7.0" pytest-httpserver = "<1.0" pytest-cov = "^2.11.1" -flake8 = "^3.8.4" jedi = "0.17.2" mkdocs = "^1.1.2" uvicorn = "<1.0" @@ -43,6 +43,7 @@ mkdocs-material = "^8.3.9" starlette-prometheus = "^0.9.0" codecov = "^2.1.12" black = "^22.6.0" +flake8 = "^4.0.1" [build-system] requires = ["poetry-core>=1.0.0"] @@ -65,16 +66,8 @@ exclude = ''' ''' [tool.isort] -line_length=88 -combine_as_imports = true -multi_line_output=3 -indent=' ' -force_alphabetical_sort='true' -force_to_top='true' -default_section = "THIRDPARTY" -sections = ["STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] -from_first = false -include_trailing_comma = true +profile = "black" +known_first_party = ["kstreams", "tests", "examples"] [tool.commitizen] version = "0.2.2" @@ -83,3 +76,7 @@ version_files = [ "pyproject.toml:version", ] update_changelog_on_bump = true + +[tool.pytest.ini_options] +timeout = 300 +log_level = "DEBUG" diff --git a/scripts/lint b/scripts/format similarity index 100% rename from scripts/lint rename to scripts/format diff --git a/scripts/test b/scripts/test index 035c6bef..85e51bd5 100755 --- a/scripts/test +++ b/scripts/test @@ -9,4 +9,8 @@ export PYTHONPATH=kstreams ${PREFIX}pytest -x --cov-report term-missing --cov-report=xml:coverage.xml --cov=kstreams ${1-"./tests"} ${PREFIX}black kstreams tests --check --diff -${PREFIX}flake8 kstreams/ tests/ \ No newline at end of file +${PREFIX}flake8 kstreams/ tests/ +${PREFIX}isort --check-only kstreams tests + +# TODO: Fix mypy warnings and then enable in CI +# ${PREFIX}mypy kstreams/ diff --git a/setup.cfg b/setup.cfg index 11dd4b60..a7a91432 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,11 +1,3 @@ -[tool:pytest] -timeout = 300 -log_level=DEBUG - -[bdist_wheel] -universal = 1 - [flake8] -exclude = .git,__pycache__,docs/source/build,dist,.venv,venv,lib,*.egg-info,.tox max-line-length = 88 ignore=E231 diff --git a/tests/conftest.py b/tests/conftest.py index 9e40f142..33617210 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,12 +1,13 @@ +import asyncio from collections import namedtuple from dataclasses import field -from kstreams import clients, conf, create_engine -from pytest_httpserver import HTTPServer from typing import Any, Dict, List, NamedTuple, Optional, Sequence, Tuple -import asyncio import pytest import pytest_asyncio +from pytest_httpserver import HTTPServer + +from kstreams import clients, conf, create_engine class RecordMetadata(NamedTuple): diff --git a/tests/test_client.py b/tests/test_client.py index eafc060a..86c671bd 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1,12 +1,13 @@ +from unittest.mock import Mock, patch + +import pytest + from kstreams.test_utils import ( TestConsumer, TestProducer, TestStreamClient, TopicManager, ) -from unittest.mock import Mock, patch - -import pytest @pytest.mark.asyncio diff --git a/tests/test_consumer.py b/tests/test_consumer.py index f26bed70..7b01e060 100644 --- a/tests/test_consumer.py +++ b/tests/test_consumer.py @@ -1,9 +1,10 @@ -from kstreams.clients import Consumer -from kstreams.conf import settings from unittest import mock import pytest +from kstreams.clients import Consumer +from kstreams.conf import settings + @pytest.mark.asyncio async def test_consumer(): diff --git a/tests/test_kstreams.py b/tests/test_kstreams.py index c4b106ad..4b88f9a1 100644 --- a/tests/test_kstreams.py +++ b/tests/test_kstreams.py @@ -1,12 +1,12 @@ +import pytest + from kstreams.utils import ( - create_ssl_context_from_pkgsettings, EmptySSLDataException, IncorrectCertificateFormat, + create_ssl_context_from_pkgsettings, settings, ) -import pytest - settings_prefix = "TEST_" diff --git a/tests/test_monitor.py b/tests/test_monitor.py index 371df903..74900c4e 100644 --- a/tests/test_monitor.py +++ b/tests/test_monitor.py @@ -1,8 +1,8 @@ +import pytest + from kstreams.prometheus import monitor, tasks from kstreams.streams import Stream -import pytest - @pytest.mark.asyncio async def test_consumer_metrics(mock_consumer_class): diff --git a/tests/test_producer.py b/tests/test_producer.py index 26b99001..ec29dc40 100644 --- a/tests/test_producer.py +++ b/tests/test_producer.py @@ -1,9 +1,10 @@ -from kstreams.clients import Producer -from kstreams.conf import settings from unittest.mock import patch import pytest +from kstreams.clients import Producer +from kstreams.conf import settings + @pytest.mark.asyncio async def test_producer(): diff --git a/tests/test_serialization.py b/tests/test_serialization.py index 8d8a2247..8c4c560a 100644 --- a/tests/test_serialization.py +++ b/tests/test_serialization.py @@ -1,15 +1,16 @@ -from kstreams import consts, StreamEngine -from kstreams.clients import aiokafka, Producer -from kstreams.custom_types import Headers -from kstreams.streams import Stream -from kstreams.test_utils.test_utils import TestStreamClient -from kstreams.utils import encode_headers +import json from typing import Any, Dict, Optional from unittest import mock -import json import pytest +from kstreams import StreamEngine, consts +from kstreams.clients import Producer, aiokafka +from kstreams.custom_types import Headers +from kstreams.streams import Stream +from kstreams.test_utils.test_utils import TestStreamClient +from kstreams.utils import encode_headers + class MySerializer: async def serialize( diff --git a/tests/test_stream_engine.py b/tests/test_stream_engine.py index 7d77d5ed..308625f9 100644 --- a/tests/test_stream_engine.py +++ b/tests/test_stream_engine.py @@ -1,10 +1,11 @@ +from unittest import mock + +import pytest + from kstreams.clients import Consumer, Producer from kstreams.conf import settings from kstreams.engine import StreamEngine from kstreams.exceptions import DuplicateStreamException -from unittest import mock - -import pytest settings.configure(KAFKA_CONFIG_BOOTSTRAP_SERVERS=["localhost:9092"])