diff --git a/pdm.lock b/pdm.lock index 3dec2506..c3c856e4 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "bandit", "cbor", "dev", "doc", "encryption", "flake8", "format", "msgpack", "mypy", "sniffio", "test", "tox", "uvloop"] strategy = ["cross_platform"] lock_version = "4.4" -content_hash = "sha256:3806cef7d62cd3aae5bbd6e15325c21fc0594b400a8ec7bc17b07eee4f7cdd61" +content_hash = "sha256:e8579f5960f341434c968d20ffe8d424c5f273a4d1d8492f6a9db3c525291722" [[package]] name = "alabaster" @@ -977,7 +977,7 @@ files = [ [[package]] name = "mypy" -version = "1.6.1" +version = "1.7.0" requires_python = ">=3.8" summary = "Optional static typing for Python" dependencies = [ @@ -985,18 +985,18 @@ dependencies = [ "typing-extensions>=4.1.0", ] files = [ - {file = "mypy-1.6.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:81af8adaa5e3099469e7623436881eff6b3b06db5ef75e6f5b6d4871263547e5"}, - {file = "mypy-1.6.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8c223fa57cb154c7eab5156856c231c3f5eace1e0bed9b32a24696b7ba3c3245"}, - {file = "mypy-1.6.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8032e00ce71c3ceb93eeba63963b864bf635a18f6c0c12da6c13c450eedb183"}, - {file = "mypy-1.6.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:4c46b51de523817a0045b150ed11b56f9fff55f12b9edd0f3ed35b15a2809de0"}, - {file = "mypy-1.6.1-cp311-cp311-win_amd64.whl", hash = "sha256:19f905bcfd9e167159b3d63ecd8cb5e696151c3e59a1742e79bc3bcb540c42c7"}, - {file = "mypy-1.6.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:82e469518d3e9a321912955cc702d418773a2fd1e91c651280a1bda10622f02f"}, - {file = "mypy-1.6.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d4473c22cc296425bbbce7e9429588e76e05bc7342da359d6520b6427bf76660"}, - {file = "mypy-1.6.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:59a0d7d24dfb26729e0a068639a6ce3500e31d6655df8557156c51c1cb874ce7"}, - {file = "mypy-1.6.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:cfd13d47b29ed3bbaafaff7d8b21e90d827631afda134836962011acb5904b71"}, - {file = "mypy-1.6.1-cp312-cp312-win_amd64.whl", hash = "sha256:eb4f18589d196a4cbe5290b435d135dee96567e07c2b2d43b5c4621b6501531a"}, - {file = "mypy-1.6.1-py3-none-any.whl", hash = "sha256:4cbe68ef919c28ea561165206a2dcb68591c50f3bcf777932323bc208d949cf1"}, - {file = "mypy-1.6.1.tar.gz", hash = "sha256:4d01c00d09a0be62a4ca3f933e315455bde83f37f892ba4b08ce92f3cf44bcc1"}, + {file = "mypy-1.7.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:df67fbeb666ee8828f675fee724cc2cbd2e4828cc3df56703e02fe6a421b7401"}, + {file = "mypy-1.7.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a79cdc12a02eb526d808a32a934c6fe6df07b05f3573d210e41808020aed8b5d"}, + {file = "mypy-1.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f65f385a6f43211effe8c682e8ec3f55d79391f70a201575def73d08db68ead1"}, + {file = "mypy-1.7.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:0e81ffd120ee24959b449b647c4b2fbfcf8acf3465e082b8d58fd6c4c2b27e46"}, + {file = "mypy-1.7.0-cp311-cp311-win_amd64.whl", hash = "sha256:f29386804c3577c83d76520abf18cfcd7d68264c7e431c5907d250ab502658ee"}, + {file = "mypy-1.7.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:87c076c174e2c7ef8ab416c4e252d94c08cd4980a10967754f91571070bf5fbe"}, + {file = "mypy-1.7.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6cb8d5f6d0fcd9e708bb190b224089e45902cacef6f6915481806b0c77f7786d"}, + {file = "mypy-1.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d93e76c2256aa50d9c82a88e2f569232e9862c9982095f6d54e13509f01222fc"}, + {file = "mypy-1.7.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:cddee95dea7990e2215576fae95f6b78a8c12f4c089d7e4367564704e99118d3"}, + {file = "mypy-1.7.0-cp312-cp312-win_amd64.whl", hash = "sha256:d01921dbd691c4061a3e2ecdbfbfad029410c5c2b1ee88946bf45c62c6c91210"}, + {file = "mypy-1.7.0-py3-none-any.whl", hash = "sha256:96650d9a4c651bc2a4991cf46f100973f656d69edc7faf91844e87fe627f7e96"}, + {file = "mypy-1.7.0.tar.gz", hash = "sha256:1e280b5697202efa698372d2f39e9a6713a0395a756b1c6bd48995f8d72690dc"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index 169bcc91..fa5d70e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,7 +82,7 @@ format = [ "black>=22.6.0", ] mypy = [ - "mypy~=1.6.0", + "mypy~=1.7.0", "types-cryptography>=3.3.23.2", "msgpack-types>=0.2.0", ] diff --git a/src/easynetwork/api_async/server/tcp.py b/src/easynetwork/api_async/server/tcp.py index d11acc07..c3427677 100644 --- a/src/easynetwork/api_async/server/tcp.py +++ b/src/easynetwork/api_async/server/tcp.py @@ -189,7 +189,7 @@ def _value_or_default(value: float | None, default: float) -> float: self.__is_shutdown.set() self.__shutdown_asked: bool = False self.__max_recv_size: int = max_recv_size - self.__servers_tasks: deque[Task[NoReturn]] = deque() # type: ignore[assignment] + self.__servers_tasks: deque[Task[NoReturn]] = deque() self.__mainloop_task: Task[NoReturn] | None = None self.__logger: logging.Logger = logger or logging.getLogger(__name__) self.__client_connection_log_level: int @@ -534,7 +534,7 @@ def __check_closed(self) -> None: @property def extra_attributes(self) -> Mapping[Any, Callable[[], Any]]: client = self.__client - return client.extra_attributes | { + return dict(client.extra_attributes) | { INETClientAttribute.socket: lambda: self.__proxy, INETClientAttribute.local_address: lambda: new_socket_address( client.extra(INETSocketAttribute.sockname), diff --git a/src/easynetwork/api_async/server/udp.py b/src/easynetwork/api_async/server/udp.py index 5bb6c805..2b201429 100644 --- a/src/easynetwork/api_async/server/udp.py +++ b/src/easynetwork/api_async/server/udp.py @@ -119,7 +119,7 @@ def __init__( self.__is_shutdown: IEvent = self.__backend.create_event() self.__is_shutdown.set() self.__shutdown_asked: bool = False - self.__servers_tasks: deque[Task[NoReturn]] = deque() # type: ignore[assignment] + self.__servers_tasks: deque[Task[NoReturn]] = deque() self.__mainloop_task: Task[NoReturn] | None = None self.__logger: logging.Logger = logger or logging.getLogger(__name__) self.__clients_cache: defaultdict[ @@ -409,7 +409,7 @@ def extra_attributes(self) -> Mapping[Any, Callable[[], Any]]: return {} server = server_ref del server_ref - return server.extra_attributes | { + return dict(server.extra_attributes) | { INETClientAttribute.socket: lambda: self.__socket_proxy, INETClientAttribute.local_address: lambda: new_socket_address( server.extra(INETSocketAttribute.sockname), diff --git a/tox.ini b/tox.ini index 12e186cb..bb9ce62d 100644 --- a/tox.ini +++ b/tox.ini @@ -141,7 +141,7 @@ allowlist_externals = setenv = {[base]setenv} MYPY_CACHE_DIR = {envtmpdir}{/}.mypy_cache - MYPY_OPTS = --config-file {toxinidir}{/}pyproject.toml --new-type-inference + MYPY_OPTS = --config-file {toxinidir}{/}pyproject.toml commands_pre = {[pdm]sync} --prod --group=":all" {[pdm]sync} --dev --group=mypy