From 66faffec19df51e74369e00c8ad3d9a859bbfdbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20=C5=81ukawski?= Date: Sun, 15 Nov 2026 14:08:57 +0000 Subject: [PATCH 01/11] Move the package to a src layout and the tests to a top-level tests directory. --- .github/workflows/ci.yml | 12 ++++++------ pyproject.toml | 3 +-- setup.cfg | 5 +---- {mediator => src/mediator}/__init__.py | 0 {mediator => src/mediator}/common/__init__.py | 0 .../mediator}/common/factory/__init__.py | 0 {mediator => src/mediator}/common/factory/base.py | 0 {mediator => src/mediator}/common/factory/cascade.py | 0 .../mediator}/common/factory/factories.py | 0 {mediator => src/mediator}/common/factory/mappers.py | 0 .../mediator}/common/factory/policies.py | 0 {mediator => src/mediator}/common/factory/utils.py | 0 .../mediator}/common/handler/__init__.py | 0 {mediator => src/mediator}/common/handler/base.py | 0 .../mediator}/common/handler/handlers.py | 0 {mediator => src/mediator}/common/modifiers.py | 0 .../mediator}/common/registry/__init__.py | 0 {mediator => src/mediator}/common/registry/base.py | 0 .../mediator}/common/registry/registry.py | 0 {mediator => src/mediator}/common/registry/stores.py | 0 {mediator => src/mediator}/common/types.py | 0 {mediator => src/mediator}/event/__init__.py | 0 {mediator => src/mediator}/event/aggregate.py | 0 {mediator => src/mediator}/event/base.py | 0 {mediator => src/mediator}/event/local.py | 0 {mediator => src/mediator}/event/registry.py | 0 {mediator => src/mediator}/request/__init__.py | 0 {mediator => src/mediator}/request/base.py | 0 {mediator => src/mediator}/request/local.py | 0 {mediator => src/mediator}/request/registry.py | 0 .../factory/test => src/mediator/utils}/__init__.py | 0 {mediator => src/mediator}/utils/context.py | 0 {mediator => src/mediator}/utils/inspection.py | 0 {mediator/common/handler/test => tests}/__init__.py | 0 .../registry/test => tests/common}/__init__.py | 0 .../common/test => tests/common/factory}/__init__.py | 0 .../test => tests/common/factory}/test_cascade.py | 0 .../test => tests/common/factory}/test_factories.py | 0 .../test => tests/common/factory}/test_mappers.py | 0 .../test => tests/common/factory}/test_policies.py | 0 .../test => tests/common/factory}/test_utils.py | 0 .../event/test => tests/common/handler}/__init__.py | 0 .../test => tests/common/handler}/test_handlers.py | 0 .../test => tests/common/registry}/__init__.py | 0 .../test => tests/common/registry}/conftest.py | 0 .../test => tests/common/registry}/test_base.py | 4 ++-- .../common/registry}/test_registry_registry.py | 2 +- .../common/registry}/test_registry_stores.py | 4 ++-- .../common/test => tests/common}/test_modifiers.py | 0 {mediator/utils => tests/event}/__init__.py | 0 .../event/test => tests/event}/test_aggregate.py | 0 {mediator/event/test => tests/event}/test_local.py | 0 {mediator/utils/test => tests/request}/__init__.py | 0 .../request/test => tests/request}/test_request.py | 2 +- tests/utils/__init__.py | 0 .../utils/test => tests/utils}/test_inspection.py | 0 56 files changed, 14 insertions(+), 18 deletions(-) rename {mediator => src/mediator}/__init__.py (100%) rename {mediator => src/mediator}/common/__init__.py (100%) rename {mediator => src/mediator}/common/factory/__init__.py (100%) rename {mediator => src/mediator}/common/factory/base.py (100%) rename {mediator => src/mediator}/common/factory/cascade.py (100%) rename {mediator => src/mediator}/common/factory/factories.py (100%) rename {mediator => src/mediator}/common/factory/mappers.py (100%) rename {mediator => src/mediator}/common/factory/policies.py (100%) rename {mediator => src/mediator}/common/factory/utils.py (100%) rename {mediator => src/mediator}/common/handler/__init__.py (100%) rename {mediator => src/mediator}/common/handler/base.py (100%) rename {mediator => src/mediator}/common/handler/handlers.py (100%) rename {mediator => src/mediator}/common/modifiers.py (100%) rename {mediator => src/mediator}/common/registry/__init__.py (100%) rename {mediator => src/mediator}/common/registry/base.py (100%) rename {mediator => src/mediator}/common/registry/registry.py (100%) rename {mediator => src/mediator}/common/registry/stores.py (100%) rename {mediator => src/mediator}/common/types.py (100%) rename {mediator => src/mediator}/event/__init__.py (100%) rename {mediator => src/mediator}/event/aggregate.py (100%) rename {mediator => src/mediator}/event/base.py (100%) rename {mediator => src/mediator}/event/local.py (100%) rename {mediator => src/mediator}/event/registry.py (100%) rename {mediator => src/mediator}/request/__init__.py (100%) rename {mediator => src/mediator}/request/base.py (100%) rename {mediator => src/mediator}/request/local.py (100%) rename {mediator => src/mediator}/request/registry.py (100%) rename {mediator/common/factory/test => src/mediator/utils}/__init__.py (100%) rename {mediator => src/mediator}/utils/context.py (100%) rename {mediator => src/mediator}/utils/inspection.py (100%) rename {mediator/common/handler/test => tests}/__init__.py (100%) rename {mediator/common/registry/test => tests/common}/__init__.py (100%) rename {mediator/common/test => tests/common/factory}/__init__.py (100%) rename {mediator/common/factory/test => tests/common/factory}/test_cascade.py (100%) rename {mediator/common/factory/test => tests/common/factory}/test_factories.py (100%) rename {mediator/common/factory/test => tests/common/factory}/test_mappers.py (100%) rename {mediator/common/factory/test => tests/common/factory}/test_policies.py (100%) rename {mediator/common/factory/test => tests/common/factory}/test_utils.py (100%) rename {mediator/event/test => tests/common/handler}/__init__.py (100%) rename {mediator/common/handler/test => tests/common/handler}/test_handlers.py (100%) rename {mediator/request/test => tests/common/registry}/__init__.py (100%) rename {mediator/common/registry/test => tests/common/registry}/conftest.py (100%) rename {mediator/common/registry/test => tests/common/registry}/test_base.py (91%) rename {mediator/common/registry/test => tests/common/registry}/test_registry_registry.py (97%) rename {mediator/common/registry/test => tests/common/registry}/test_registry_stores.py (95%) rename {mediator/common/test => tests/common}/test_modifiers.py (100%) rename {mediator/utils => tests/event}/__init__.py (100%) rename {mediator/event/test => tests/event}/test_aggregate.py (100%) rename {mediator/event/test => tests/event}/test_local.py (100%) rename {mediator/utils/test => tests/request}/__init__.py (100%) rename {mediator/request/test => tests/request}/test_request.py (94%) create mode 100644 tests/utils/__init__.py rename {mediator/utils/test => tests/utils}/test_inspection.py (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19a3f74..d3be32b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,10 +33,10 @@ jobs: #---------------------------------------------- - run: python -m pip install black flake8 isort mypy pytest - run: | - flake8 mediator/ example/ - black mediator/ example/ --check - isort mediator/ example/ --check - mypy mediator/ example/ + flake8 src/ tests/ example/ + black src/ tests/ example/ --check + isort src/ tests/ example/ --check + mypy src/ tests/ example/ tests: needs: [lints] @@ -47,7 +47,7 @@ jobs: matrix: python-version: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.7'] env: - PYTHONPATH: . + PYTHONPATH: src PYTHON: ${{ matrix.python-version }} steps: @@ -78,7 +78,7 @@ jobs: - name: Run tests run: | source .venv/bin/activate - pytest mediator/ example/ --cov + pytest tests/ example/ --cov env: COVERAGE_FILE: coverage/.coverage.py${{ matrix.python-version }} #---------------------------------------------- diff --git a/pyproject.toml b/pyproject.toml index 91c4906..8b89c56 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,9 +5,8 @@ description = "Python mediator bus microframework for CQRS + ES" authors = ["Damian Łukawski "] license = "MIT" packages = [ - { include = "mediator" }, + { include = "mediator", from = "src" }, ] -exclude = ["**/test/*"] readme = "README.md" homepage = "https://github.com/dlski/python-mediator" repository = "https://github.com/dlski/python-mediator" diff --git a/setup.cfg b/setup.cfg index 2b72576..a48ec05 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,10 +3,7 @@ max-line-length = 88 exclude = .venv/* [coverage:run] -include = mediator/* -omit = - */test_* - */test/* +source = mediator [coverage:report] precision = 2 diff --git a/mediator/__init__.py b/src/mediator/__init__.py similarity index 100% rename from mediator/__init__.py rename to src/mediator/__init__.py diff --git a/mediator/common/__init__.py b/src/mediator/common/__init__.py similarity index 100% rename from mediator/common/__init__.py rename to src/mediator/common/__init__.py diff --git a/mediator/common/factory/__init__.py b/src/mediator/common/factory/__init__.py similarity index 100% rename from mediator/common/factory/__init__.py rename to src/mediator/common/factory/__init__.py diff --git a/mediator/common/factory/base.py b/src/mediator/common/factory/base.py similarity index 100% rename from mediator/common/factory/base.py rename to src/mediator/common/factory/base.py diff --git a/mediator/common/factory/cascade.py b/src/mediator/common/factory/cascade.py similarity index 100% rename from mediator/common/factory/cascade.py rename to src/mediator/common/factory/cascade.py diff --git a/mediator/common/factory/factories.py b/src/mediator/common/factory/factories.py similarity index 100% rename from mediator/common/factory/factories.py rename to src/mediator/common/factory/factories.py diff --git a/mediator/common/factory/mappers.py b/src/mediator/common/factory/mappers.py similarity index 100% rename from mediator/common/factory/mappers.py rename to src/mediator/common/factory/mappers.py diff --git a/mediator/common/factory/policies.py b/src/mediator/common/factory/policies.py similarity index 100% rename from mediator/common/factory/policies.py rename to src/mediator/common/factory/policies.py diff --git a/mediator/common/factory/utils.py b/src/mediator/common/factory/utils.py similarity index 100% rename from mediator/common/factory/utils.py rename to src/mediator/common/factory/utils.py diff --git a/mediator/common/handler/__init__.py b/src/mediator/common/handler/__init__.py similarity index 100% rename from mediator/common/handler/__init__.py rename to src/mediator/common/handler/__init__.py diff --git a/mediator/common/handler/base.py b/src/mediator/common/handler/base.py similarity index 100% rename from mediator/common/handler/base.py rename to src/mediator/common/handler/base.py diff --git a/mediator/common/handler/handlers.py b/src/mediator/common/handler/handlers.py similarity index 100% rename from mediator/common/handler/handlers.py rename to src/mediator/common/handler/handlers.py diff --git a/mediator/common/modifiers.py b/src/mediator/common/modifiers.py similarity index 100% rename from mediator/common/modifiers.py rename to src/mediator/common/modifiers.py diff --git a/mediator/common/registry/__init__.py b/src/mediator/common/registry/__init__.py similarity index 100% rename from mediator/common/registry/__init__.py rename to src/mediator/common/registry/__init__.py diff --git a/mediator/common/registry/base.py b/src/mediator/common/registry/base.py similarity index 100% rename from mediator/common/registry/base.py rename to src/mediator/common/registry/base.py diff --git a/mediator/common/registry/registry.py b/src/mediator/common/registry/registry.py similarity index 100% rename from mediator/common/registry/registry.py rename to src/mediator/common/registry/registry.py diff --git a/mediator/common/registry/stores.py b/src/mediator/common/registry/stores.py similarity index 100% rename from mediator/common/registry/stores.py rename to src/mediator/common/registry/stores.py diff --git a/mediator/common/types.py b/src/mediator/common/types.py similarity index 100% rename from mediator/common/types.py rename to src/mediator/common/types.py diff --git a/mediator/event/__init__.py b/src/mediator/event/__init__.py similarity index 100% rename from mediator/event/__init__.py rename to src/mediator/event/__init__.py diff --git a/mediator/event/aggregate.py b/src/mediator/event/aggregate.py similarity index 100% rename from mediator/event/aggregate.py rename to src/mediator/event/aggregate.py diff --git a/mediator/event/base.py b/src/mediator/event/base.py similarity index 100% rename from mediator/event/base.py rename to src/mediator/event/base.py diff --git a/mediator/event/local.py b/src/mediator/event/local.py similarity index 100% rename from mediator/event/local.py rename to src/mediator/event/local.py diff --git a/mediator/event/registry.py b/src/mediator/event/registry.py similarity index 100% rename from mediator/event/registry.py rename to src/mediator/event/registry.py diff --git a/mediator/request/__init__.py b/src/mediator/request/__init__.py similarity index 100% rename from mediator/request/__init__.py rename to src/mediator/request/__init__.py diff --git a/mediator/request/base.py b/src/mediator/request/base.py similarity index 100% rename from mediator/request/base.py rename to src/mediator/request/base.py diff --git a/mediator/request/local.py b/src/mediator/request/local.py similarity index 100% rename from mediator/request/local.py rename to src/mediator/request/local.py diff --git a/mediator/request/registry.py b/src/mediator/request/registry.py similarity index 100% rename from mediator/request/registry.py rename to src/mediator/request/registry.py diff --git a/mediator/common/factory/test/__init__.py b/src/mediator/utils/__init__.py similarity index 100% rename from mediator/common/factory/test/__init__.py rename to src/mediator/utils/__init__.py diff --git a/mediator/utils/context.py b/src/mediator/utils/context.py similarity index 100% rename from mediator/utils/context.py rename to src/mediator/utils/context.py diff --git a/mediator/utils/inspection.py b/src/mediator/utils/inspection.py similarity index 100% rename from mediator/utils/inspection.py rename to src/mediator/utils/inspection.py diff --git a/mediator/common/handler/test/__init__.py b/tests/__init__.py similarity index 100% rename from mediator/common/handler/test/__init__.py rename to tests/__init__.py diff --git a/mediator/common/registry/test/__init__.py b/tests/common/__init__.py similarity index 100% rename from mediator/common/registry/test/__init__.py rename to tests/common/__init__.py diff --git a/mediator/common/test/__init__.py b/tests/common/factory/__init__.py similarity index 100% rename from mediator/common/test/__init__.py rename to tests/common/factory/__init__.py diff --git a/mediator/common/factory/test/test_cascade.py b/tests/common/factory/test_cascade.py similarity index 100% rename from mediator/common/factory/test/test_cascade.py rename to tests/common/factory/test_cascade.py diff --git a/mediator/common/factory/test/test_factories.py b/tests/common/factory/test_factories.py similarity index 100% rename from mediator/common/factory/test/test_factories.py rename to tests/common/factory/test_factories.py diff --git a/mediator/common/factory/test/test_mappers.py b/tests/common/factory/test_mappers.py similarity index 100% rename from mediator/common/factory/test/test_mappers.py rename to tests/common/factory/test_mappers.py diff --git a/mediator/common/factory/test/test_policies.py b/tests/common/factory/test_policies.py similarity index 100% rename from mediator/common/factory/test/test_policies.py rename to tests/common/factory/test_policies.py diff --git a/mediator/common/factory/test/test_utils.py b/tests/common/factory/test_utils.py similarity index 100% rename from mediator/common/factory/test/test_utils.py rename to tests/common/factory/test_utils.py diff --git a/mediator/event/test/__init__.py b/tests/common/handler/__init__.py similarity index 100% rename from mediator/event/test/__init__.py rename to tests/common/handler/__init__.py diff --git a/mediator/common/handler/test/test_handlers.py b/tests/common/handler/test_handlers.py similarity index 100% rename from mediator/common/handler/test/test_handlers.py rename to tests/common/handler/test_handlers.py diff --git a/mediator/request/test/__init__.py b/tests/common/registry/__init__.py similarity index 100% rename from mediator/request/test/__init__.py rename to tests/common/registry/__init__.py diff --git a/mediator/common/registry/test/conftest.py b/tests/common/registry/conftest.py similarity index 100% rename from mediator/common/registry/test/conftest.py rename to tests/common/registry/conftest.py diff --git a/mediator/common/registry/test/test_base.py b/tests/common/registry/test_base.py similarity index 91% rename from mediator/common/registry/test/test_base.py rename to tests/common/registry/test_base.py index a8fd710..90156a6 100644 --- a/mediator/common/registry/test/test_base.py +++ b/tests/common/registry/test_base.py @@ -3,8 +3,8 @@ import pytest from mediator.common.registry import HandlerEntry -from mediator.common.registry.test.conftest import MockupHandler -from mediator.common.test.test_modifiers import MockupModifierFactory +from tests.common.registry.conftest import MockupHandler +from tests.common.test_modifiers import MockupModifierFactory from mediator.common.types import ActionResult, ActionSubject diff --git a/mediator/common/registry/test/test_registry_registry.py b/tests/common/registry/test_registry_registry.py similarity index 97% rename from mediator/common/registry/test/test_registry_registry.py rename to tests/common/registry/test_registry_registry.py index a515bdf..0649f5b 100644 --- a/mediator/common/registry/test/test_registry_registry.py +++ b/tests/common/registry/test_registry_registry.py @@ -12,7 +12,7 @@ ) from mediator.common.modifiers import ModifierFactory from mediator.common.registry import CollectionHandlerStore, HandlerRegistry -from mediator.common.test.test_modifiers import MockupModifierFactory +from tests.common.test_modifiers import MockupModifierFactory from mediator.common.types import ActionSubject diff --git a/mediator/common/registry/test/test_registry_stores.py b/tests/common/registry/test_registry_stores.py similarity index 95% rename from mediator/common/registry/test/test_registry_stores.py rename to tests/common/registry/test_registry_stores.py index 317df2b..dd2de07 100644 --- a/mediator/common/registry/test/test_registry_stores.py +++ b/tests/common/registry/test_registry_stores.py @@ -10,8 +10,8 @@ MappingHandlerStore, ModifierHandlerStore, ) -from mediator.common.registry.test.conftest import MockupHandler -from mediator.common.test.test_modifiers import MockupModifierFactory +from tests.common.registry.conftest import MockupHandler +from tests.common.test_modifiers import MockupModifierFactory from mediator.common.types import ActionSubject diff --git a/mediator/common/test/test_modifiers.py b/tests/common/test_modifiers.py similarity index 100% rename from mediator/common/test/test_modifiers.py rename to tests/common/test_modifiers.py diff --git a/mediator/utils/__init__.py b/tests/event/__init__.py similarity index 100% rename from mediator/utils/__init__.py rename to tests/event/__init__.py diff --git a/mediator/event/test/test_aggregate.py b/tests/event/test_aggregate.py similarity index 100% rename from mediator/event/test/test_aggregate.py rename to tests/event/test_aggregate.py diff --git a/mediator/event/test/test_local.py b/tests/event/test_local.py similarity index 100% rename from mediator/event/test/test_local.py rename to tests/event/test_local.py diff --git a/mediator/utils/test/__init__.py b/tests/request/__init__.py similarity index 100% rename from mediator/utils/test/__init__.py rename to tests/request/__init__.py diff --git a/mediator/request/test/test_request.py b/tests/request/test_request.py similarity index 94% rename from mediator/request/test/test_request.py rename to tests/request/test_request.py index 1da64a0..2ecef74 100644 --- a/mediator/request/test/test_request.py +++ b/tests/request/test_request.py @@ -4,7 +4,7 @@ from mediator.common.factory import CallableHandlerPolicy from mediator.common.registry import LookupHandlerStoreError -from mediator.common.test.test_modifiers import MockupModifierFactory +from tests.common.test_modifiers import MockupModifierFactory from mediator.request import LocalRequestBus, RequestHandlerRegistry diff --git a/tests/utils/__init__.py b/tests/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/mediator/utils/test/test_inspection.py b/tests/utils/test_inspection.py similarity index 100% rename from mediator/utils/test/test_inspection.py rename to tests/utils/test_inspection.py From 1c40caaf14cb8d500ff9d59815185b3fe1120b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20=C5=81ukawski?= Date: Sun, 15 Nov 2026 14:09:18 +0000 Subject: [PATCH 02/11] Replace Poetry with uv and standard project metadata, and raise the minimum Python version to 3.11. --- .gitignore | 6 + pyproject.toml | 67 +++--- setup.cfg | 20 -- uv.lock | 556 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 602 insertions(+), 47 deletions(-) delete mode 100644 setup.cfg create mode 100644 uv.lock diff --git a/.gitignore b/.gitignore index 1f58b79..20466cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ **/__pycache__ .idea/** .pytest_cache/** +.venv/ +dist/ +.coverage* +coverage.xml +.mypy_cache/ +.ruff_cache/ diff --git a/pyproject.toml b/pyproject.toml index 8b89c56..f8646aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,44 +1,57 @@ -[tool.poetry] +[project] name = "python-mediator" version = "0.7.0" description = "Python mediator bus microframework for CQRS + ES" -authors = ["Damian Łukawski "] -license = "MIT" -packages = [ - { include = "mediator", from = "src" }, -] readme = "README.md" -homepage = "https://github.com/dlski/python-mediator" -repository = "https://github.com/dlski/python-mediator" +license = "MIT" +license-files = ["LICENSE"] +authors = [{ name = "Damian Łukawski", email = "damian@lukawscy.pl" }] +requires-python = ">=3.11" keywords = ["mediator", "cqrs", "event-driven", "enterprise"] classifiers = [ "Development Status :: 4 - Beta", + "Framework :: AsyncIO", "Intended Audience :: Developers", "Topic :: Software Development :: Libraries :: Python Modules", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", + "Typing :: Typed", ] +dependencies = [] -[tool.poetry.dependencies] -python = ">=3.7 <3.11" +[project.urls] +Homepage = "https://github.com/dlski/python-mediator" +Repository = "https://github.com/dlski/python-mediator" -[tool.poetry.dev-dependencies] -black = "^20.8b1" -isort = "^5.5.4" -flake8 = "^3.8.3" -flake8-isort = "^4.0.0" -flake8-black = "^0.2.1" -pytest = "^6.1.0" -pytest-cov = "^2.11.1" -pytest-asyncio = "^0.14.0" -importlib_metadata = { version = "^3.7.0", python = "~3.7" } -mypy = "^0.910" +[dependency-groups] +dev = [{ include-group = "lint" }, { include-group = "test" }] +lint = ["mypy>=1.18", "ruff>=0.14"] +test = ["pytest>=8.4", "pytest-asyncio>=1.2", "pytest-cov>=7.0"] [build-system] -requires = ["poetry>=0.12"] -build-backend = "poetry.masonry.api" +requires = ["uv_build>=0.9,<0.12"] +build-backend = "uv_build" + +[tool.uv.build-backend] +module-name = "mediator" + +[tool.pytest.ini_options] +testpaths = ["tests", "example"] +asyncio_mode = "strict" +asyncio_default_fixture_loop_scope = "function" + +[tool.coverage.run] +source = ["mediator"] + +[tool.coverage.report] +precision = 2 +exclude_also = [ + "raise NotImplementedError", + "if TYPE_CHECKING:", + "@overload", +] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index a48ec05..0000000 --- a/setup.cfg +++ /dev/null @@ -1,20 +0,0 @@ -[flake8] -max-line-length = 88 -exclude = .venv/* - -[coverage:run] -source = mediator - -[coverage:report] -precision = 2 -exclude_lines = - pragma: no cover - raise NotImplementedError - raise NotImplemented - if TYPE_CHECKING: - @overload - -[isort] -line_length = 88 -multi_line_output = 3 -include_trailing_comma = True diff --git a/uv.lock b/uv.lock new file mode 100644 index 0000000..8f7f2c2 --- /dev/null +++ b/uv.lock @@ -0,0 +1,556 @@ +version = 1 +revision = 3 +requires-python = ">=3.11" +resolution-markers = [ + "python_full_version >= '3.15'", + "python_full_version < '3.15'", +] + +[[package]] +name = "ast-serialize" +version = "0.13.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/21/d5/5dc1ee8a80c3b20a0b63c61b43ba6bc53517faecd1def47bcd752d22268e/ast_serialize-0.13.1.tar.gz", hash = "sha256:401cc84e8888d4d76f2c8d296fa006ed1a5ff993b6aff90dd777c03973efd025", size = 955137, upload-time = "2026-10-17T00:04:17.183Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f3/a8/fbd136b9f70c59e75f59a8e974c84102976f1201828b4f886480ba956936/ast_serialize-0.13.1-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:3e129d44b0cffbea24a7f40117ce49e30993c3d119e584d4817ebd6f87246456", size = 897306, upload-time = "2026-10-17T00:02:52.479Z" }, + { url = "https://files.pythonhosted.org/packages/50/3f/2ad51e9823a790e7a70fd781e9595ab3abeace27f3aefcaa1939457efd72/ast_serialize-0.13.1-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:523d45bab16ddaf1399c04c4fe81bbf180f81e33c2f7bcbe76be56b0f7311ab4", size = 1236082, upload-time = "2026-10-17T00:02:54.82Z" }, + { url = "https://files.pythonhosted.org/packages/c0/5c/8e959db5cc2237f9d4c560a8e2253c98f9746883fb4774651e4cda458901/ast_serialize-0.13.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:638333fb8ae72c62753f9e794fda20290883ddc65b0d85e26e08f8bb227567ad", size = 1221242, upload-time = "2026-10-17T00:02:56.395Z" }, + { url = "https://files.pythonhosted.org/packages/d6/05/ab1c56c3b7adcac88764bba609502d6b4989e449b2dd60eb478e1d20e369/ast_serialize-0.13.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc34c670747d85d4232834665e247009413eaebe47c69eaf60a5c439aaecaed9", size = 1282105, upload-time = "2026-10-17T00:02:58.275Z" }, + { url = "https://files.pythonhosted.org/packages/0d/f4/41981fcd2ddffe0760e5326be9dcbd2eda9478a8430a637e5123bd8fcb26/ast_serialize-0.13.1-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8c8ebd419811c435812d242fb2a173e57dfede198c9ac9a0a584666ebc9b9331", size = 1287905, upload-time = "2026-10-17T00:03:00.068Z" }, + { url = "https://files.pythonhosted.org/packages/6a/43/b783addc5681153707121991b7b47892f7e9c8ba58a0d03b71a3b023ba47/ast_serialize-0.13.1-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8899c038b1c15ae8b98e379057fb3ef398ceb0b21d1737a8156dd5a0923b7e51", size = 1541806, upload-time = "2026-10-17T00:03:01.503Z" }, + { url = "https://files.pythonhosted.org/packages/47/10/969db095038ee15270f65ad20d1129c5e4da605bf7e93b70ae640f1c8a9f/ast_serialize-0.13.1-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e14c4de98f965647a74e6eaf37e20207124e45451ccd36e84a6f6ebab45e0372", size = 1309946, upload-time = "2026-10-17T00:03:02.971Z" }, + { url = "https://files.pythonhosted.org/packages/06/dd/7c623d2fb0b868948952d1787e629a43b866f7d4caefd5445e20aefacec4/ast_serialize-0.13.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f3e8a3eff69af640db985360fef35073fb46956dfc3e5c614cf00920d2746dd", size = 1302773, upload-time = "2026-10-17T00:03:04.378Z" }, + { url = "https://files.pythonhosted.org/packages/d4/c2/4d49469110a19a44fc6269f4fd59679bcf84df068f185f89b73bee4da19b/ast_serialize-0.13.1-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:75d7750fe98f6f35a96c43aba8d98a2e623e22c778a0c17ab9ede92eb10f5d82", size = 1299579, upload-time = "2026-10-17T00:03:05.88Z" }, + { url = "https://files.pythonhosted.org/packages/9d/9a/2d381f1f262dda15affc8ad643fba1619eb07e7d9f8bd904deffef183006/ast_serialize-0.13.1-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:43e8ddd63e80fc280c2f790157386f27f9b9f6ccb9c4f8e803b863cbfb085769", size = 1355969, upload-time = "2026-10-17T00:03:07.321Z" }, + { url = "https://files.pythonhosted.org/packages/9d/9c/2266794e6c25fa9ce51ce04a9bf4b7e330e3ac9351ba3fa14e487678acdb/ast_serialize-0.13.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:9221e09496fb942901993c1812ee87950cc0ecbb514c7c0f1f5fa6d78f701ed8", size = 1460227, upload-time = "2026-10-17T00:03:08.733Z" }, + { url = "https://files.pythonhosted.org/packages/2b/d6/14deb28e5d8f328f626a0778ea2cf98fe908f2bbcccd804cb6f449ee1782/ast_serialize-0.13.1-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:7a5c38bdb93669c596f94fb7204dd6ebe4fadb19058ac9a2faf2948c2a175f96", size = 1562691, upload-time = "2026-10-17T00:03:10.25Z" }, + { url = "https://files.pythonhosted.org/packages/f5/19/7a28c0e5ba54f0d3e054f847a2a549b748cb179ab433321a8dc1b39e398d/ast_serialize-0.13.1-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:acf4e9f055d75058ab01536da330648746f2f82b7697a85230547f2d5ebe895c", size = 1558669, upload-time = "2026-10-17T00:03:11.799Z" }, + { url = "https://files.pythonhosted.org/packages/18/9a/f9e2690eab58217f1d395a964a78efa7eaf813a1e38be8dfd9a8d45d0840/ast_serialize-0.13.1-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:87427913c325adc811e81e7c9a757b061f47ef1e29114ac479aa0953a2687a98", size = 1665071, upload-time = "2026-10-17T00:03:13.284Z" }, + { url = "https://files.pythonhosted.org/packages/8e/f3/ef5b159a0d7161b404f05e7ec21cf7735ee7edc10c000cd2cbbc7bb6b69a/ast_serialize-0.13.1-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:ad88921f95b92bc144d9ad059a0e16f8c1ae69f5239f2d3c6536fd2774f73dfe", size = 1473364, upload-time = "2026-10-17T00:03:14.563Z" }, + { url = "https://files.pythonhosted.org/packages/1d/87/6e8ac4a865124a12cc4f915bf1bcfac3bba426cd5f58d3712a873ee61012/ast_serialize-0.13.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f8b17e2921e56621bcb46792bd3e0b82ca3b85de78d5936e7b8174ba1758b0aa", size = 1500566, upload-time = "2026-10-17T00:03:15.917Z" }, + { url = "https://files.pythonhosted.org/packages/f5/1e/29155f1621433008013ad5c940a03d41a676be0680c41527040472d37583/ast_serialize-0.13.1-cp314-cp314t-win32.whl", hash = "sha256:2f9a9ce8b0994f757b941f7f7fe384a6666b4162b941ebc5c248081baea18e47", size = 1128674, upload-time = "2026-10-17T00:03:17.481Z" }, + { url = "https://files.pythonhosted.org/packages/bb/64/2506da65143ea138de5822e9173e0b72320a2f70e23bd723f044033175f1/ast_serialize-0.13.1-cp314-cp314t-win_amd64.whl", hash = "sha256:5d99910e6b9a9b9360bcca2ae99aee36cc912ce058df2a57d1c33099b6cb2593", size = 1163306, upload-time = "2026-10-17T00:03:19.046Z" }, + { url = "https://files.pythonhosted.org/packages/6d/8f/c7cb22638899b0cf15908809c270560e46395e65604bc59e4b623ab9f405/ast_serialize-0.13.1-cp314-cp314t-win_arm64.whl", hash = "sha256:a789cbe14d0a0e9ec9b32a456e5abc81ad8799479c3cfd88a29e3442262aebe6", size = 1133775, upload-time = "2026-10-17T00:03:20.377Z" }, + { url = "https://files.pythonhosted.org/packages/2b/e2/b0c140fe50fa39dd249e382f7733af6f816c90021fe7959a0b026f86237f/ast_serialize-0.13.1-cp315-abi3.abi3t-macosx_10_12_x86_64.whl", hash = "sha256:23d768369b89d551077dc173da6892fad00443338417523b6732f4e8ba4a7ed5", size = 1236160, upload-time = "2026-10-17T00:03:21.945Z" }, + { url = "https://files.pythonhosted.org/packages/23/c4/a8a2ca21e3943555b48221f8fba546877a7ad39efaf6505506524967d7c4/ast_serialize-0.13.1-cp315-abi3.abi3t-macosx_11_0_arm64.whl", hash = "sha256:68f8829d114dab6c9db4a8bbb8d0e342958faee1b5e15a29022678df639960f8", size = 1222214, upload-time = "2026-10-17T00:03:23.462Z" }, + { url = "https://files.pythonhosted.org/packages/15/19/2f58f2ba64e4799b39de85c140aef09a03aa6ea53be75dd292a9d9b9d8ae/ast_serialize-0.13.1-cp315-abi3.abi3t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e385b17d5bde892a6184003a9aff3518387908b73f8f5ea539313c07c8c0ede", size = 1282979, upload-time = "2026-10-17T00:03:24.695Z" }, + { url = "https://files.pythonhosted.org/packages/b1/af/ca6087fe84210c1ccd43e3182917bb70649fa1e69745a90c1d59ba08fea8/ast_serialize-0.13.1-cp315-abi3.abi3t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:02686b281ec9b8e9614f6f0db27e12e4cac515f336c5d05b678bc9eb73ff2af5", size = 1288596, upload-time = "2026-10-17T00:03:26.04Z" }, + { url = "https://files.pythonhosted.org/packages/b0/2c/4ef964c763329a0347125e745ec0451ba4fbaceec9efe2ac729b7cd55f17/ast_serialize-0.13.1-cp315-abi3.abi3t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a8ab2c2585b2e22e48cd4aff2136fce4eab4ced569b85f150ef9a5a5d6f34d49", size = 1545540, upload-time = "2026-10-17T00:03:27.52Z" }, + { url = "https://files.pythonhosted.org/packages/bb/85/aa961dbb75813cfa94de0ce9a16a9510c226b95f604c405421e727f44bb0/ast_serialize-0.13.1-cp315-abi3.abi3t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c652d9f5d52d8b81eff3ff2c95c9dd0f281de45f6ad5d3fa95527550c396454a", size = 1309374, upload-time = "2026-10-17T00:03:29.091Z" }, + { url = "https://files.pythonhosted.org/packages/b4/e6/f2b67c327d9f9533e41791804403ccc2dc457821195a2e51f0b587a90b90/ast_serialize-0.13.1-cp315-abi3.abi3t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:121e1d08d58b75c15491cc3003609cbad71ac2b0016043c36d30a6b2032b6605", size = 1303466, upload-time = "2026-10-17T00:03:30.451Z" }, + { url = "https://files.pythonhosted.org/packages/73/1d/33f18b81d1bb1f5d682943ea92fda8130a6593627f12f6201668d40824fd/ast_serialize-0.13.1-cp315-abi3.abi3t-manylinux_2_31_riscv64.whl", hash = "sha256:30cf89b6a6844542d116c758725d13de5b97b9410a51ee577715f761270d0c1c", size = 1300576, upload-time = "2026-10-17T00:03:32.102Z" }, + { url = "https://files.pythonhosted.org/packages/25/cb/64914144925f1a4abdd9217e717b122255c38fc5ebe4342f92052f3bacbc/ast_serialize-0.13.1-cp315-abi3.abi3t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:732aaae9e498c973fc63fd7f308009b57c4afa6ff59d0b674d894e57d0bca01a", size = 1355960, upload-time = "2026-10-17T00:03:33.676Z" }, + { url = "https://files.pythonhosted.org/packages/ee/80/bd29379fab2bce19adc0bf9177002b11b23dfe8d8fecf409998b458b4624/ast_serialize-0.13.1-cp315-abi3.abi3t-musllinux_1_2_aarch64.whl", hash = "sha256:d9c1a920b2aa0c1e016bed7721689717034ca0dba64ac3a3ff243b003d4e8dd8", size = 1459779, upload-time = "2026-10-17T00:03:35.09Z" }, + { url = "https://files.pythonhosted.org/packages/83/89/012dbe733de05ffdf8e40ca0f9fa5d417cb16ec93a74463c57c001914198/ast_serialize-0.13.1-cp315-abi3.abi3t-musllinux_1_2_armv7l.whl", hash = "sha256:847cad4c22953823f5e76d0b126c6f9da670cfa45b1df41b9324e22189d77611", size = 1563399, upload-time = "2026-10-17T00:03:37.285Z" }, + { url = "https://files.pythonhosted.org/packages/69/37/ee4bcb0358bee38744eb0f18560446572d095fe3bf6b63d6f739d08a839c/ast_serialize-0.13.1-cp315-abi3.abi3t-musllinux_1_2_i686.whl", hash = "sha256:aca07de3ca8e3d9f2b716c3c31f4f384fe4bd2d03e09912417cff7a3e08036f7", size = 1558808, upload-time = "2026-10-17T00:03:38.711Z" }, + { url = "https://files.pythonhosted.org/packages/54/1c/ff44c5355251d61ef22934c4430bb31a61de4781d25a992154aac9b8c82a/ast_serialize-0.13.1-cp315-abi3.abi3t-musllinux_1_2_ppc64le.whl", hash = "sha256:5db12d843d931b9d1f1519ce66b9cbfe72d8563b75c1204d255322254d1964dd", size = 1666324, upload-time = "2026-10-17T00:03:40.376Z" }, + { url = "https://files.pythonhosted.org/packages/c8/bb/6da4bfc8aa3403e6447607131bf3463acaf954d990c6c8b6787c1902ddfe/ast_serialize-0.13.1-cp315-abi3.abi3t-musllinux_1_2_riscv64.whl", hash = "sha256:fb8021f4dc3296de18737e3b8b34994411da725374d74a0b9eb32a738f2a23d0", size = 1474089, upload-time = "2026-10-17T00:03:41.715Z" }, + { url = "https://files.pythonhosted.org/packages/21/97/897e33bef2eefd880e6350e375cc66bc5bcd00a139be480fd655f5b3f095/ast_serialize-0.13.1-cp315-abi3.abi3t-musllinux_1_2_x86_64.whl", hash = "sha256:0d764913374ba21df8cd618045b371ed104ce55c6276de7c59e554a4f5ba26fd", size = 1501542, upload-time = "2026-10-17T00:03:43.08Z" }, + { url = "https://files.pythonhosted.org/packages/8d/4c/821211ac83870c27e4412381b7c7838336456b40575bf840e4680b2018d9/ast_serialize-0.13.1-cp315-abi3.abi3t-win32.whl", hash = "sha256:2bad302ae2427454ef9dab71bd5c3ad67188860c39d36daee38f72031edb39c4", size = 1126118, upload-time = "2026-10-17T00:03:44.616Z" }, + { url = "https://files.pythonhosted.org/packages/1f/86/2b2d5e6c4fa352874a80618e742ffd32d249dee6c119f4233b51afc6b8f4/ast_serialize-0.13.1-cp315-abi3.abi3t-win_amd64.whl", hash = "sha256:032b09d86c785c3984e975378b7861f2a68ac44e22ba7b07b93a536b2524eeb8", size = 1163766, upload-time = "2026-10-17T00:03:45.986Z" }, + { url = "https://files.pythonhosted.org/packages/77/a3/d610cfcdabaa44fd62a54ca1fc57a7dba120643798b089a14914973562de/ast_serialize-0.13.1-cp315-abi3.abi3t-win_arm64.whl", hash = "sha256:929eda0c419e622ab49df3a4c45f81c57dcc10874bbad55d0470a4a03324dac3", size = 1134043, upload-time = "2026-10-17T00:03:48.453Z" }, + { url = "https://files.pythonhosted.org/packages/f0/89/0e30f9eddf7d44ccf9d25979030754fd0457af61fa4279acb8c293a04f97/ast_serialize-0.13.1-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:bf53a3ba1cbe45399fc1e4ccd684b8f2a11cca450f89706b79122f478534c6f5", size = 897546, upload-time = "2026-10-17T00:03:50.093Z" }, + { url = "https://files.pythonhosted.org/packages/81/92/d705be88ff452b9ba0088b554a0cbd308fd01879da092b33fd2ad7d1aa60/ast_serialize-0.13.1-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:4bcf1d5f4eefecaa325a34ecf079b2741189e7d0821523f92cb343a389a67489", size = 1242416, upload-time = "2026-10-17T00:03:51.521Z" }, + { url = "https://files.pythonhosted.org/packages/60/c2/98370845a7f35cb8a25782e78284b48e01bf3128339881d48d613f304f8f/ast_serialize-0.13.1-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:1b158f1c9e3a0d386913924c57995d6df78224868a4d0f215bdd41587c97b34a", size = 1229729, upload-time = "2026-10-17T00:03:52.825Z" }, + { url = "https://files.pythonhosted.org/packages/d8/8b/2d7ffed76addd9d3fcf37fb171400942735c8912264c763561a85407f6a8/ast_serialize-0.13.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77a6201b69ce42e919f2fd9a559138d5410b5d8afff7c3a6b1f500b0481ff7d8", size = 1292255, upload-time = "2026-10-17T00:03:54.148Z" }, + { url = "https://files.pythonhosted.org/packages/6b/2a/bb9e0e719d89cc950fadfcfcc9cb4bc7640419c4228c852f031ab8abf440/ast_serialize-0.13.1-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6eb0be64c9b8f1ed26637eef345abe75ea90351c92c85a8aec7838b3af971011", size = 1298501, upload-time = "2026-10-17T00:03:55.559Z" }, + { url = "https://files.pythonhosted.org/packages/7a/32/13ce07dce48226f5bd9cfd8f708ec101a8be05aa430cda4918ce31ce8c82/ast_serialize-0.13.1-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7f2427bddfca208e84de700044fadf9aef2769a70bae740a1bdabb89ee9e1117", size = 1553758, upload-time = "2026-10-17T00:03:56.952Z" }, + { url = "https://files.pythonhosted.org/packages/e2/fb/9b51d186db0c20ca28cbaaefd50f03b573c89327b9a2627820cbce22196b/ast_serialize-0.13.1-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:88df960e67184a71874e5b2ee014f87d1254a0dbc1f903c7bd7b1ab7733ecaef", size = 1318258, upload-time = "2026-10-17T00:03:58.418Z" }, + { url = "https://files.pythonhosted.org/packages/c5/fa/da311559dd3dae9af5825cf21660775a929b970f72e3786af3f2cd667944/ast_serialize-0.13.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f99786e0d62082a5b121b3437f3167562133711df22128de1e9886f57f0b226", size = 1313260, upload-time = "2026-10-17T00:04:00.194Z" }, + { url = "https://files.pythonhosted.org/packages/2b/11/97a4b9e5b4776d72f47fcd9a09a497bbf68ec8c1ae074307a2c51e410d85/ast_serialize-0.13.1-cp39-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:a01b515b25a03184eff4acef25b981ae007916379682e908fc8785b342a0bf3e", size = 1309992, upload-time = "2026-10-17T00:04:01.575Z" }, + { url = "https://files.pythonhosted.org/packages/2e/c4/62f85121a80cd451ef04f550cf0f7ea0ad9ff46cc4e9a5b9ae439b6527b1/ast_serialize-0.13.1-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:29422d7bcd9e7f39411571c36cec45ce8a7a9b3ad4b2e7aa64497c15a9e397f6", size = 1362715, upload-time = "2026-10-17T00:04:02.881Z" }, + { url = "https://files.pythonhosted.org/packages/c1/fa/c5f4a545f72a7681e3295bab6e3600ee0862ec4391bed961fe9f735b67e0/ast_serialize-0.13.1-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:6ffb0f548a7dc126067fdfb7b2325ab5dfcdeecc29faf5e0f0461c96d6ebfa3d", size = 1469931, upload-time = "2026-10-17T00:04:04.181Z" }, + { url = "https://files.pythonhosted.org/packages/38/a9/65aed4f8fa7a001a7cfdc03e68e844517ab041ba6fb614b7d78a1d6ac056/ast_serialize-0.13.1-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:2876444a5f87a7c76f371af3c07c2fda563a08bc8af52568df812e8aba4bf568", size = 1570945, upload-time = "2026-10-17T00:04:05.778Z" }, + { url = "https://files.pythonhosted.org/packages/fb/8c/44b2da991cede79bfbf52089f33a5f0168945466b3d9cd38b5dcf08e7130/ast_serialize-0.13.1-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:885a62ec6481ce58ab24c6357360d7a82023b62dd7e5e7ceccf59e9662a3272b", size = 1569978, upload-time = "2026-10-17T00:04:07.347Z" }, + { url = "https://files.pythonhosted.org/packages/46/e4/109b2a5beca700237767d5add920c2f8e1ba9bd5799b0faf143d0e9cf4ef/ast_serialize-0.13.1-cp39-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:2015fd0165e463aac3b1aadc6a1fa1e5820c14ca950821f4fe02f8a3f6a388d6", size = 1676082, upload-time = "2026-10-17T00:04:08.7Z" }, + { url = "https://files.pythonhosted.org/packages/73/e0/7df70f6dbb11b5762da5416318f08316a1c51348e0d69ec79ca5f98f836a/ast_serialize-0.13.1-cp39-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:eb41e1906502ac80d24ff343f45008552a3f5b5158607959fe6a07dbfc6eb037", size = 1483207, upload-time = "2026-10-17T00:04:10.162Z" }, + { url = "https://files.pythonhosted.org/packages/1f/bc/523aa1c08bd69b5654621beb3dc1a9035715a4a63762fb8d219d6fb3eb81/ast_serialize-0.13.1-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:ca9acc67f796aa2554fa3037dccc022a4b08b38b2ad153edfac9c9bb7cb1f3c6", size = 1512140, upload-time = "2026-10-17T00:04:11.589Z" }, + { url = "https://files.pythonhosted.org/packages/66/83/6607060659998f00afdea0d8375c1e6e2b7d515ab905090d9a5a02f48851/ast_serialize-0.13.1-cp39-abi3-win32.whl", hash = "sha256:4f98da562e5901d69c7dd30885594c5438f859edf354e9ac7517d188fb026c3a", size = 1131889, upload-time = "2026-10-17T00:04:12.953Z" }, + { url = "https://files.pythonhosted.org/packages/9f/6f/bafd6490fe7b355627fabe95f4417e3d02da93102c8552550eb9a0774e1e/ast_serialize-0.13.1-cp39-abi3-win_amd64.whl", hash = "sha256:ddf7cbc9c8abf70102c4a088efe154bb86bfb825b0a10e556d2b15972cf99bd7", size = 1171153, upload-time = "2026-10-17T00:04:14.362Z" }, + { url = "https://files.pythonhosted.org/packages/11/25/4235f4b375a67a37ac595bf478a5407a744eaf7b64113c1c3a5432b8d954/ast_serialize-0.13.1-cp39-abi3-win_arm64.whl", hash = "sha256:48f11d96c9ec71119612f8e79a8c55c12f2b136716d68347433c561d27a25f43", size = 1139035, upload-time = "2026-10-17T00:04:15.767Z" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "coverage" +version = "7.17.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ed/8f/19651ed6f648de7e1383bb759207078e2ad8addeca711187e1cb3a495f14/coverage-7.17.3.tar.gz", hash = "sha256:6695d1bb2a9a2fbd7806d69d78cf30f35eb0f65045da0ec5b5045242fadd6a78", size = 1004507, upload-time = "2026-11-12T12:26:44.986Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/74/cb/8f46f44d97000acecd06e86dbac5d1dfb68afe5d904e2efe0d9ef9e442bf/coverage-7.17.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c53abadc7c4cf7870865fbaf7204e86efbacf93354e010e9188007fe2882a073", size = 228455, upload-time = "2026-11-12T12:23:59.975Z" }, + { url = "https://files.pythonhosted.org/packages/77/6b/49026112289ed0c1f575597a37798e8f76821f143a060ee2e5a70a8a86c6/coverage-7.17.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ff273110e4e1505ef7a642523ba43f58eb6770ae9e8f869d72efea816cb4bc2c", size = 228844, upload-time = "2026-11-12T12:24:01.945Z" }, + { url = "https://files.pythonhosted.org/packages/2e/b9/640eaf192173b1ce86e12866a4c3ba29ab12c7213bc7ab4534ea5b88963a/coverage-7.17.3-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:1bbbc3e4de867a5e75684d98fc77c20e0687ca3abec69b4421b6f3fb96cd860f", size = 260984, upload-time = "2026-11-12T12:24:03.226Z" }, + { url = "https://files.pythonhosted.org/packages/f0/37/e73c7bdf04006a23e3a4404796db14e5d4029517f6cd9dd84c4af4b2308d/coverage-7.17.3-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:e142166a52ec7edc650b6d3a0b9b1f79dac0ab8843c249e8821ec97a71d1fd2a", size = 263184, upload-time = "2026-11-12T12:24:04.543Z" }, + { url = "https://files.pythonhosted.org/packages/5f/3a/5a2e703086f70f0a07ee1190f31dae4867df3a34301a1f61dd459c104c98/coverage-7.17.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4dc3c84002968363c37688e0b325d51a51816c53f3c0cbb925254317c675a789", size = 265425, upload-time = "2026-11-12T12:24:05.954Z" }, + { url = "https://files.pythonhosted.org/packages/1d/ca/50998c80499e507d0ee2de79083994ea4871c59eacc25ec4a04642c0dab2/coverage-7.17.3-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:620fb331a7d94e3749348cb4a5febcb2ef23ef17192349088e80f4da0cf42647", size = 267374, upload-time = "2026-11-12T12:24:07.292Z" }, + { url = "https://files.pythonhosted.org/packages/de/c0/20ac3d43a4cc4b1fef83425db9e69d9f7e934c52e6ee94e972664e527e6d/coverage-7.17.3-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:89f49fa6890f28247135934c4d92abb16828124b2cddb681e2496997c37364fd", size = 261100, upload-time = "2026-11-12T12:24:08.617Z" }, + { url = "https://files.pythonhosted.org/packages/0a/89/b02460b85e9e5bdc2f11d61bdb1e64ee43ce0cc4a928842324218d4ea9c0/coverage-7.17.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:6d116e2d3b3f3506f634cc48f58dd01497f34a50263e65acfaf6ad7a162f3384", size = 263094, upload-time = "2026-11-12T12:24:10.126Z" }, + { url = "https://files.pythonhosted.org/packages/d5/8a/c75b55038a62ca7d359e2e2ee83fb853a9c30f189576cf765c509bad4f46/coverage-7.17.3-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:dcd518608b7f869838436ff8d922977e186d1082b9ddad37305ad5282186fd41", size = 260978, upload-time = "2026-11-12T12:24:11.515Z" }, + { url = "https://files.pythonhosted.org/packages/39/df/9bb1a6a08ee2d9f0cdececb7311e9b640d8ddb051135c8ec39fc048dab2b/coverage-7.17.3-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:bb2b2f47ad4cc671491c725250ae2a5cadf43a3b0f9136e78f7ecf9506a9fd61", size = 264987, upload-time = "2026-11-12T12:24:12.993Z" }, + { url = "https://files.pythonhosted.org/packages/62/41/199a5d3393ab651eb140412c613f42d482679b09550ce63390b9230e8139/coverage-7.17.3-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:8b713613ed67d5ed88968799e814888b62c6add21f5becad2cae1ec44260e9d0", size = 260566, upload-time = "2026-11-12T12:24:14.298Z" }, + { url = "https://files.pythonhosted.org/packages/7b/08/fbef6288a4a0be6801224aff6d4c57f86dedf1460f3340b5299793defbc4/coverage-7.17.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:6a8db4bf69a1982cf0fcf16fb11ff17bb2ed3ade5b0e803bb67ad2963a7b1bf3", size = 261721, upload-time = "2026-11-12T12:24:15.649Z" }, + { url = "https://files.pythonhosted.org/packages/70/84/4d0cbfbe6c540cb2a9d473e3edd13ad487abf9ae56ddf10328bc6250d0f3/coverage-7.17.3-cp311-cp311-win32.whl", hash = "sha256:320a27997b421ea16eeff42cfd26d40584abd436fb7802ca766d6e8610bc9718", size = 230311, upload-time = "2026-11-12T12:24:16.897Z" }, + { url = "https://files.pythonhosted.org/packages/a9/5d/05357f7a25cbc1347bd4be30a5db27a20ed36ce00b9cba839193aba0f251/coverage-7.17.3-cp311-cp311-win_amd64.whl", hash = "sha256:35137f71927b7da9292d391409104391b73c5e80d26b6a0d216d871964092351", size = 230918, upload-time = "2026-11-12T12:24:18.223Z" }, + { url = "https://files.pythonhosted.org/packages/19/f9/c317aade1964fc4bc916c0cafbd632fca00a4d522bb5b5be802eb787cf4d/coverage-7.17.3-cp311-cp311-win_arm64.whl", hash = "sha256:83510c65a385563646297e8dd572e5def63dc300ca08ae15307d99a0225cdfb8", size = 230825, upload-time = "2026-11-12T12:24:19.546Z" }, + { url = "https://files.pythonhosted.org/packages/72/8a/f8f26089835e9fc5e969d73d26f4d159c522ac9f4a32e07fccbce711264a/coverage-7.17.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:203aa5e42c88e9accfa18a0cc91950499efaa5b179a1da14bcbf5b995afdbcb6", size = 228508, upload-time = "2026-11-12T12:24:20.866Z" }, + { url = "https://files.pythonhosted.org/packages/76/a8/aa6d208d9d81c2f80af848d97887afb2ddff51aae7333f7aace68faebe57/coverage-7.17.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:61138b3a51d91ee443b04962ec9990fa140208a7a082b1754135ebd1378a420f", size = 228760, upload-time = "2026-11-12T12:24:22.248Z" }, + { url = "https://files.pythonhosted.org/packages/55/d7/d2b47e1b177758211509243d7540eae642f633c98de29203258cff9b4b83/coverage-7.17.3-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:d0e0fc055d4436f4b6de83f50cbd9da38af18fb36341b162b408ad7842068a33", size = 261171, upload-time = "2026-11-12T12:24:23.689Z" }, + { url = "https://files.pythonhosted.org/packages/7a/9f/fa0545021ba561812c64cf680f4c9fe49dec93fe74049f3fd38f33c7dd19/coverage-7.17.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:0860a5f27ceccd53ee4070acc182588ed4f15b7401cdcca09d8c0cece9c2ad7d", size = 264512, upload-time = "2026-11-12T12:24:24.955Z" }, + { url = "https://files.pythonhosted.org/packages/8c/b9/cf9791e66c73f7530724cc5ee5e306f4e1bdde8951e3069d337105109e0a/coverage-7.17.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:84b5a474040b33f3d805c0b19fadf5a2e78fdd46e0bcb8b813631e5cac64195e", size = 265022, upload-time = "2026-11-12T12:24:26.315Z" }, + { url = "https://files.pythonhosted.org/packages/47/af/0d88bdf1e4a274a717faf91edf1b970605c32722c2fa563428a398c67f5f/coverage-7.17.3-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a5fa43619c0a53a0424783cc08dbb26a2115e3a890ab566fef811b77d04d5501", size = 267310, upload-time = "2026-11-12T12:24:27.523Z" }, + { url = "https://files.pythonhosted.org/packages/44/27/798abcf5038335fa1b7e8d739a74e53dfa4a6569ef69db2eec941d1901d9/coverage-7.17.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:dc6f3c1406fe7e8e2d59eed1f476c5429dcdd11cd3fbe1341acf8ddc4bb9b383", size = 261399, upload-time = "2026-11-12T12:24:29.144Z" }, + { url = "https://files.pythonhosted.org/packages/2d/92/92625c36222c3e75af20054521b53fff2b2aef907528a8748eccaa3c8126/coverage-7.17.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a1dc44fba727d1cbd8daa88ced7dd867aebef5631b116210f2a2d4da08622d03", size = 262916, upload-time = "2026-11-12T12:24:30.371Z" }, + { url = "https://files.pythonhosted.org/packages/9b/71/a14cfe5a3525ad3a942aff0bbb1737a3b536d899bcc60307607c9f17df24/coverage-7.17.3-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:1e7a015f952798d7d5120e8122c160fce7322b0b9d144b9be6af71552a3e68da", size = 261078, upload-time = "2026-11-12T12:24:31.679Z" }, + { url = "https://files.pythonhosted.org/packages/9d/7a/40d1f7488a000d5dc97d70a478686ba4d8f2f752da1d98b4aeaec23d8117/coverage-7.17.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:b6876123ce43459a4b39d5778108010b06164225c3a25c6a43cb85a97f80c549", size = 265138, upload-time = "2026-11-12T12:24:33.428Z" }, + { url = "https://files.pythonhosted.org/packages/ca/ac/7f160d9cfdf0a6d81eb2dcaa262225248b50042959d8ab72f05eccc5827c/coverage-7.17.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:76a3ddca94ef96b477b7edceac08b1abe0ff26e1ebe1d7000e35bdd17dcde5c4", size = 260584, upload-time = "2026-11-12T12:24:34.758Z" }, + { url = "https://files.pythonhosted.org/packages/c5/25/11c7a20e326c8acb23fe94a1ce8bcc4711757ee87ae48c50e806c4be7cf3/coverage-7.17.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c45c4e99a09c70e7d6fe101f59fe4556b89d99bfc80cd4e7f5e13ebb6c1e4854", size = 263083, upload-time = "2026-11-12T12:24:36.226Z" }, + { url = "https://files.pythonhosted.org/packages/34/67/94e93cfbbb5e73cd929040a9e51a58e1f5bbffdb7d7ac919ddb39faab4fd/coverage-7.17.3-cp312-cp312-win32.whl", hash = "sha256:1b358585003cf99a13d1327e11582af19154d2cf3dea366fe0d10ce479a5c9f9", size = 230371, upload-time = "2026-11-12T12:24:37.663Z" }, + { url = "https://files.pythonhosted.org/packages/67/54/da7c1a906013e008c00e752f1fffe8f4688a747d7037f85b79e83d7b7442/coverage-7.17.3-cp312-cp312-win_amd64.whl", hash = "sha256:df0faa493ab92bbf33ff8bdab442c5b75089baa5ba752844871b5ce9d009a026", size = 230953, upload-time = "2026-11-12T12:24:38.892Z" }, + { url = "https://files.pythonhosted.org/packages/9c/78/c54e323d40fd5832b51baa0f403fb3c3fd51785f16ffc7d6168a612aa9ab/coverage-7.17.3-cp312-cp312-win_arm64.whl", hash = "sha256:d5a3cd933fdffb958b4046d6f19d3138c7c8a28c439aac800badf61fab6d655e", size = 230757, upload-time = "2026-11-12T12:24:40.119Z" }, + { url = "https://files.pythonhosted.org/packages/ca/f9/32cfe0942a05d63f501d8c66ff61e658f82c277a46dc9dd21c2d691aa52d/coverage-7.17.3-cp313-cp313-android_24_arm64_v8a.whl", hash = "sha256:28d082105e1ead78de56eb46edde029b5af88e22f8bde74fd092ca164bf15492", size = 229799, upload-time = "2026-11-12T12:24:41.464Z" }, + { url = "https://files.pythonhosted.org/packages/59/6f/f1bc0d3e1d72063b1ca4caf7238770ec11ff0747e4e04c2e0fdd72734855/coverage-7.17.3-cp313-cp313-android_24_x86_64.whl", hash = "sha256:683a204e9773f3127ef836640712270bc4893f10bd7e1ce8a21735dca4c14429", size = 229871, upload-time = "2026-11-12T12:24:42.801Z" }, + { url = "https://files.pythonhosted.org/packages/21/2c/1a3329fa772949a376d64362c2829a0718798ba503fb55338cc4002d132c/coverage-7.17.3-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:e4d18e90c87621590a0b1cf2e4caa96f0aa511073f8a1caa3244e09e569564cc", size = 228142, upload-time = "2026-11-12T12:24:44.03Z" }, + { url = "https://files.pythonhosted.org/packages/83/c6/73d97609380203ca8e763094563f631b76a34974da6940a4b5c91397a07a/coverage-7.17.3-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:f3347c72d0f4cb3803f4ccdd4331a49a90ef2daa683ce89e2480278400bd2eee", size = 228442, upload-time = "2026-11-12T12:24:45.278Z" }, + { url = "https://files.pythonhosted.org/packages/f6/40/5d529e99978d20bb049d76b4496c55a090896a70961b28ab4e3607802899/coverage-7.17.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:c4ae9befec714c867f42bbea99e1ec25eecdbe51c8faf1cc82164bd65bf4db0c", size = 228540, upload-time = "2026-11-12T12:24:46.509Z" }, + { url = "https://files.pythonhosted.org/packages/36/ce/c9f97fe1cda3e9985e6e5fe88505712bdad72032b2ecce1cbda9cf77b13b/coverage-7.17.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:8a0aef07b2eaeee9d82ca62241d5c6586aed5dd729300507d2d3f612588c2634", size = 228824, upload-time = "2026-11-12T12:24:47.868Z" }, + { url = "https://files.pythonhosted.org/packages/ed/8c/084855adc7d953c222d4271e2265ad08ee6b690b7394475833640eca4543/coverage-7.17.3-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:4b1300f07904db81508b87a72471e80d37fb6d48debf1168e12edccc81cd0225", size = 260008, upload-time = "2026-11-12T12:24:49.375Z" }, + { url = "https://files.pythonhosted.org/packages/f9/81/287400710ece16ca6421593c6426b1dcf43809466bfe8fe143857fc8e34f/coverage-7.17.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:222bc51858b0f64cb15d51380541712f8d5dc9bb5ce4fd9828bf466503d6debb", size = 262996, upload-time = "2026-11-12T12:24:50.863Z" }, + { url = "https://files.pythonhosted.org/packages/1d/b5/1b668b30b528cadb26fb404b0fb09f5ec21d03e6e8fae88eb302d243d77f/coverage-7.17.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:39c063c038b710e0bca3afd4997ccee680674bece468fac13cb8aee9af530d31", size = 263934, upload-time = "2026-11-12T12:24:54.175Z" }, + { url = "https://files.pythonhosted.org/packages/41/a1/bf82406278a1d6bd273400a6950e9f51370f2c414e0a2ccee96f6f606cf9/coverage-7.17.3-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1d26daefd513c4775a6d06846389da9a9e3498b6ddba24982359b75b703dd341", size = 266119, upload-time = "2026-11-12T12:24:55.486Z" }, + { url = "https://files.pythonhosted.org/packages/62/a3/7f518c0350fd3a5ad27991acb50b843361aea6755f593c1ed503ef378cec/coverage-7.17.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f848ec842cb95fddae4b88830b249e8bade41697f16909688d2af80e8b51e7b6", size = 260259, upload-time = "2026-11-12T12:24:56.997Z" }, + { url = "https://files.pythonhosted.org/packages/da/59/d74e18b4ba02fab1dafa4267260ca80761d2f3c82917c3ce5e46d3ade4eb/coverage-7.17.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4d64248cb7c995aa66dac34c66286c80fb78b13c19bee1503720cc6e55e5de17", size = 262154, upload-time = "2026-11-12T12:24:58.311Z" }, + { url = "https://files.pythonhosted.org/packages/eb/4a/af3b009eaa4565e59caf6c51c12a8909c5acc5186a6e95f366691f86156e/coverage-7.17.3-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:59b4bd56882387b5a957048a77531669d53d641ce8148c23149d2550e9fd4e25", size = 259946, upload-time = "2026-11-12T12:24:59.583Z" }, + { url = "https://files.pythonhosted.org/packages/a6/5b/d1a9f7b8097065b82a87335215008822354d43d534e330aa023fe42e7f33/coverage-7.17.3-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:1ba5c445d4c7718422753a393bcb0feb6d9834321cdb43dcb585725a392b3edd", size = 264285, upload-time = "2026-11-12T12:25:01.22Z" }, + { url = "https://files.pythonhosted.org/packages/32/8b/b186fb0075d4d5d1cd290f9e0b15c9666ce1cc656fd6beb816ef29c2f7eb/coverage-7.17.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:b355277f181890fdfc7f49af89f398f8735f031b2f9a5801082e678e9ae85972", size = 259995, upload-time = "2026-11-12T12:25:03.022Z" }, + { url = "https://files.pythonhosted.org/packages/cb/66/f5c3fcfe4981bce212dde6504eb28dd00b49520fdfe487d5aaf0edb0e20d/coverage-7.17.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:16ed46c0d461a3972e8474268c22bf5d88cdd1088435313edc7e220050c5ac97", size = 262034, upload-time = "2026-11-12T12:25:04.584Z" }, + { url = "https://files.pythonhosted.org/packages/1b/c5/f2709522b213b00a9d3cbc01573666c62c8ddc6d16f1c7f1b45cf00efc99/coverage-7.17.3-cp313-cp313-win32.whl", hash = "sha256:dcd6ea389b3da63f467b05c0f47db037a672592ab2035d4bfbb1f662eef4f4a3", size = 230341, upload-time = "2026-11-12T12:25:06.03Z" }, + { url = "https://files.pythonhosted.org/packages/ff/d1/e6875a808ef55eef9c235cb0a9752390860255dbaf7ff792b8cc8d099a80/coverage-7.17.3-cp313-cp313-win_amd64.whl", hash = "sha256:49fff24117050f1784447ae8181e75a78b01cfef4b6a8ccba676d466d1d68d9b", size = 231060, upload-time = "2026-11-12T12:25:07.318Z" }, + { url = "https://files.pythonhosted.org/packages/09/33/8c966bd7588350df9f56fb0c57cf786b743c622b7f0af4c58cd45de121a7/coverage-7.17.3-cp313-cp313-win_arm64.whl", hash = "sha256:d3353cb2ad4254fa433cc53d1ee1fe80eebde529085b238393f3f6d5af821f70", size = 230780, upload-time = "2026-11-12T12:25:08.652Z" }, + { url = "https://files.pythonhosted.org/packages/98/bd/86199a63e36d1ec253e128aa3df186933c7c5993945be114b9e5102b7c77/coverage-7.17.3-cp314-cp314-android_24_arm64_v8a.whl", hash = "sha256:6f8f925262bc0d6fea12d5dde6998aa57f162e05d5a7d50b95d400ab05bb4537", size = 229914, upload-time = "2026-11-12T12:25:10.352Z" }, + { url = "https://files.pythonhosted.org/packages/d5/43/e0366c117f7cd88889674837e2146e9114d7c045fd7383c9f3c551f5b863/coverage-7.17.3-cp314-cp314-android_24_x86_64.whl", hash = "sha256:9e888603ea67c63ba264f39f3459f4cf68adc78dcd9f8bfa65dde601265a40f1", size = 230030, upload-time = "2026-11-12T12:25:11.794Z" }, + { url = "https://files.pythonhosted.org/packages/a6/b6/1f7e3f29bb0700586d6709d533a0421ed96e1372b608facc6870c05b0489/coverage-7.17.3-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:fab6f713a1f2f0ab7fb7d55f3aea15d1f3fbd31ace61b585ecd87c8e34f898fb", size = 228215, upload-time = "2026-11-12T12:25:13.133Z" }, + { url = "https://files.pythonhosted.org/packages/9e/cd/81261279e5a47a1295992e5d648fa30626af692c05b0767a037120953a17/coverage-7.17.3-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:4300ad360b21af19584c4cc82022979544d776ba2fb2df5418b2f3cae1eee6d2", size = 228518, upload-time = "2026-11-12T12:25:14.389Z" }, + { url = "https://files.pythonhosted.org/packages/78/37/3a28b845dc06bcf17e0501fd641020760b61754444b904aa4973fd7c8098/coverage-7.17.3-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:e033255f24c1df6e046b6c4e9f91baacae08426beb5296bea8d46176b3a137d8", size = 228726, upload-time = "2026-11-12T12:25:15.693Z" }, + { url = "https://files.pythonhosted.org/packages/79/dd/b770682a17e5e911e9c4db6af947641ed334dfd6155632f71fa54375f4a3/coverage-7.17.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:22a80bbdee3c22fb3319befaa112a2ed2d6e1417aa75c310f048235170ceca44", size = 228894, upload-time = "2026-11-12T12:25:17.47Z" }, + { url = "https://files.pythonhosted.org/packages/e9/e4/420e4d6f9ce1e6b8234bafad3508974950ec926063eb4d5e8d71c498b0a5/coverage-7.17.3-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:cfb1d2c52bb66e847669000658a5394d50aba835df8e31c2146034f978c8a4cf", size = 260939, upload-time = "2026-11-12T12:25:18.67Z" }, + { url = "https://files.pythonhosted.org/packages/26/2c/c871c22a11981f58895e4dd167f4aa64c04853c5a0e91de853408c0f2d3e/coverage-7.17.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:eb25b51a30d07db8493901e3040284f2e756ec2b6549ee392798b9ef4c0607b3", size = 263872, upload-time = "2026-11-12T12:25:20Z" }, + { url = "https://files.pythonhosted.org/packages/43/f3/f90e9619f2b0e1dc4d5f487163c3e9fd21629acfe3cd8abb97fa2afa12b2/coverage-7.17.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2b9a39e25bf0e6fe072c6f3bceaa02f5303b9f975e83f590d118c4e92aacf6d8", size = 264877, upload-time = "2026-11-12T12:25:21.341Z" }, + { url = "https://files.pythonhosted.org/packages/f3/8e/b45330abc908d11c65e68be5f240237ad433c8e03dcb99b474541f129e3e/coverage-7.17.3-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9e331bc028b44496ad85d4a2656dbad0feb35baf4a66500042c4aaa878ea132c", size = 267361, upload-time = "2026-11-12T12:25:22.549Z" }, + { url = "https://files.pythonhosted.org/packages/38/80/06eaca23adf2d3b1526fca9e6d3433b0b4aa91e653b59774ea9fc44e1c03/coverage-7.17.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:17a4bd9edd312744035e1298a6ac30dd7332a7f1ecdc63c9eb0685589b161eb1", size = 260674, upload-time = "2026-11-12T12:25:23.869Z" }, + { url = "https://files.pythonhosted.org/packages/58/1b/cf0a2d4d5aaf87b6b9f7d5f0c2e5d110079e9c2a23e11c04f20c98e98689/coverage-7.17.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:cc12f44ac4d5d6be301285c0a4f9c4ae52e673672e284b2a2744e20d24025573", size = 262658, upload-time = "2026-11-12T12:25:25.255Z" }, + { url = "https://files.pythonhosted.org/packages/fb/23/ede764173d08bd9cefeeee344826c22e93d7111fd17b0677436616c98662/coverage-7.17.3-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:0241e03dd65a1edf2e841eb19d8d72dca21ada5c869dcef6c9fde1b166d519a9", size = 260759, upload-time = "2026-11-12T12:25:26.949Z" }, + { url = "https://files.pythonhosted.org/packages/e1/44/b93c258ecbe1848f2117f7466e8c3060554b419f6eabd3761ef95d095c4b/coverage-7.17.3-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:42a1f511a334745a66b8f580c4d561e728243e35f3ada0ada35444c4b2fb9fa9", size = 265227, upload-time = "2026-11-12T12:25:28.493Z" }, + { url = "https://files.pythonhosted.org/packages/9f/fc/09a224782b0720b6a4c9e2fba0a479b87a2b046c523ffdd56339d2d8d516/coverage-7.17.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:095ad10d17a28c845f2e5f99e398db2f0c680401731ff63a3a1789f2e61ef1e0", size = 260428, upload-time = "2026-11-12T12:25:29.799Z" }, + { url = "https://files.pythonhosted.org/packages/1d/c9/3027a58b3db40ded4dc43a8040a45a91e61ebb9f32a4de86e30a29d8effb/coverage-7.17.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:28b05f6b2622551805324196c32f3f20f4fa639bade8ac299ca83073253f6663", size = 262489, upload-time = "2026-11-12T12:25:31.127Z" }, + { url = "https://files.pythonhosted.org/packages/69/a5/f9f767f731fd5a314e66fecd55d8ae320da95467feaf0f3742edf890049f/coverage-7.17.3-cp314-cp314-win32.whl", hash = "sha256:8b8188229ab3b3769a1c4aaa22357447555416deb440326c665a3bd25fd45ce0", size = 230582, upload-time = "2026-11-12T12:25:32.302Z" }, + { url = "https://files.pythonhosted.org/packages/5b/1f/d377b98f63d876649083ce837f0e7cc2eefbfcb4088dc4a1428612ccd741/coverage-7.17.3-cp314-cp314-win_amd64.whl", hash = "sha256:957ba72e11d26b6e6e1abdaa72e41020871f4108c8ff64ff571fc50c81fb57a3", size = 231206, upload-time = "2026-11-12T12:25:33.558Z" }, + { url = "https://files.pythonhosted.org/packages/89/2e/2c1607f6f1505fbed80910d95e51ce520945ad34a640c532123f75de5580/coverage-7.17.3-cp314-cp314-win_arm64.whl", hash = "sha256:f7ff8b21efcbdf9c7a6c051dc158c9bb9e938b7af33e55ed264d2e529b836d17", size = 231047, upload-time = "2026-11-12T12:25:34.908Z" }, + { url = "https://files.pythonhosted.org/packages/11/79/428dc7fe065893833222ef604a261a5e16aa304be055ee99dff0fbb3bd66/coverage-7.17.3-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:3f6d942e066ca009bd1f7ebf5450287a5e9bfc5a6e20a8d8c408a61b433c7f94", size = 229254, upload-time = "2026-11-12T12:25:36.209Z" }, + { url = "https://files.pythonhosted.org/packages/fe/e8/60ce9cf304d2505cff1389a98e13bd67792f44bed530935bcce48db693f1/coverage-7.17.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:e3948b2e5c3af0133af3e117ee033e6cc656c43d7549d3296e4b3807908dec9f", size = 229584, upload-time = "2026-11-12T12:25:37.567Z" }, + { url = "https://files.pythonhosted.org/packages/42/b3/f209433ec9dde9dd4e471afafd6b467b51653af4a678e39792638832c85e/coverage-7.17.3-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:0bad8245a15bc7b15d26d25ece243bbf5d1b1229144f3db189014174429b63bb", size = 269701, upload-time = "2026-11-12T12:25:38.827Z" }, + { url = "https://files.pythonhosted.org/packages/4a/0c/34a2caf1e74950efe9f24de673767ec67fe60470c900610e58fa639366f7/coverage-7.17.3-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:bdf8fefb9f1acb3e92842fb42e29968d053e9545e4e9d9edb5c32a30fab8f899", size = 272171, upload-time = "2026-11-12T12:25:40.298Z" }, + { url = "https://files.pythonhosted.org/packages/ac/1b/1e87f731b4e930cb636cc15bfb55855d52a1f31e9193d645e96ad7ebe0ab/coverage-7.17.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:499acdc43bf1addf7fecc59a3123847bb96873c07001cfbeb709a71b181fa03d", size = 274823, upload-time = "2026-11-12T12:25:41.529Z" }, + { url = "https://files.pythonhosted.org/packages/c8/1f/e6e2cfe9d4f4df4228587b7f528d8b9985005e9f904c2e59ce51d236dbd4/coverage-7.17.3-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:11116ab42247d55980b51ab49b5c066de9b6baa56fe371fd555e54feae338619", size = 276333, upload-time = "2026-11-12T12:25:42.834Z" }, + { url = "https://files.pythonhosted.org/packages/9e/1f/3937e3745b511d67228dcbf15f7f24cec9da7fdacee443ecf837465c1663/coverage-7.17.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:56b469b63d8270aa67bc919ab8457f4d83115459556a76d09238052a3ab094db", size = 269560, upload-time = "2026-11-12T12:25:44.059Z" }, + { url = "https://files.pythonhosted.org/packages/33/73/1b597ea0d77d062ed62d556e3a94c85fb7d3e56cac526d8a273f4e8872ea/coverage-7.17.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:95da285cf77352d4a527e1fd16c1c5c3762e42d1d71cfa9ef2c72a5c796cce36", size = 272118, upload-time = "2026-11-12T12:25:45.643Z" }, + { url = "https://files.pythonhosted.org/packages/60/8a/1daee0aeb0a1d16884f5da92e2cf9300913bb216f42dff221329b3bd5651/coverage-7.17.3-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:c38a85dde92c4129641544aca998382f7448a87a17d202765a6adb8a87a33fc7", size = 269548, upload-time = "2026-11-12T12:25:47.043Z" }, + { url = "https://files.pythonhosted.org/packages/40/d3/78fa95e9980917e2b75b97c056c3e70f9c9c9170fcde210897b4c0b35d03/coverage-7.17.3-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:e9396d4d90fb47a1e124a985ac6a3172dbd58334d1de5189f06b75ae96ff69ee", size = 273964, upload-time = "2026-11-12T12:25:48.222Z" }, + { url = "https://files.pythonhosted.org/packages/14/fa/2870663f070df38497ead9197a7e5af06f00286d5236192ea3d23bda68a1/coverage-7.17.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:e266c693c8bd6541f31cd71eda9b5aa3732adecbd04522880ea3d23d99b202eb", size = 269021, upload-time = "2026-11-12T12:25:49.548Z" }, + { url = "https://files.pythonhosted.org/packages/30/fa/390e1199f21b4c2a8797492aa5351e8b74065fef609b717255cd88e54c5a/coverage-7.17.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0837b71a40749d9c4016cf8c51ba8c6153f7dd40cf4dfa287a2f28376fa50917", size = 270929, upload-time = "2026-11-12T12:25:51.099Z" }, + { url = "https://files.pythonhosted.org/packages/4e/e3/e29ec216a87330812142af2290224002b84804c5361eebe68c57e2ace5cd/coverage-7.17.3-cp314-cp314t-win32.whl", hash = "sha256:8a054b755bc6665b339a923fed14a54446c43c942bf4edf08a59b1225b284c93", size = 230892, upload-time = "2026-11-12T12:25:52.755Z" }, + { url = "https://files.pythonhosted.org/packages/9c/e0/3854a8d843b31a317f251a0fc148c1980dde60f872fce30f6f037dc432e2/coverage-7.17.3-cp314-cp314t-win_amd64.whl", hash = "sha256:fa8903475085973b5c916e8a958afd22101b9559880ffbeab5aeac4196768338", size = 231750, upload-time = "2026-11-12T12:25:53.953Z" }, + { url = "https://files.pythonhosted.org/packages/84/b7/748a7b92e7e7605532754e5718ef3109144ed7e58c0721d0d5c9fa9083a6/coverage-7.17.3-cp314-cp314t-win_arm64.whl", hash = "sha256:582c5d80b6de5b1909a4222ec1f5676bb2e03815c6be9ff43db2d8a71de5079c", size = 231381, upload-time = "2026-11-12T12:25:55.232Z" }, + { url = "https://files.pythonhosted.org/packages/e3/44/8cb5635090ddf8674625f5067c0575ead89863664fff3cf73fb2f93c9287/coverage-7.17.3-cp315-cp315-android_24_arm64_v8a.whl", hash = "sha256:49a4f12eff115fc2447d3438b2c08d7e5adb3abc811c050ee508f8189718cc5d", size = 229920, upload-time = "2026-11-12T12:25:56.587Z" }, + { url = "https://files.pythonhosted.org/packages/8a/54/b7ba20ab94696a790c2703ceb32f10b15f0a70dc2ae19178fd17d4915937/coverage-7.17.3-cp315-cp315-android_24_x86_64.whl", hash = "sha256:e04385647f444d55b483a0e4dc519f46134846eddd80910a0d0953ea19e58358", size = 230038, upload-time = "2026-11-12T12:25:57.842Z" }, + { url = "https://files.pythonhosted.org/packages/ae/57/00c6e8a207674280408907cf4861e925c8e136770d333f5c9ee4dde5dc12/coverage-7.17.3-cp315-cp315-ios_13_0_arm64_iphoneos.whl", hash = "sha256:faee34ea548318f6f9010928edab2f91b36a19b58376e69ab0e76d4f3a0bf9df", size = 228239, upload-time = "2026-11-12T12:25:59.159Z" }, + { url = "https://files.pythonhosted.org/packages/81/ab/b3f996c33524cef1d9bf80fe677619bf17282fefb9f3497da83fabea67cd/coverage-7.17.3-cp315-cp315-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:7c420ffa993c25cc74c263e9c1c869fbaea7d16dcb6448eef4fa6f1905560f5a", size = 228535, upload-time = "2026-11-12T12:26:00.402Z" }, + { url = "https://files.pythonhosted.org/packages/32/ed/83f6e5ef0f7e39deb1d7915c2eb3c8946c002afba2f5f58ae05f870e3532/coverage-7.17.3-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:e592f790fee57e2bedaa27cdc76988a082090d1aac560ca4bbea80a7a58436ec", size = 228733, upload-time = "2026-11-12T12:26:01.649Z" }, + { url = "https://files.pythonhosted.org/packages/d8/34/d256f50c5bf16255ae04aa917ba1857e127023dfd2c06499f777c7a4cd29/coverage-7.17.3-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:59c15dcae783ed291da3af6be2e70762322637ac886b19671d12123521cf6ac3", size = 228929, upload-time = "2026-11-12T12:26:02.97Z" }, + { url = "https://files.pythonhosted.org/packages/35/a4/31617273e938a7d9c7378335cb41e147bc6c293acac8ea643d74b3bc29e3/coverage-7.17.3-cp315-cp315-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:733368982d2799ff04d768916fb755e54d4ce11af3573488ece451745c90d4a7", size = 260825, upload-time = "2026-11-12T12:26:04.219Z" }, + { url = "https://files.pythonhosted.org/packages/10/61/1bd79ec66957f4ea7ce5f687a18aa50f3b3e8715e4843f6ed3e5f03f24bf/coverage-7.17.3-cp315-cp315-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:a13a946d8de807d8992e56a09502952d81bfbb4b80204ef77a6a2a38b4ce22be", size = 264469, upload-time = "2026-11-12T12:26:05.491Z" }, + { url = "https://files.pythonhosted.org/packages/e9/47/db887dff6eaf0a24396021ee4956eac563bd286677252e444f89a80e5166/coverage-7.17.3-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c769e6a28bb645c915449ed8ddf6059765a72d8ef79590bfd6202022a4441cd3", size = 265623, upload-time = "2026-11-12T12:26:06.798Z" }, + { url = "https://files.pythonhosted.org/packages/69/b9/e86863e2ac724844a07dbd165da6912d31c6a2cad99ab23b2c204e655bbc/coverage-7.17.3-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:bf7a43782b20951fe9ddc6f6c28da51c65d3c0d5d5fc3c5a0e566986aa3ec0aa", size = 267981, upload-time = "2026-11-12T12:26:08.051Z" }, + { url = "https://files.pythonhosted.org/packages/72/d0/a3536c347bf036e3aa383c85db80a3ce5f2ca961f8500f46c25ac6a14c3c/coverage-7.17.3-cp315-cp315-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b65db089de3f219c850f21a2ca915f43f6fa1da5bfb55871c089d3be82c10369", size = 261235, upload-time = "2026-11-12T12:26:09.392Z" }, + { url = "https://files.pythonhosted.org/packages/7b/26/f7c1a5c62c66a4ceccb9889eb7fefaca6c34fc72f47553ffb134262533cb/coverage-7.17.3-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:228f4bcecadcbb1ec3ed088b0595c5c08f3fca01406b72e8a02209a3af16aff9", size = 263461, upload-time = "2026-11-12T12:26:10.684Z" }, + { url = "https://files.pythonhosted.org/packages/45/4f/51a9d4af3dac74e146d65e0b696a98eaad7badc3837e42fa386c8ef96c55/coverage-7.17.3-cp315-cp315-musllinux_1_2_i686.whl", hash = "sha256:3a5691ef42b16e22976ec0352a76a0f7c3b4196fe3d39805dcc765e31ce54f22", size = 261436, upload-time = "2026-11-12T12:26:12.421Z" }, + { url = "https://files.pythonhosted.org/packages/e5/bb/6bcac633b71c1e675d9bc7ba97e9b28c32a3309db57185ce5af35176b1c7/coverage-7.17.3-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:2765261bdcb5f6c01af41d97ec4fcfe18acd1114d8d2690536a36f86b67c179f", size = 265926, upload-time = "2026-11-12T12:26:13.684Z" }, + { url = "https://files.pythonhosted.org/packages/d4/6f/fc1007053178d2fbef0a89014a60e34a8b7a9e831d2f78301a55f0cbf644/coverage-7.17.3-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:45268757a45946ab3fc9d2c30019aff2d3804ae660121d5b31f523366f604e67", size = 260770, upload-time = "2026-11-12T12:26:15.247Z" }, + { url = "https://files.pythonhosted.org/packages/44/e4/90fee6c30eacfd84d6969223f823e4d14f02a07df9ad91e5de2b3fd6c466/coverage-7.17.3-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:24389d7d50f1fe98ac8d8ec1c946656a75b97d953b51a714484e174ed9f48eb1", size = 263276, upload-time = "2026-11-12T12:26:16.551Z" }, + { url = "https://files.pythonhosted.org/packages/3e/03/4108b8e1f428dd511a422510fce64aae0afa7b7350f73a55f6d6d5812d7e/coverage-7.17.3-cp315-cp315-win32.whl", hash = "sha256:ff0ca078fe63faffff1cff24c804afd4010e35d9c75bb593877b3d4321826c91", size = 230578, upload-time = "2026-11-12T12:26:17.793Z" }, + { url = "https://files.pythonhosted.org/packages/95/46/e213941d820ab8e2ba788177569e781c50381bfd9ddb35d50f5f63d096cb/coverage-7.17.3-cp315-cp315-win_amd64.whl", hash = "sha256:f8f6252bb4c457d686c18e42965087b30155ff72b0dbda6e79a43ee3682c0870", size = 231196, upload-time = "2026-11-12T12:26:19.172Z" }, + { url = "https://files.pythonhosted.org/packages/f7/4c/703768310ea21b513fdfd42d114447f0a335b763d70aacd54f8ecbc1e59a/coverage-7.17.3-cp315-cp315-win_arm64.whl", hash = "sha256:5559549a14f997b261c936ca463ed67e030511f914ffd1692ad08b3b16ed6034", size = 231046, upload-time = "2026-11-12T12:26:20.477Z" }, + { url = "https://files.pythonhosted.org/packages/5b/4c/e27066a48746f622abc8ccf941917294bf46ee87077427d9a22aa98a74a3/coverage-7.17.3-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:b6db3399e76a366353dd0c9a009fe74c3d1c892de35863331c4d06fbe0dd83b8", size = 229243, upload-time = "2026-11-12T12:26:22.109Z" }, + { url = "https://files.pythonhosted.org/packages/38/29/129c10c8b1555ece4aaa9ad197769abda281bc204d7b055bf85681e12e15/coverage-7.17.3-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:47e49fced11190fdc678182b0e7f8947db4fc1c1216094923a1d2bbedba3c84a", size = 229600, upload-time = "2026-11-12T12:26:23.372Z" }, + { url = "https://files.pythonhosted.org/packages/11/91/4cd15480a1d6bb7102dfd42c03197034aff1cb0f12b3791ed6e14872c2d6/coverage-7.17.3-cp315-cp315t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:fb5945d7360fb258dee758258d93ea624a712fae494e7a0037a92505b3eb8b32", size = 270046, upload-time = "2026-11-12T12:26:24.615Z" }, + { url = "https://files.pythonhosted.org/packages/1e/b0/b7db33135f973cba720c20d8055c26177217cd07c4e903fc24a71715be0e/coverage-7.17.3-cp315-cp315t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:47cd7674a39bad6480e565e2a5b77f8089ebfbcd3aacc572abc6cebabe1f4cc9", size = 272815, upload-time = "2026-11-12T12:26:25.864Z" }, + { url = "https://files.pythonhosted.org/packages/a1/ea/207ab861d69f4008d90d193ab5e9d5721ea2a75ec4a1e826720519142795/coverage-7.17.3-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ff5069e99039739c2fade5dd12cf8df7dc1b1217a0b915110605e0bbdddf1187", size = 275531, upload-time = "2026-11-12T12:26:27.096Z" }, + { url = "https://files.pythonhosted.org/packages/a9/6e/d5144a94a9758d25f3d9143b86a0ab04feded2a30d8c9365c646d504aea9/coverage-7.17.3-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:b7028eabf24ad18646dbfc6b352cece01779914e69254ddcacdfb9f805d89f61", size = 276906, upload-time = "2026-11-12T12:26:28.311Z" }, + { url = "https://files.pythonhosted.org/packages/e7/b4/8328eaa253b44b081e25236abb4717f7afd37ecae02cc6ca77d853efdde9/coverage-7.17.3-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:349ab42e0b6b72892f187a60a0890b3a76710e93b7c31579e81648d46230a8ed", size = 270557, upload-time = "2026-11-12T12:26:29.969Z" }, + { url = "https://files.pythonhosted.org/packages/6b/bd/22effefa744acb7cac84addd7d619538c7604fe7d7b6fe3b989ad6f60fed/coverage-7.17.3-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:397e5342fd4f19ae930a5234643a63a8eaccc18a2f034a2f1765a5313123489d", size = 273009, upload-time = "2026-11-12T12:26:31.591Z" }, + { url = "https://files.pythonhosted.org/packages/a0/b6/5e1a93260f8524832bd5781108dc38497d7930bb451014350ce61b22f848/coverage-7.17.3-cp315-cp315t-musllinux_1_2_i686.whl", hash = "sha256:8009572d242674765b84ecceba126c2392b1824b32f41db1f3323d23d4cb598f", size = 270006, upload-time = "2026-11-12T12:26:32.85Z" }, + { url = "https://files.pythonhosted.org/packages/25/35/e7ccdc8675afd66c4c9310e883c255dec3277fdff65c640ec0ac531b1f9e/coverage-7.17.3-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:dc116b251f7a4ae0266dba0ef31a742c6c517d3a99b4d50016548a17d407ac5f", size = 274755, upload-time = "2026-11-12T12:26:34.058Z" }, + { url = "https://files.pythonhosted.org/packages/1e/a3/d8c76a38363e59654516041471cdc5b325fa22835a87d5213e20553454fb/coverage-7.17.3-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:b73148d024d086239fc04c03daaeb1934a6d295312dd0d6a04a937326c1207d4", size = 270158, upload-time = "2026-11-12T12:26:35.772Z" }, + { url = "https://files.pythonhosted.org/packages/0f/e9/cf0fded465f8d9a238d6b4fa4908a84f08ae483b3d4adddbd9668dc09ab0/coverage-7.17.3-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:7f02996b09190bcdee3b2af38bf2279e4a1a65306afd3e6c229029dbe41e42ea", size = 271819, upload-time = "2026-11-12T12:26:37.046Z" }, + { url = "https://files.pythonhosted.org/packages/ac/24/fcde10f418dec10e647c1d697f5fee500605adae2a0105fe772ed6dfff17/coverage-7.17.3-cp315-cp315t-win32.whl", hash = "sha256:80e219a51ef7ccf78fcd584257e523ece0d390cb3d9d3896660eac05a19ac691", size = 230874, upload-time = "2026-11-12T12:26:38.293Z" }, + { url = "https://files.pythonhosted.org/packages/80/bf/095490c7d43ba2e38eb0c4af31a37beb1f2347c4765613e39f8587c5f00a/coverage-7.17.3-cp315-cp315t-win_amd64.whl", hash = "sha256:86563b5323fc13239d943b22a1bb9ec60f9ca17bd9a0be09c40a89836697aea2", size = 231735, upload-time = "2026-11-12T12:26:40.717Z" }, + { url = "https://files.pythonhosted.org/packages/1e/f8/21db698c4785e3604755415aaeaa49bf00220c210f09c06dd185fce6f986/coverage-7.17.3-cp315-cp315t-win_arm64.whl", hash = "sha256:f8356475aba020621f8277f1a81c2dbdbda8286c7c6130f242c9816e044062a9", size = 231374, upload-time = "2026-11-12T12:26:42.14Z" }, + { url = "https://files.pythonhosted.org/packages/d1/8e/f7d7e69e2ad34ce08595b787eb578f669c00fd57d432ed4c7cfd71666f36/coverage-7.17.3-py3-none-any.whl", hash = "sha256:21745c08f2835b847a16887b748d3084dddeb0571ae2a0d62e33644413568b99", size = 219999, upload-time = "2026-11-12T12:26:43.553Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.3.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/e1/2069291243c926a2ff1cd706c7f3eeb9b62144bf60f77c9fb9ff2fb26bd3/iniconfig-2.3.1.tar.gz", hash = "sha256:67f4b9c50da0dedf52af349e7749a80a9057a5031199791b906c3bb3ae878960", size = 21209, upload-time = "2026-10-06T22:48:38.076Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/56/43/4ca9e49d27a1fcf6bece6f6aec0ea46bb9112489b93d4b688fb415457bdb/iniconfig-2.3.1-py3-none-any.whl", hash = "sha256:9121e2c1fdb355232495be3194c8dfe87ccc2d5dee45947b78e68f499790d7a7", size = 7552, upload-time = "2026-10-06T22:48:36.959Z" }, +] + +[[package]] +name = "librt" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/04/f5/9dc696772d241814bacac7880bac32f2930b5a6ebc1f85317b83161a011c/librt-0.16.0.tar.gz", hash = "sha256:ac38d6d8d66bf3d744148dbbc0b8e193e195a51e364ed55e224631f5721891fc", size = 219839, upload-time = "2026-09-29T00:55:32.891Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ba/0e/b04fd2d76b6a78a02286938251b2c119fb36ddece92c76cb4886ef7d44b8/librt-0.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:fe4372c52d4849096c6cc1cda2817d293ec51440c890474ed59ef38d46556f18", size = 148058, upload-time = "2026-09-29T00:44:40.903Z" }, + { url = "https://files.pythonhosted.org/packages/a3/fc/e1ed24aadb32d38603c0c07f579d739eb4d90e64e90d525b024e4a999b4d/librt-0.16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c72c5295a84bd249526da9bdca38f2e176d15c31c13bb0063c5053f4ca023421", size = 153073, upload-time = "2026-09-29T00:44:42.165Z" }, + { url = "https://files.pythonhosted.org/packages/be/38/133ab655409420e0c34a9a9836a7f4e5ae75fba758d7fe177099130d58ba/librt-0.16.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:be56ba9c884143495b517f23fe794ae367d58cd89ea0fdd6d437e3c024a87f9f", size = 493052, upload-time = "2026-09-29T00:44:44.043Z" }, + { url = "https://files.pythonhosted.org/packages/94/42/aaa663bc9421f5bf7bbbe9d3316d7219749698ec7688ac3b519770a89c04/librt-0.16.0-cp311-cp311-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:ef46c1a29ffb8c72e882e22618ec618778eacd0578fb22c6e7cf9c11d15f357b", size = 485506, upload-time = "2026-09-29T00:44:45.479Z" }, + { url = "https://files.pythonhosted.org/packages/7b/59/83a6eb5087ba8b45b083859e2085256963e06d4c2531944cdd962670bfb5/librt-0.16.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:d3c94211ee0c4f8d649ec06b7c115c0ec4eadb873a0e3154ca15cef3f814b071", size = 498708, upload-time = "2026-09-29T00:44:46.916Z" }, + { url = "https://files.pythonhosted.org/packages/a0/e4/15a8d62b2bc12935080ec7277e2e0b9b233047781eb784a51d3e25af669a/librt-0.16.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:94aed6a8308818b91677957d1bd03188869cd7aeb23c5dba7912a6c0402f7602", size = 515981, upload-time = "2026-09-29T00:44:48.316Z" }, + { url = "https://files.pythonhosted.org/packages/46/4f/287cc282ac5dd815204c0779e79401bb0a568c3a1335fb319bf0838fb566/librt-0.16.0-cp311-cp311-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:349c0bcb87ebd07481b6ff781e25cdc699723dbe2212e57dabb27f7a13b7b87d", size = 508670, upload-time = "2026-09-29T00:44:49.726Z" }, + { url = "https://files.pythonhosted.org/packages/bf/5b/ab7292add898ade0d2b5b75d32a923aae315861671aa5c39f5491309f7ae/librt-0.16.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:001bfd59a7d45b17e3e75f2a8c6405280b35e7b84471792778e718c4f368950e", size = 530393, upload-time = "2026-09-29T00:44:51.356Z" }, + { url = "https://files.pythonhosted.org/packages/7a/9e/8e6bcf027d4bcbc16a4e864b3d158a1d3e5f55ffa53af0238020cad89271/librt-0.16.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:28e038895b998d7a0c7798922ce8a1dc157675df5cf1c9ef0aca809ed804b7a1", size = 534302, upload-time = "2026-09-29T00:44:52.893Z" }, + { url = "https://files.pythonhosted.org/packages/96/a4/8c5ab4f3b3a8e905ff8305d76976a2e666f52fe049edd398aed2402beb36/librt-0.16.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:0dbe4096a7ecc00fa835d24510ad8545a4efef738dac96e0e63516783ccde905", size = 536150, upload-time = "2026-09-29T00:44:54.421Z" }, + { url = "https://files.pythonhosted.org/packages/ea/5e/7c4bc267e3cd4b8bd288de9f62d61fff203829c9cc649ea2aa12e9218cf0/librt-0.16.0-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:5cd5b092441053364af968ea12084692cb9d4a22f3ce9524e377880bf028761e", size = 514316, upload-time = "2026-09-29T00:44:55.998Z" }, + { url = "https://files.pythonhosted.org/packages/e0/75/c8bc6b50f43c73819334233f5a3259c81216742cef56d2140c3dd377c3f0/librt-0.16.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3ddeb3c9dedb461bb457c6c7d9aa7fbf35329da313d1a7543d00c8d0f3473c96", size = 557731, upload-time = "2026-09-29T00:44:57.581Z" }, + { url = "https://files.pythonhosted.org/packages/93/fb/e241f91bc8de6c7ac1c6a20ea6dd381bc52312b44d711ffcd97140db1e57/librt-0.16.0-cp311-cp311-win32.whl", hash = "sha256:e05108e0849966f53a8d2d3112a7af881d0efaa479bc735bba91108f9f2350a7", size = 104922, upload-time = "2026-09-29T00:44:59.078Z" }, + { url = "https://files.pythonhosted.org/packages/d1/38/c892383d2bb1a6a80b2ec8ede84970a265a792c56614a06282bf3008517c/librt-0.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:5f49cff01bd608ef7d97104cb035c75455e79c2d70bf4a506cf773338ac1860d", size = 125093, upload-time = "2026-09-29T00:49:01.621Z" }, + { url = "https://files.pythonhosted.org/packages/e4/56/8bbde1ed0b21480163617648f638fdaec9374cf5e9c846ebcee34ec02a42/librt-0.16.0-cp311-cp311-win_arm64.whl", hash = "sha256:1d28ae980ae2218f9c5b95d191e947296f918c9bf0b400d467a9430275bbe678", size = 115910, upload-time = "2026-09-29T00:52:40.131Z" }, + { url = "https://files.pythonhosted.org/packages/ad/76/bbdaeb87b7c47b5c7343e90222b9bfa4e4a8a83f647e02933ad0129225b1/librt-0.16.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:fe52bf4641069e7978a14253b036cb9002def1926317e710f2e249f8a8c47742", size = 151028, upload-time = "2026-09-29T00:52:41.508Z" }, + { url = "https://files.pythonhosted.org/packages/fd/0c/ab8ed3dab0085931aec4a792c7eaac8dc6c5ff4691fda3a5360d9d8a9cd2/librt-0.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5bcc2c4726ced915b00de0c9856a4eeabfb3fddb93e10e0b8f735b7709358b6d", size = 155283, upload-time = "2026-09-29T00:52:42.873Z" }, + { url = "https://files.pythonhosted.org/packages/eb/36/494e79d460c80c1f030661e8287c9eca5e1ad652dc2b2180b6cd42abce0a/librt-0.16.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ff7baa55f8e7c69851419e50a666015d02a74198716fd45c0125a2112e0a389f", size = 503185, upload-time = "2026-09-29T00:52:44.638Z" }, + { url = "https://files.pythonhosted.org/packages/9b/34/a8464038dd9db6e4381fa2b6eb73dc9a50888d77102c4c139304ac35cddc/librt-0.16.0-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:b95d5d92ab83d39e760a52091bb1baba664f3a2351e39b1e16801e5747c2f0e9", size = 496738, upload-time = "2026-09-29T00:52:46.441Z" }, + { url = "https://files.pythonhosted.org/packages/6a/53/e0e5e334ef0c6ed27039d323819368b9ef6712be87d55ee2bf9799398afd/librt-0.16.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:b6d085d70bce51d43c5c7c36d63490770180d8779e71c49305c87b4213918de7", size = 513818, upload-time = "2026-09-29T00:52:48.068Z" }, + { url = "https://files.pythonhosted.org/packages/ad/f7/7ce72cbf19d0addd05090b339152fd0548a02562c2866a603e6e3b3da2df/librt-0.16.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:36e53948e99bbe3ffea257124cfcae1cfb01831555c9a9c903c9f9a72db7fd07", size = 531952, upload-time = "2026-09-29T00:52:49.816Z" }, + { url = "https://files.pythonhosted.org/packages/83/22/0b1bcb6a8e723c8b4fd60dfc8ae8ec6461c54073fbc8685efeb8d900d407/librt-0.16.0-cp312-cp312-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:54d11f726aae9df5a6ffbbf0a03a52449bbac84a53ef03669cb41cdfd4ae41bf", size = 524465, upload-time = "2026-09-29T00:52:51.354Z" }, + { url = "https://files.pythonhosted.org/packages/64/2e/e9c23b8b9df1813da1be205deca9606beb7ddd033972246cd426d05374a0/librt-0.16.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4323193ac0cd025f85af531df8ba91bf24d1973b401697347a6282e8fd3fcf5e", size = 543191, upload-time = "2026-09-29T00:52:53.284Z" }, + { url = "https://files.pythonhosted.org/packages/bc/e5/6a8b21b342c03ed7e230fa3afbfd2edc58e6e87ef1f0d11fa2b9a748c252/librt-0.16.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:e42f8e098b9c5396fefa05fb1cc7e33b0e08fc51da106b5de4a45fd22aac6743", size = 546979, upload-time = "2026-09-29T00:52:54.932Z" }, + { url = "https://files.pythonhosted.org/packages/84/9e/b5129023eced1be01e01c22757f53be551d463b1bb7264f787927404c1d6/librt-0.16.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:39ec1d5a14e37baf1450a6cabf03fe552340808bf1ad9d71824ab90117716459", size = 555317, upload-time = "2026-09-29T00:52:56.869Z" }, + { url = "https://files.pythonhosted.org/packages/71/89/28bba5938c725fe91f06bf93f7fa6c6b150229df53a87b454b0d5c2a796e/librt-0.16.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:d1aabe3925cbb4a08d15b7b20ba4011b53019da0c4173a25155139b7b1baed65", size = 535846, upload-time = "2026-09-29T00:52:58.475Z" }, + { url = "https://files.pythonhosted.org/packages/22/92/63773026614f888c5d4e370e395ce42ca604b89f70b3acdfedbf94851b80/librt-0.16.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:300c3ffdc459f4a779a8411ecb188e3ac0b1ff3a3a7b099642555dedae06c69b", size = 573700, upload-time = "2026-09-29T00:53:00.127Z" }, + { url = "https://files.pythonhosted.org/packages/66/8f/347d4677eefb57cd9f8e01d95a1dcee9a91b4e44e664173c32ff6f3752e5/librt-0.16.0-cp312-cp312-win32.whl", hash = "sha256:c17194318e4c0c0348b36f36c2ec7534436fe0a4c15582403162a4f08c80797a", size = 106158, upload-time = "2026-09-29T00:53:02.031Z" }, + { url = "https://files.pythonhosted.org/packages/f0/2c/5193dc81127cd5ddfad031391b046bf32dda219b38463ab872407ca30646/librt-0.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:25a58a19ea8d83b68209f04912df765e9260635ef77646542ed4b4abe6bc7940", size = 126176, upload-time = "2026-09-29T00:53:03.445Z" }, + { url = "https://files.pythonhosted.org/packages/ff/3d/9668a400c8dd81d162eba38b33fa49fa6205f1a64493570a13fbb815c3ee/librt-0.16.0-cp312-cp312-win_arm64.whl", hash = "sha256:f7be7cf555bc30ec12622e9447299cc4a9b8ff307548b634794353db0c2065dc", size = 116572, upload-time = "2026-09-29T00:53:04.815Z" }, + { url = "https://files.pythonhosted.org/packages/46/cd/ae5e0e9dba45d1399aa04a5395bcc0bead40d9fa06dc903634a7b4d7473d/librt-0.16.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:c5e6144e68b577f157519f2ba88ca20e3ed61c29b00e5cdfa76cd2d45acf059a", size = 151036, upload-time = "2026-09-29T00:53:06.284Z" }, + { url = "https://files.pythonhosted.org/packages/41/5a/48a16e323c5f9447a94cce7b59babf60fa04e62c3365ecf060c77ed8b320/librt-0.16.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:33f41443a1f4e1f099331b3d8120e409fbff84b9760bc1cc9ea496f37ddaa5cc", size = 155211, upload-time = "2026-09-29T00:53:07.72Z" }, + { url = "https://files.pythonhosted.org/packages/3f/29/0f59299eb4251a409b2e690ad4b7d9f8a676db829d7817ec961f32b44f7e/librt-0.16.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7e510b7770bee609617a3374a96548eb114cae048023e3f049ee449e7ff2db32", size = 502587, upload-time = "2026-09-29T00:53:09.191Z" }, + { url = "https://files.pythonhosted.org/packages/de/ba/d6fb4ef8d1537c396079d72289f16be7cd35a366e5065c51253fea2760b6/librt-0.16.0-cp313-cp313-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:efc49c462d4516b8a58b00b490078fa64689fd1fe66970cc190131d7afb8027e", size = 496146, upload-time = "2026-09-29T00:53:11.016Z" }, + { url = "https://files.pythonhosted.org/packages/52/fc/8c50dd4d7cc97c0ee8f252c8a3104980f234391cf1519b554e8b9de08b60/librt-0.16.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:92caf82ebef5e12d21c72242b70d1e92536f1711cf2a727a4c276de4b4469087", size = 513336, upload-time = "2026-09-29T00:53:12.655Z" }, + { url = "https://files.pythonhosted.org/packages/a9/59/16c409c56f708eda2db9a0553662845d45e3871c77d70a240dae3f3bdc56/librt-0.16.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:17bac7f7a16b328fff77e440287693eb017abde913595b5827ebccbc21ecd8a6", size = 531689, upload-time = "2026-09-29T00:53:14.39Z" }, + { url = "https://files.pythonhosted.org/packages/88/82/d34772a6c29d1446dcca6e64d74062efd508523ab351aa16625a4689d5cc/librt-0.16.0-cp313-cp313-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5b976054553670829985ed767feb78fb6bcede0175327c4844dd5c281c1be659", size = 524537, upload-time = "2026-09-29T00:53:16.064Z" }, + { url = "https://files.pythonhosted.org/packages/77/8f/24c5631313746131ccee53bc91fdc8374f9cf25e0082a1fee9c93bb98acc/librt-0.16.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0058f9d68721094105917254c72ac0569117bb7b13b9769cf45d26d89f9d21cd", size = 543231, upload-time = "2026-09-29T00:53:17.939Z" }, + { url = "https://files.pythonhosted.org/packages/f2/cb/5f8e0d41dbd8b499c2265e939c31acc9ba59845565bf99539ad1c06aebcf/librt-0.16.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:30b7beaf3f4487b7d8adef1f158b49067cb4d5a19fa7a3bf31a4e7a820e435c5", size = 546499, upload-time = "2026-09-29T00:53:19.666Z" }, + { url = "https://files.pythonhosted.org/packages/be/61/063052de441d1385f59cea4223f184bf9e5d125de1ae3239b490aa1e486e/librt-0.16.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:468df902df016a06eb0e40b0747dc8d14e47d7a38b18b63b1fb167d85cb94d63", size = 555261, upload-time = "2026-09-29T00:53:21.292Z" }, + { url = "https://files.pythonhosted.org/packages/14/11/a2ada0529372268d6401afa9d457a095b68cd7753532b6f7f33049a19b43/librt-0.16.0-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:aea7b1f2b125dad5de85f049136651bff256c883c65e6b9209b2da0a1ac3cdef", size = 536029, upload-time = "2026-09-29T00:53:23.07Z" }, + { url = "https://files.pythonhosted.org/packages/23/9d/5bb6d38853382986dca702fc7e06c8256d30f5fa0676d882773b744610dc/librt-0.16.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a8afb6557920860b7a3a596eb804cf37e09e7cf8a803db2478c202acc72d8c2e", size = 573748, upload-time = "2026-09-29T00:53:24.696Z" }, + { url = "https://files.pythonhosted.org/packages/99/f6/0025cde35ff7f607684dc775a2b2d732cce2561cec050a6ee1fb2e1fc6fe/librt-0.16.0-cp313-cp313-pyemscripten_2025_0_wasm32.whl", hash = "sha256:77c7a2b4fe2c1369e0d5aa1cade26740a7b14be32fbc9a5535d617d20065c39d", size = 79861, upload-time = "2026-09-29T00:53:26.089Z" }, + { url = "https://files.pythonhosted.org/packages/93/93/303b8592909bd583f83f02818ffbea3f7647ca1e22b1cd5465d04b8145fe/librt-0.16.0-cp313-cp313-win32.whl", hash = "sha256:02d89c813d5ff74b17df72d3a34819d132cd168e56b81bf755b809bd9e46b8c4", size = 106236, upload-time = "2026-09-29T00:53:27.43Z" }, + { url = "https://files.pythonhosted.org/packages/cf/24/80bbb463c60ed18e29cb26aba386ddb76609580e4e7160710e550587018c/librt-0.16.0-cp313-cp313-win_amd64.whl", hash = "sha256:14ed6ebe3e4f85f326d7920011ad30ff49ed9334e62cf88caef9ba973d9e3a92", size = 126180, upload-time = "2026-09-29T00:53:28.7Z" }, + { url = "https://files.pythonhosted.org/packages/43/80/b1a6fbdd7da825cdd55c71aa81eb6cfa82c513c360774152eacb50b4a771/librt-0.16.0-cp313-cp313-win_arm64.whl", hash = "sha256:83d4041a3d9b2fd053a8a4e1f22878b3e5833e2712956382d5c048d791454e91", size = 116557, upload-time = "2026-09-29T00:53:30.012Z" }, + { url = "https://files.pythonhosted.org/packages/1e/93/9e0cf7da129a93c3dc7f45bc3cd4a660f2aaa995aa8a6f95c2583ef41239/librt-0.16.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:931a0bb0fcac88f263e269e46eb30ba8e21402cd3c62ca40cb97034c0693fab1", size = 149844, upload-time = "2026-09-29T00:53:31.391Z" }, + { url = "https://files.pythonhosted.org/packages/8f/26/8a90d2a8f2b2e471bb486b7aec117b8ae622715ed6c39853aec48ea20073/librt-0.16.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1bc17e54e5305f8d40b7ca203671ff5a9e59c1d0f8ea0f625dcca53a3984de11", size = 154111, upload-time = "2026-09-29T00:53:32.718Z" }, + { url = "https://files.pythonhosted.org/packages/35/ce/67abb46258da4d3e42ff5b141db6f38c59357bef84c7979f183b22f924f1/librt-0.16.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:877698bf6bca5721d8be345f2fe09778e40ecadea8b58c73075f2b1a53666bf2", size = 494234, upload-time = "2026-09-29T00:53:34.466Z" }, + { url = "https://files.pythonhosted.org/packages/12/f9/ea7162414a16f8f1bbd3b493ad6d22b926c5471916e078350bdbca8c4e5f/librt-0.16.0-cp314-cp314-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:5981c011b306781ce561e18e14230a14524a3d8109b97553666c942c18f31a96", size = 491173, upload-time = "2026-09-29T00:53:36.124Z" }, + { url = "https://files.pythonhosted.org/packages/b1/09/9b3e869060dd33f9989b80ba4fea306f6db8cecefcdfe6d7346ef0603f65/librt-0.16.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:afced3dfc17cd805ecf7a3d77996a71cf5f2c75aa66eb0c21a9930f4fc992f86", size = 505547, upload-time = "2026-09-29T00:53:37.686Z" }, + { url = "https://files.pythonhosted.org/packages/50/07/79007d2165f649ea93e08c0962d1d62c70af9cde77965255095bf9d96f9a/librt-0.16.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ca8052401c55d7511dda6760719fda7618067e83535d7d0010096d216c34b667", size = 523057, upload-time = "2026-09-29T00:53:39.301Z" }, + { url = "https://files.pythonhosted.org/packages/61/0c/8fbaff66d0ba376d8864653f5acce1569bae27e89648671f26f7eca67ab8/librt-0.16.0-cp314-cp314-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:1e511762a074005bb0aa569166779834e75e438370226930d0ce1866d4b6a33b", size = 515158, upload-time = "2026-09-29T00:53:41.012Z" }, + { url = "https://files.pythonhosted.org/packages/df/2e/23ff0dece76f07a4124413a57682efa0bbeb5765ac0122bc0955513f82ca/librt-0.16.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:f1e8591bd8a5a628cd7f07954c6a1592359a878bf032957a8e9057a41d644311", size = 534183, upload-time = "2026-09-29T00:53:42.451Z" }, + { url = "https://files.pythonhosted.org/packages/26/c4/e11dea21d9a29486eba78887380374189d472734fa32cc50cb37ca44d3d0/librt-0.16.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:a4aaefb4ba6c07e1aeebb2795c8958148f1d6f9af3b555b53d23d766edb6d67a", size = 540663, upload-time = "2026-09-29T00:53:44.272Z" }, + { url = "https://files.pythonhosted.org/packages/44/75/e873ae158a8b7f5359be33e7fd6c1fbe02d9a78a3e89a77de6b0e837f476/librt-0.16.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:d92db7a0f6aee44f1baee94750457e8d2d1c6ccea41842de6268d34e8dc7eddd", size = 545908, upload-time = "2026-09-29T00:53:45.812Z" }, + { url = "https://files.pythonhosted.org/packages/ba/36/8939d3f6a93e11bd9592e6fe28d2b44f1c2dc4bed6e22e72359a91e18ffb/librt-0.16.0-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:378dfaffb38e59c24a87cde5713cd865d51ff7383fa12947f3907f306ea1ca55", size = 523302, upload-time = "2026-09-29T00:53:47.596Z" }, + { url = "https://files.pythonhosted.org/packages/71/14/35309f44a077f0f42ade0e2e7cd88c0cea760c661af205c01ea90d3c0e1f/librt-0.16.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:3e0c39bdc85370422e8b637be76eb1fd07d30967551b03e62267dd156f553152", size = 565911, upload-time = "2026-09-29T00:53:49.278Z" }, + { url = "https://files.pythonhosted.org/packages/78/0c/df6255b94967f3159ebc46f08d8e783c12da6ee269ddb74b2efed63c640c/librt-0.16.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:1b384b90ab79a7bc30b566895809a636e0666f21f3cf12b54823d025b7e83839", size = 79119, upload-time = "2026-09-29T00:53:50.938Z" }, + { url = "https://files.pythonhosted.org/packages/6b/44/d30d5a5461378c9d33f36736c6791c3b4c4ba4b1ffe0da7350aedcb2c9a0/librt-0.16.0-cp314-cp314-win32.whl", hash = "sha256:52327da75a94012e7f932f913d20d3876bed3c102be00e6c3e8600ff7bdd58a7", size = 100140, upload-time = "2026-09-29T00:53:52.205Z" }, + { url = "https://files.pythonhosted.org/packages/c2/98/769712f356a1e897df3581bb0c3100375d054a000de26099360ea65b5111/librt-0.16.0-cp314-cp314-win_amd64.whl", hash = "sha256:3f0b8114c44b2ac06ff5dacd08e07e8e807ff4f46083f2a1602685122559be41", size = 120464, upload-time = "2026-09-29T00:53:53.495Z" }, + { url = "https://files.pythonhosted.org/packages/bf/d3/ae2abccc8bdc8b063c1613a77686e17b74e9d3d60cfe6f12c63fa2821b9f/librt-0.16.0-cp314-cp314-win_arm64.whl", hash = "sha256:8caf96a4ef8fb27d0ac0d1ad8337d26a240acd4a02fe4345d0a8f264753e8f99", size = 110889, upload-time = "2026-09-29T00:53:54.817Z" }, + { url = "https://files.pythonhosted.org/packages/e4/26/0737d4be058dd6376eade7dd8b380d4b869b6394cee929393a5a431c45bb/librt-0.16.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:953107e2f68d0f3512c48f898b0dbf0ce5cc52bba0f318d847c985dc555ee4cc", size = 159838, upload-time = "2026-09-29T00:53:56.22Z" }, + { url = "https://files.pythonhosted.org/packages/01/96/9bc96531d7c620e9949af904470f02e3fa8f35129ab8e8f281c51eaa3788/librt-0.16.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ad37d5b9abd49c9a655dcda7ea52a8a752884062ef1ee71ae17c2f2a0f81fe6a", size = 162018, upload-time = "2026-09-29T00:53:57.532Z" }, + { url = "https://files.pythonhosted.org/packages/0e/fa/b0289dcb186eb3f97221ba00da5f4bd3ba7fa5e99752d48aa8d336615334/librt-0.16.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2c4aa329c17bd1aaea4f6e89335d8ccd494b3a5830b6654462273e50e11023f0", size = 703983, upload-time = "2026-09-29T00:53:59.024Z" }, + { url = "https://files.pythonhosted.org/packages/d9/ab/05ebbbde7530fc5eeb58fbd1581522a9f64f132fa703c4c595eed6e14760/librt-0.16.0-cp314-cp314t-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:0ead24d2562a49473dddd9efef8581f020007eb0054389c3ee3ffad38b1ca4c9", size = 683847, upload-time = "2026-09-29T00:54:00.671Z" }, + { url = "https://files.pythonhosted.org/packages/a3/75/f52aeecd4dbadbddf80725ba7de126d8bd5d0eb66247eae17a81ed90dd4d/librt-0.16.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:02118f56a9c36ddd07dfd9b919d9ecc117ba20a90987d56aa4c429fa34509188", size = 698045, upload-time = "2026-09-29T00:54:02.247Z" }, + { url = "https://files.pythonhosted.org/packages/e6/55/fa277a835cd6eb42380591ceb85f48c5b4d2b2d7e2cb9869e1e17d24d237/librt-0.16.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4e29522c62e28595ff7e324c6834ade51127707f0e255b18d1c1cf03d39c1048", size = 724640, upload-time = "2026-09-29T00:54:04.078Z" }, + { url = "https://files.pythonhosted.org/packages/25/e4/2cf64354f3fde8ebd591b3b48f96510bee24ac5f7d1e567adbbe210abdbd/librt-0.16.0-cp314-cp314t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:3ff4b2367926b69c6215635902cccb04048e73094e9862900d27cb2c6bbff143", size = 731748, upload-time = "2026-09-29T00:54:05.741Z" }, + { url = "https://files.pythonhosted.org/packages/f8/c9/c180af3e94e01aa529fa93d7733fec2abc47f222345400cf21d5481d5f8a/librt-0.16.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:c6f1b27bf1632a7e016af9f145f82be95e1edd7721a646505c21059257cb5a04", size = 754960, upload-time = "2026-09-29T00:54:07.38Z" }, + { url = "https://files.pythonhosted.org/packages/95/d6/01073aa78c58f356b10d9c57b3fe9abb143df338142bcd316df417b89db0/librt-0.16.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:5696d7f52e7b37217cb3a8f92c744fe835942602fdd4c1a8bc4741d3bfdce15e", size = 747000, upload-time = "2026-09-29T00:54:09.06Z" }, + { url = "https://files.pythonhosted.org/packages/f7/d8/1de3783908658d697a8cfc00582f61299ffba7796d7260c112e4700b1109/librt-0.16.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:6072e92dd876ff6ceeb6cf371e35e51f479349837391341f479b08df4564242b", size = 749569, upload-time = "2026-09-29T00:54:10.702Z" }, + { url = "https://files.pythonhosted.org/packages/b7/32/e817f66c96d6caa8bb8435ff93c4c220624d59efc506be59ab98fcd01d0c/librt-0.16.0-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:39ca4f2f2fe05de8e63493da592d84311adabe5bef52b193851981da9816b302", size = 729483, upload-time = "2026-09-29T00:54:12.25Z" }, + { url = "https://files.pythonhosted.org/packages/7c/c9/23992ccd2b9d22798fdd0f61353183a47414e651da782ad83eb680f50833/librt-0.16.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f9807485a908f00355820f18e91e045ffdcdc5adb68aaec40a1e2b88c5f7bba1", size = 776584, upload-time = "2026-09-29T00:54:13.837Z" }, + { url = "https://files.pythonhosted.org/packages/67/3b/e8af957f08e6e2e8e566b099e43d2748418aa565df6ee1d9d3331209fdfe/librt-0.16.0-cp314-cp314t-win32.whl", hash = "sha256:94be5cb7bca4df6201f4183e9e4fa2086c655283d20b38cd84500a69057575a7", size = 104402, upload-time = "2026-09-29T00:54:15.568Z" }, + { url = "https://files.pythonhosted.org/packages/ca/1c/946e6443d7cd32347a086043395e421e52fd603c9163d2ec970ceab8eed6/librt-0.16.0-cp314-cp314t-win_amd64.whl", hash = "sha256:d46ca272b251d033dd4527b0dec5f261a28a52bd5fa0f99c117b0a1f8588cc2d", size = 126227, upload-time = "2026-09-29T00:54:17.165Z" }, + { url = "https://files.pythonhosted.org/packages/c2/a3/bc4f9959d3c62bcbf9e5fd3470a8bbd8bf33224ed4c25d7fba173201b8ac/librt-0.16.0-cp314-cp314t-win_arm64.whl", hash = "sha256:b9d6d4b14e92d876f8026b54c20c445f36425214c1081dc76f74e40db386b82b", size = 116493, upload-time = "2026-09-29T00:54:18.567Z" }, + { url = "https://files.pythonhosted.org/packages/b6/4b/10fdb42dfab4c1533e1570e686b18e86ff4328b406361b39fb3016667638/librt-0.16.0-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:6fe436af2eaf630474f491af5d032cbe45f93fcff5c3b9fe4ab194a7255b20ff", size = 149829, upload-time = "2026-09-29T00:54:19.933Z" }, + { url = "https://files.pythonhosted.org/packages/8e/30/a90ca13f1d3d91af1680000a4038536907018fbd51764767287a05d28b8b/librt-0.16.0-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:8ff5d26c529336be9bd7ae04483235d77778ee7d6444a95353102b542601ce81", size = 154522, upload-time = "2026-09-29T00:54:21.306Z" }, + { url = "https://files.pythonhosted.org/packages/5c/dd/bcf364eacfa070bb1fc88d503111ae7177914197ba1fa717c748926e7930/librt-0.16.0-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:909d8e3c1faee44cb762b1c519ff8613dcc5ceae5c99987a00917b5a31fd1d6a", size = 497593, upload-time = "2026-09-29T00:54:22.798Z" }, + { url = "https://files.pythonhosted.org/packages/18/c1/2c4e81e347bdabfe8346bfc6dc37ae5e154d61c88e30848ec0606025a5e0/librt-0.16.0-cp315-cp315-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:6d4a64283ee61824b5790de882bc68e2d9d7a5143537cb7a966f7354f71646d4", size = 480459, upload-time = "2026-09-29T00:54:24.364Z" }, + { url = "https://files.pythonhosted.org/packages/ab/d7/fef2a3cb8400701be496f6e459876f650b3451f407e30cb243de571ae615/librt-0.16.0-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5810ba811297fdf37a1531a57667cb8ace0842013ca8606bf9eb7c24cf4be154", size = 507814, upload-time = "2026-09-29T00:54:25.997Z" }, + { url = "https://files.pythonhosted.org/packages/e1/6f/53762927a32e9dc9eb1d1c1f3528da281290c86d96929a8af652f671266e/librt-0.16.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e56aaf8c167548dc8e5d6f3bd0f48dcdd299a23c73be3f744aab79d99e9c7f5d", size = 525114, upload-time = "2026-09-29T00:54:27.747Z" }, + { url = "https://files.pythonhosted.org/packages/6c/67/0b9d031f303c4e8c691a9a8ef9d272f13b530c11cc563b819df621b6a348/librt-0.16.0-cp315-cp315-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:8f36c58e33b304b525c6c9c5076399c6ebf1109e17b9051a05a407b091b9215b", size = 520465, upload-time = "2026-09-29T00:54:29.331Z" }, + { url = "https://files.pythonhosted.org/packages/ae/d5/2056a3a85864e882eb17a203a10ddb26fa748bc9718ec67e79059ab46cae/librt-0.16.0-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:242e00b3d4fa37c3d3c1ca5f5c9adb7d909ddb1eac9c41f2787320d00caa0af2", size = 537257, upload-time = "2026-09-29T00:54:30.915Z" }, + { url = "https://files.pythonhosted.org/packages/54/57/e0d79790c163cbc0909e209a6f62e30bb713b647f905a176cdc64848fd4d/librt-0.16.0-cp315-cp315-musllinux_1_2_i686.whl", hash = "sha256:0253721561787b8df8443eb347b7a6461015354e5bdd37ee38a41fef220d2bb0", size = 527442, upload-time = "2026-09-29T00:54:32.478Z" }, + { url = "https://files.pythonhosted.org/packages/aa/50/1c0c95aba7af51f4752ea34fbf2eb79b36e7cae3a72536248e8c735de735/librt-0.16.0-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:3e483a8d69ede8067db70c0e83007423b6925de6fd53afed01d66160f2e9398c", size = 548139, upload-time = "2026-09-29T00:54:34.183Z" }, + { url = "https://files.pythonhosted.org/packages/98/91/a8a43dd5138d4f55f88846b8f0c85454a4fad69952cebfcff9948f831290/librt-0.16.0-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:69ba927445cfaaffb4081003ef5224c55a5c2ab67ef956f416ef744916e44121", size = 529708, upload-time = "2026-09-29T00:54:35.761Z" }, + { url = "https://files.pythonhosted.org/packages/2d/41/d5226881ab2b7c20d9d587b37bdd4a0ec8775a96d00ca87ac9f385587db4/librt-0.16.0-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:d6a365f2ab45a984d0e00eee0dd17f599ceab8cadab6ea07b6111c8132fc0e42", size = 567781, upload-time = "2026-09-29T00:54:37.409Z" }, + { url = "https://files.pythonhosted.org/packages/bb/bf/2345ba57a626e8c78c4ddcc724636a8df5a593fe46c1ee76bbf477e32b0d/librt-0.16.0-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:f01f3805f2dae4781c0c34b440e31740d082950bdaf89a6f601ad589a28af57a", size = 79177, upload-time = "2026-09-29T00:54:38.792Z" }, + { url = "https://files.pythonhosted.org/packages/1e/40/99e77936cc9207f629b077bf7cbc5e2f0827cddd7c29792f04ef881bd2c3/librt-0.16.0-cp315-cp315-win32.whl", hash = "sha256:b0e3e721c75d2e79a76d4422c79d7ba705fe1bbafec907037fe7a657a480a0e3", size = 100127, upload-time = "2026-09-29T00:54:40.251Z" }, + { url = "https://files.pythonhosted.org/packages/56/1e/801fe26bc622061b9dfd010e166d94142cb774b733217e6d98d1c0cf2638/librt-0.16.0-cp315-cp315-win_amd64.whl", hash = "sha256:bc02954b1295de798bbdb0b4e2d8a28c2117de8b5c73dcbeb27dc32572dfb971", size = 120480, upload-time = "2026-09-29T00:54:41.722Z" }, + { url = "https://files.pythonhosted.org/packages/bb/a9/d533983055bd36e112627384c2c038845d1df882540b8bcefb566475640b/librt-0.16.0-cp315-cp315-win_arm64.whl", hash = "sha256:c5db585d43449a5f54303d4b2774e45e1babd975cfe1630a3d708c0b80c3e560", size = 110915, upload-time = "2026-09-29T00:54:43.052Z" }, + { url = "https://files.pythonhosted.org/packages/55/fe/d62238fa9c653b0e0613290349467cb65711b5800e8e474f45e942a0ad95/librt-0.16.0-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:f06c689cb14afd9b612727553a5ec5a40febf113ca41c4413a2b0b334285884b", size = 159714, upload-time = "2026-09-29T00:54:44.497Z" }, + { url = "https://files.pythonhosted.org/packages/f3/ac/f31efe7818700be72ba4f9af8a80fa67c39808c8d26dacc55dc1f6f35172/librt-0.16.0-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:13b4e8aba90b0b1c82474e9844aa9ffe7ad3faa484350e1da64cb8188d903134", size = 162086, upload-time = "2026-09-29T00:54:45.968Z" }, + { url = "https://files.pythonhosted.org/packages/d9/16/4d7487bf86a9d7e8e18f37ba5538789233ea693637379b75701bd35ec9de/librt-0.16.0-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5a269c46ae327d8e6f8c1f85f7516cb52c0fa48127565a1105a4f4a05ff2a0b4", size = 712727, upload-time = "2026-09-29T00:54:47.486Z" }, + { url = "https://files.pythonhosted.org/packages/77/74/50cd550ccc1a517b9ed62347625c01ddf8c4afad66490312677c011458f6/librt-0.16.0-cp315-cp315t-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:a33e0dae1f8592146a4764d54ce842b278732d21a84e17c3bbe6b1bc158a2248", size = 681106, upload-time = "2026-09-29T00:54:49.126Z" }, + { url = "https://files.pythonhosted.org/packages/df/5d/7293f712975ee6fdd2251411fd9ef1c62bc99c7b83ecbe62dbc999b1fab7/librt-0.16.0-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:47ada6ea32636492c61aa8ad27ae3b9404bfe7a97e3ba946d1984236cc741da0", size = 705921, upload-time = "2026-09-29T00:54:50.905Z" }, + { url = "https://files.pythonhosted.org/packages/67/f7/8aab946f11d59d1bece9ffc65d994b200c789a8ca5a95c17e17e609f912a/librt-0.16.0-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c43bd6e642d8a248c114327f98dd25ac5a7cb5aa168ef02f0559b91874df16b8", size = 731786, upload-time = "2026-09-29T00:54:52.584Z" }, + { url = "https://files.pythonhosted.org/packages/43/76/1c42ab31e7cb8384ebf6d3af607213c495222474f4940443ae7639ab7685/librt-0.16.0-cp315-cp315t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c3d1bb7841a816ace6449bb26d3f9560dbfa20e71c568d23f0f62bf1e68f50b1", size = 744964, upload-time = "2026-09-29T00:54:54.217Z" }, + { url = "https://files.pythonhosted.org/packages/6f/2e/4b19982d933d2dfced671e840b219e4c1cd3f507df6e6dabb51bbd4e3850/librt-0.16.0-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:3931f7a3db322e7f44e02a280e3949326ce9579ad388ee8d691dc7c76da9fb70", size = 765305, upload-time = "2026-09-29T00:54:55.815Z" }, + { url = "https://files.pythonhosted.org/packages/b8/1b/e872583de2dcb3ac7746e7a2321aeeb168274f3952a87dc66e05ddb29faf/librt-0.16.0-cp315-cp315t-musllinux_1_2_i686.whl", hash = "sha256:f4462528b6000afe8f16907b5c7c2553abf1df005ba5140e6eb394541c3624c3", size = 744959, upload-time = "2026-09-29T00:54:57.532Z" }, + { url = "https://files.pythonhosted.org/packages/10/de/a18c6bcfb297af2674233e90b3c3661c3a0af0f1434a0c966d2ef708a835/librt-0.16.0-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:80039ba9b6a7d5f1a0175a4cca6bbefead87bd854c80abad1cb30afe47a830db", size = 758138, upload-time = "2026-09-29T00:54:59.484Z" }, + { url = "https://files.pythonhosted.org/packages/22/1c/0df1d732539c297bb1a093e1fe3204d2faf76a9022cf4e1d1c2fce059790/librt-0.16.0-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:7a1d272724b581bb6bc769dfdafed6da2ecc9886ba2450311de55a4ac2e1e9cd", size = 744268, upload-time = "2026-09-29T00:55:01.179Z" }, + { url = "https://files.pythonhosted.org/packages/a2/f7/ccaf31331f20c91a5bd9bd48ffc3f743f9c81bb5720cc7b2a720ca204f0a/librt-0.16.0-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:fbe4fb8c5445f7496d7f7f6bb0807875d09d47e6771ffa175fb2df2895fb86ba", size = 785783, upload-time = "2026-09-29T00:55:02.938Z" }, + { url = "https://files.pythonhosted.org/packages/c1/ea/7421d9e6db894cd6cd788b604b3394a163ded6b942052b6f96c23ccf08e1/librt-0.16.0-cp315-cp315t-win32.whl", hash = "sha256:375bfe6b572a8f6cfc398709356046173bf27e64c4c5edaf5f7062f051fb4bf9", size = 104355, upload-time = "2026-09-29T00:55:04.533Z" }, + { url = "https://files.pythonhosted.org/packages/85/6d/7c31a506eb847bc58aeb2402d58e17605e821f68ab5df5e66fe274a6df41/librt-0.16.0-cp315-cp315t-win_amd64.whl", hash = "sha256:bd3150023d3dc2bc70f3784e59ffa1140d56ddba3d8125b3d6f9f85221279bfc", size = 126134, upload-time = "2026-09-29T00:55:06.017Z" }, + { url = "https://files.pythonhosted.org/packages/36/69/7a5d10ac409c4da0355e054a14371871da9b5557fcc42772cd00181c6cce/librt-0.16.0-cp315-cp315t-win_arm64.whl", hash = "sha256:8ceafb70f2a4f0826f11031942e59c0728fd98da112dc346d4352bde1e486866", size = 116391, upload-time = "2026-09-29T00:55:07.484Z" }, +] + +[[package]] +name = "mypy" +version = "2.4.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "ast-serialize" }, + { name = "librt", marker = "platform_python_implementation != 'PyPy'" }, + { name = "mypy-extensions" }, + { name = "pathspec" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/4a/3c/78ecece71ee4b5445389a4ccd11627cfb9c69e4de554d11060171f376305/mypy-2.4.1.tar.gz", hash = "sha256:63b590965691e540a335fa74dadf31a7069142f6b72e234689bbd244edf55623", size = 4066728, upload-time = "2026-10-28T19:23:13.286Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4b/8b/2bc7f489528db504221ad7eff6b3f83979ee57d066103c72a85d09046a30/mypy-2.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:79a1e79199e980fb41f219cb3d4746d25c64b0b623840d3ed57df1cdc13a6502", size = 14321495, upload-time = "2026-10-28T19:21:16.612Z" }, + { url = "https://files.pythonhosted.org/packages/18/9a/b2f037b4982dce33645296e4394b031ade60f697f468761fa3ea8e2f8ece/mypy-2.4.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e18d0da3898b3bcd16192f15a206e7b8b8dd0f4a0b3e51aa5bd5c2afe749e2c", size = 14467468, upload-time = "2026-10-28T19:22:10.629Z" }, + { url = "https://files.pythonhosted.org/packages/c4/5a/379f9bfa18bf3f8d43668fbd9ae4f2922dd027a559c461ca9d41cde1d32e/mypy-2.4.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b69a15fc2e75858d6b15e91ed3a0dcff1a533265183b64734138791fe0f49aa5", size = 15421496, upload-time = "2026-10-28T19:22:48.005Z" }, + { url = "https://files.pythonhosted.org/packages/83/50/3bde18a2824ec296432cebe01752ccd0ab8a2ad784abe4390040d019b3bf/mypy-2.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:70971cc0bcb1d3f03d2eb68fa430a6481ccc03558dc001d9534d7e5fa274c392", size = 15670425, upload-time = "2026-10-28T19:21:57.026Z" }, + { url = "https://files.pythonhosted.org/packages/6a/36/8b722b88c325d317354de7d10d8fb9d4dc0f958433e873a91fc4ed21a06e/mypy-2.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:6f7225951a277dd0d6add900731d487174b7d24ac133c09d670ed63b4d8cb90d", size = 11300972, upload-time = "2026-10-28T19:21:48.724Z" }, + { url = "https://files.pythonhosted.org/packages/c2/d6/fb2bab1245658d68af8abfe776362a780c621fe0f364f2c7b53039a945ee/mypy-2.4.1-cp311-cp311-win_arm64.whl", hash = "sha256:be4c03f33c55500191df2ed4a9b5e7edbdd1fff067fe361a5a9b1b5d3262da6e", size = 10873349, upload-time = "2026-10-28T19:21:32.104Z" }, + { url = "https://files.pythonhosted.org/packages/c0/1a/0be9dc6af5e0e04128f18a5e36b4ca44bfb0085857d37aa6a7de1ac2b0cb/mypy-2.4.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d63737426a048a27705a4eedb828669f4bc0873612a1b46b0b9fe892b2ebaaaf", size = 14381321, upload-time = "2026-10-28T19:21:54.223Z" }, + { url = "https://files.pythonhosted.org/packages/0d/a6/7907e36711a8a8c703f961f076fab61793383694140bd1fd87589f3f68d4/mypy-2.4.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7344869cad05f073b8cae2826774fa0161e3eb2f5c685b76813574008d77d750", size = 14466373, upload-time = "2026-10-28T19:22:25.211Z" }, + { url = "https://files.pythonhosted.org/packages/5d/b8/7313212b29de570c25c9859d7c8e4ef2251a6d34338a1e20031d94297721/mypy-2.4.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a20ff6cd2af7a670c64f089bfa5fbcebe8ff3bf896c5e6ac7c9862c7960e4494", size = 15553666, upload-time = "2026-10-28T19:22:36.511Z" }, + { url = "https://files.pythonhosted.org/packages/23/8f/92966b6082ff49da9142e1e527eb9af4359a9a61632a1cfc313da96b37fe/mypy-2.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:9ed1195502cca32be5ef756b1693477f4991db2f2e34eaa90cc4ad6bea4f9531", size = 15802641, upload-time = "2026-10-28T19:21:13.421Z" }, + { url = "https://files.pythonhosted.org/packages/b6/b4/874f6fd54b005020ad63e2cf7a59b178d16a771d478849b29b842cb0cf14/mypy-2.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:4c194c5d878130fca1ae662dfb1feb6274afbab0b40032c80147377e0ea803d5", size = 11383067, upload-time = "2026-10-28T19:22:03.516Z" }, + { url = "https://files.pythonhosted.org/packages/b0/41/5ae8e6528c2faa96e4a921a999d2c7ac7c565bee184b4282bf62ffa76b5d/mypy-2.4.1-cp312-cp312-win_arm64.whl", hash = "sha256:71eda06e5bae51976ce869fda429159c9cec678bd02f25bb197f0265c8f991be", size = 10946882, upload-time = "2026-10-28T19:21:39.51Z" }, + { url = "https://files.pythonhosted.org/packages/6a/65/cd19bc06b67d2df4828220245fd98569ba40fac00c60ba48bef1817d8ac3/mypy-2.4.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:3f1613bfe6726169a5680ec3dad5fe1f6d96285c12aded51ad432eadedd39d45", size = 14214179, upload-time = "2026-10-28T19:22:27.49Z" }, + { url = "https://files.pythonhosted.org/packages/c9/db/4d54ca4f49a0113d0c956980272aefdc6eec5458f7a72b350785b9ef2249/mypy-2.4.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:680ba5d9f0e3fe0c746b3d14df15f2a718e4bc308a1145616a1ea691ce7c354b", size = 14376217, upload-time = "2026-10-28T19:21:08.019Z" }, + { url = "https://files.pythonhosted.org/packages/a2/45/089b4724b85f0f408941be5298f817ee89181c1ce031a73d60ebb150c2c7/mypy-2.4.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1fb70621535c22fd4b1a0450d37ed1d6c5eb39656a1cebfb189084c12de54ba7", size = 15467623, upload-time = "2026-10-28T19:21:21.555Z" }, + { url = "https://files.pythonhosted.org/packages/27/4c/15edbc64b0b1412bfe94c74192b3b56554ab642b85a31bb06cef6313101f/mypy-2.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4af5ad558033bf71a44a1be149ed61633522824f84c1b6bc2445d3fe2d2a5296", size = 15729867, upload-time = "2026-10-28T19:21:37.557Z" }, + { url = "https://files.pythonhosted.org/packages/76/5b/7d160fb685994b65b0ca86d352f3afb5424f96a9e6914719f7b861fb6701/mypy-2.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:acdd82cb3a2eb10720e87706a128d75785d005a8c47e36a4973221524f41fc56", size = 11390802, upload-time = "2026-10-28T19:22:18.081Z" }, + { url = "https://files.pythonhosted.org/packages/9a/ea/453d27f8d531f57c5f14aa73094eaa48e3fb77f680bdede2045cb64fa58b/mypy-2.4.1-cp313-cp313-win_arm64.whl", hash = "sha256:133886ef1a7a8cf673df55d865e41580c6c46aa9b8e31e1325dfe315c038f745", size = 10950427, upload-time = "2026-10-28T19:22:59.003Z" }, + { url = "https://files.pythonhosted.org/packages/7d/75/282d43d6fea7be984ac63e75ffd8eee146ba2f3b077bb1ca5bf3f973e0c4/mypy-2.4.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c45485061ba08f700acc12cfc8b177e6997e6bc353605babfc0abb081e079456", size = 14233251, upload-time = "2026-10-28T19:22:44.977Z" }, + { url = "https://files.pythonhosted.org/packages/ac/a8/9021263cc7e761451c7d8131bdfab3c0a5c2d67aa2d694670019e1ab86a7/mypy-2.4.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:727890a32f1858c09549eb55a8b234fe990d460450b28f03e8213ef925f1247c", size = 14394953, upload-time = "2026-10-28T19:21:29.492Z" }, + { url = "https://files.pythonhosted.org/packages/16/10/4192a5cea09ebbc41c534f57bd0d8f0fb42a8e810632cda6e37f072c59fd/mypy-2.4.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:beb254fec368c4e7f7f82a5f310c6470b893ec88a90b66426da971c6826b0453", size = 15442824, upload-time = "2026-10-28T19:22:42.068Z" }, + { url = "https://files.pythonhosted.org/packages/99/e6/d3b0a7474aa4f696594a47a218b6796d9c4346fc81ed288904278cddd9bd/mypy-2.4.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ec416d5d2ae689e681f5727e328723f18d8b5dc8c903a146b7851dc5727aad8a", size = 15717227, upload-time = "2026-10-28T19:22:54.026Z" }, + { url = "https://files.pythonhosted.org/packages/48/6a/2ec530dacd4f77ca50d0fa05b854098f2d75e5d18c587d2612b44f10d68c/mypy-2.4.1-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:0e95ad0bec03ced9a73b42514208abd24c789e67f0e1eba476e276dd7a2dea3a", size = 7898637, upload-time = "2026-10-28T19:21:41.709Z" }, + { url = "https://files.pythonhosted.org/packages/cc/56/de9d7bad12e3868d5f1f4279aed20b1b568b2c5e166f2d3a05b211dca0b1/mypy-2.4.1-cp314-cp314-win_amd64.whl", hash = "sha256:51f742d4154824837ca6e92aa81f00eec222700a3c337bd258e5562a3880d75a", size = 11576656, upload-time = "2026-10-28T19:22:13.232Z" }, + { url = "https://files.pythonhosted.org/packages/b8/12/4fa9883b9b59e5c96ff62845ad019dc47786031c45d67eaccf452cffffd8/mypy-2.4.1-cp314-cp314-win_arm64.whl", hash = "sha256:f44dd4c5ab22df21206dd926c98381ebdbf5bfd696df37dd38ded2d23143fcb6", size = 11174403, upload-time = "2026-10-28T19:23:01.346Z" }, + { url = "https://files.pythonhosted.org/packages/3f/f2/827e356fc4f74c60b8da42663336e035b49d948a3c11224b0fc7543086b1/mypy-2.4.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:2875280687e64740e6ddcef43bd4c5852ad45ff34549740f6aea3f0373870b93", size = 15713427, upload-time = "2026-10-28T19:21:26.757Z" }, + { url = "https://files.pythonhosted.org/packages/a2/fa/e58a4fcae1d238189eac758036c0921992a86e3e6209190efd96d61fc5d4/mypy-2.4.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ea0714d2bccaf6d010c970e1d3ba2c9c2add79d2030aad2ef03167d788948276", size = 15938481, upload-time = "2026-10-28T19:22:34.371Z" }, + { url = "https://files.pythonhosted.org/packages/a1/54/a20f881801b88900923f2be1541a4b438ad0f0883e03836641fdc3d7adf4/mypy-2.4.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:63c6ff0e7ea546943001a91639c9f0c64b60d239268fa5d29e4a6c87f82c2373", size = 17243006, upload-time = "2026-10-28T19:22:39.425Z" }, + { url = "https://files.pythonhosted.org/packages/de/1c/ff84a6133a6e89c390bff6b25d9bad6598e7891b205f4b30b496906d636d/mypy-2.4.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:a5b5da107dc2c93fb0a22f7a45dbaea5dc131afc7056b5468d78e819f9a138e6", size = 17557728, upload-time = "2026-10-28T19:21:43.607Z" }, + { url = "https://files.pythonhosted.org/packages/15/4a/effa47d39b8fadf679c08e7c78559e523f9769a42a75662d2d15b2b9cdd6/mypy-2.4.1-cp314-cp314t-win_amd64.whl", hash = "sha256:c3a4d0c47053cc90035dd3a2c321112b593ad42935d0cbfd747288e1564fa8ca", size = 12370826, upload-time = "2026-10-28T19:22:29.779Z" }, + { url = "https://files.pythonhosted.org/packages/46/9f/b214ececb1a97fbb61ab3dfd48ae3cffd92ae2c148af4c9dc94c6c56772b/mypy-2.4.1-cp314-cp314t-win_arm64.whl", hash = "sha256:0c5bf267645351887b72903fd2f5fbddcf85234e0e6c4ad94e2fcfb4f0c3f971", size = 11851083, upload-time = "2026-10-28T19:23:11.288Z" }, + { url = "https://files.pythonhosted.org/packages/57/5b/e44a2edb0b25a9f1429de770e1d0238af23302671dd40c77ac5efeb0c559/mypy-2.4.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:db599d03e7d60d15f2e0a11665c18bc52a88699fcab990fdf8cecd5be8ac801c", size = 14243144, upload-time = "2026-10-28T19:21:10.975Z" }, + { url = "https://files.pythonhosted.org/packages/59/d4/5c99dc3a28e11d2f0fcbb02df63d2d3e574dedc0f9f69d50901df305a7a6/mypy-2.4.1-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c6c7210e40dd423af7d65cbe428b5906d11dc60659337bdae4e5fdf02ce32ed7", size = 14409316, upload-time = "2026-10-28T19:22:15.515Z" }, + { url = "https://files.pythonhosted.org/packages/c3/c9/3108b38f4c30eabd80194f5d9771a87e27196c5e0ddb5bf4b99c6ed1e97e/mypy-2.4.1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a2d4a51db92059eecc2c33b2a5194b28585ebfd917292c015fe87a77dbff6cd2", size = 15445573, upload-time = "2026-10-28T19:22:05.635Z" }, + { url = "https://files.pythonhosted.org/packages/dd/12/84a53eceaf11c46dfd7931fb6b8902d01fb33787d3a991e81c461458150b/mypy-2.4.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:01b7718552d017f88d1151f3cc9d6556d778a90bd58060a2c3d87d070f9099fb", size = 15732989, upload-time = "2026-10-28T19:23:06.512Z" }, + { url = "https://files.pythonhosted.org/packages/65/ba/bf017dc2abdf83b2f74e29c43834b7af67dc1f1b20202f02dae60b4781a0/mypy-2.4.1-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:3467b1d13000812ab85dc2a3834b9379ec77798ca1bcabe434e23fb21fead692", size = 7898932, upload-time = "2026-10-28T19:21:59.366Z" }, + { url = "https://files.pythonhosted.org/packages/76/05/0c22b1f0390120a8592d31209cb6b9f932b6a0b426fe643e550de15139e3/mypy-2.4.1-cp315-cp315-win_amd64.whl", hash = "sha256:080cf64a60b90a73435542feecf4171904cc5710658165b40c6869115d4aa100", size = 11577577, upload-time = "2026-10-28T19:22:01.302Z" }, + { url = "https://files.pythonhosted.org/packages/73/fb/ac01e173629697ddac2f11e51efd10347d673f9a7311b03f4aba710ebccd/mypy-2.4.1-cp315-cp315-win_arm64.whl", hash = "sha256:f9118a3f50de264b614861bb11814833a742138ac3c8e2e49a860b6977fb2704", size = 11173540, upload-time = "2026-10-28T19:21:46.444Z" }, + { url = "https://files.pythonhosted.org/packages/5b/e4/b9b9c8eb09e70927ee65b1456cfed35710b6e4ff0b07f364ceaf2202307c/mypy-2.4.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:9d7dafd56179d296651df9e1844b91c9517c379398f017a2a435d077a28943c1", size = 15706623, upload-time = "2026-10-28T19:22:20.528Z" }, + { url = "https://files.pythonhosted.org/packages/26/74/1ceb1ca884add0565e618d013dd24333039100dc0fcc42661561f2e1cae5/mypy-2.4.1-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d923cec43316f0e6736b8298fd00abeaaf348a091c20e7296b3aebceecb63eca", size = 15944095, upload-time = "2026-10-28T19:21:04.779Z" }, + { url = "https://files.pythonhosted.org/packages/2b/68/27bcf9b4efa22733b6050485ae37845b94c9b8851abe4fc60632d905c32d/mypy-2.4.1-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6e081b466e88d4343adffe11aff0f02df34b5b9070b4b700053a0b7294c0be1", size = 17223065, upload-time = "2026-10-28T19:23:03.724Z" }, + { url = "https://files.pythonhosted.org/packages/1a/a3/ed5724b317bf585c29f3c8be2792e97d45925d65a9c8af40ceeb267072e6/mypy-2.4.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:70196470ac300f444a302a738541101893c2c57804078b33690286a7899149e9", size = 17560589, upload-time = "2026-10-28T19:21:34.539Z" }, + { url = "https://files.pythonhosted.org/packages/42/2f/005185e6ab4752fd6cc2d1a6d1421fe21979770afe2490c00c555f34a913/mypy-2.4.1-cp315-cp315t-win_amd64.whl", hash = "sha256:de95648e0a6d46fa9929b956ed2c87c5dc9933d4d59945e6390e9d753c74e7c1", size = 12353324, upload-time = "2026-10-28T19:22:51.481Z" }, + { url = "https://files.pythonhosted.org/packages/a1/d6/20420cc9c780087139662534d128c2f3274361f8bb7e9cf0d5495a846ed5/mypy-2.4.1-cp315-cp315t-win_arm64.whl", hash = "sha256:ef8d5be90032261197ac388d945d8ff4f476c95880798a1911760af64ddfe71f", size = 11845599, upload-time = "2026-10-28T19:22:23.136Z" }, + { url = "https://files.pythonhosted.org/packages/21/5c/6e8010f8f2c4ad817364592d4b3883633417269b913fc9d5174fdeb7e565/mypy-2.4.1-py3-none-any.whl", hash = "sha256:1784648d6ec8c2b5465e3f26241b845a0b3cb4e56c993c64abe16989e7698999", size = 2801286, upload-time = "2026-10-28T19:21:19.516Z" }, +] + +[[package]] +name = "mypy-extensions" +version = "1.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/6f/43edf3be2748d0e40974a5ee046a8bb4c9961a4bdd3e7d5c6dcbf32d1af6/mypy_extensions-1.2.0.tar.gz", hash = "sha256:c6e275a07f1c2fc096b62940452d0eaa3f3af7de45d704787866240a7c6d5a51", size = 6566, upload-time = "2026-11-03T16:26:33.692Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b5/99/7b1adac7e97ce7bbda34792dc6e9b2f5cc5cffd1875883f78a818b2a2687/mypy_extensions-1.2.0-py3-none-any.whl", hash = "sha256:993e7a20aa5671eb41a7132cf555af30062da99729601601b9a8382b11cae768", size = 5114, upload-time = "2026-11-03T16:26:32.731Z" }, +] + +[[package]] +name = "packaging" +version = "26.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7d/fa/3944b40b07da9ce895c0e6303a5ab7d53da063554f534556b134a54d6093/packaging-26.3.tar.gz", hash = "sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79", size = 313412, upload-time = "2026-08-04T18:15:28.737Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", size = 129956, upload-time = "2026-08-04T18:15:27.159Z" }, +] + +[[package]] +name = "pathspec" +version = "1.1.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5a/82/42f767fc1c1143d6fd36efb827202a2d997a375e160a71eb2888a925aac1/pathspec-1.1.1.tar.gz", hash = "sha256:17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a", size = 135180, upload-time = "2026-04-27T01:46:08.907Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f1/d9/7fb5aa316bc299258e68c73ba3bddbc499654a07f151cba08f6153988714/pathspec-1.1.1-py3-none-any.whl", hash = "sha256:a00ce642f577bf7f473932318056212bc4f8bfdf53128c78bbd5af0b9b20b189", size = 57328, upload-time = "2026-04-27T01:46:07.06Z" }, +] + +[[package]] +name = "pluggy" +version = "1.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/bf/db/7fc19e6f2dc92a966727031389fc2e08b558f0f25eb7403c1119ad4713cd/pluggy-1.7.0.tar.gz", hash = "sha256:d1eaa46ebb595891b860ab086b4d09c8588af65ebd4361b8e8f4bb8920b90ba8", size = 123304, upload-time = "2026-10-15T09:50:58.343Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/40/9e/2b38731e0fc536806f16490e1a12d7f0dc2a1235aa8cc07bcc75416a7daa/pluggy-1.7.0-py3-none-any.whl", hash = "sha256:7dd7b0d8832ba3cb632c306926ded123429211b83641b35dc5c41ad2d34f9bec", size = 27082, upload-time = "2026-10-15T09:50:56.808Z" }, +] + +[[package]] +name = "pygments" +version = "2.21.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c", size = 5005329, upload-time = "2026-08-17T08:02:48.824Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/71/46/17f022dd3e953bf20a04a028a21ec746d942f8d2af30fa0f124fa0e6a684/pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9", size = 1250147, upload-time = "2026-08-17T08:02:44.912Z" }, +] + +[[package]] +name = "pytest" +version = "9.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/79/42/bb4641652e58dedeac2ec51abc1f8cae4fee4ec63899a0999016229a0f2a/pytest-9.2.0.tar.gz", hash = "sha256:97c4f3b1f3c7414aa36465e09b8220f1d03627993bd51b1282e193753c80557b", size = 1797555, upload-time = "2026-10-27T21:30:20.728Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/51/39/1f5d8c8877a0fa327db959c19341d4be61660de1ab6b7391f9eb805bcd67/pytest-9.2.0-py3-none-any.whl", hash = "sha256:07acdcf88ec174f907dc01af70bf52d49b014bbab03faeeade31c96b18c2e588", size = 411776, upload-time = "2026-10-27T21:30:19.131Z" }, +] + +[[package]] +name = "pytest-asyncio" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytest" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/2c/de/80724f9b5b9eca1a654179cae6edc51aaa0a355a9834a736e2a188b91780/pytest_asyncio-1.5.0.tar.gz", hash = "sha256:92c8fa83ca419fd0d4bd6a34df6520dae435841d3733c319343249492adf37f7", size = 146227, upload-time = "2026-11-12T16:35:49.845Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/27/2d/e600d8f47597a803641704aba367c7266cd621f86561ec36da9888f160ec/pytest_asyncio-1.5.0-py3-none-any.whl", hash = "sha256:557f255ee03cc84f84a8d5f438bc9c6e0f714bf86970ae743c7ecb5a38d7e07d", size = 17215, upload-time = "2026-11-12T16:35:48.446Z" }, +] + +[[package]] +name = "pytest-cov" +version = "7.1.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "coverage" }, + { name = "pluggy" }, + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b1/51/a849f96e117386044471c8ec2bd6cfebacda285da9525c9106aeb28da671/pytest_cov-7.1.0.tar.gz", hash = "sha256:30674f2b5f6351aa09702a9c8c364f6a01c27aae0c1366ae8016160d1efc56b2", size = 55592, upload-time = "2026-03-21T20:11:16.284Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9d/7a/d968e294073affff457b041c2be9868a40c1c71f4a35fcc1e45e5493067b/pytest_cov-7.1.0-py3-none-any.whl", hash = "sha256:a0461110b7865f9a271aa1b51e516c9a95de9d696734a2f71e3e78f46e1d4678", size = 22876, upload-time = "2026-03-21T20:11:14.438Z" }, +] + +[[package]] +name = "python-mediator" +version = "0.7.0" +source = { editable = "." } + +[package.dev-dependencies] +dev = [ + { name = "mypy" }, + { name = "pytest" }, + { name = "pytest-asyncio" }, + { name = "pytest-cov" }, + { name = "ruff" }, +] +lint = [ + { name = "mypy" }, + { name = "ruff" }, +] +test = [ + { name = "pytest" }, + { name = "pytest-asyncio" }, + { name = "pytest-cov" }, +] + +[package.metadata] + +[package.metadata.requires-dev] +dev = [ + { name = "mypy", specifier = ">=1.18" }, + { name = "pytest", specifier = ">=8.4" }, + { name = "pytest-asyncio", specifier = ">=1.2" }, + { name = "pytest-cov", specifier = ">=7.0" }, + { name = "ruff", specifier = ">=0.14" }, +] +lint = [ + { name = "mypy", specifier = ">=1.18" }, + { name = "ruff", specifier = ">=0.14" }, +] +test = [ + { name = "pytest", specifier = ">=8.4" }, + { name = "pytest-asyncio", specifier = ">=1.2" }, + { name = "pytest-cov", specifier = ">=7.0" }, +] + +[[package]] +name = "ruff" +version = "0.17.5" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/86/cc/7b71512eb8b49926efb887cc66c74dd993642943c29eba51a877f6b85692/ruff-0.17.5.tar.gz", hash = "sha256:625e57d80cd43352d12ea81690f3eac46cddc8c0f35026d137fb0f157f94592e", size = 5368382, upload-time = "2026-11-12T17:54:55.04Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d4/f2/61df414cb4338617290a9023ad09486e207fb9a6d09357a7be34f2e369a4/ruff-0.17.5-py3-none-linux_armv6l.whl", hash = "sha256:d511dd302982e46a285528942fa6557d57730edc4bdb9def95e86a2603d77396", size = 10231309, upload-time = "2026-11-12T17:54:09.314Z" }, + { url = "https://files.pythonhosted.org/packages/d1/72/8ed970f3361f7c8d3f8e1b3b1af27cf086bc4b3a6b62ec20e21a1aaaaff5/ruff-0.17.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b72fbc232e328bdbb9cdddf4f1aedcd61bd1aa64d75fc012114b4add0bd7f26b", size = 10250018, upload-time = "2026-11-12T17:54:11.983Z" }, + { url = "https://files.pythonhosted.org/packages/dc/4b/8b10f6c9d0a18413301ae8dd2af9d180a81bb738b1b731d944a37404c523/ruff-0.17.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:6f0db748508f04a04e3fbebcc636a5c8b3bd76274f8ed28f497c44d75c2ea2d7", size = 9504737, upload-time = "2026-11-12T17:54:14.567Z" }, + { url = "https://files.pythonhosted.org/packages/b7/ea/1b3afa3943239dede7a0755ea139bdb51879f0f3f96f92894081d5c7d2e5/ruff-0.17.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6f6a7b138edf9cc402ca736a59d9525e6d766e5395760b72e7e146e6251ac963", size = 10168006, upload-time = "2026-11-12T17:54:17.195Z" }, + { url = "https://files.pythonhosted.org/packages/31/08/ee641daa45f83792f91274b65796cb011f1065f588911bfa3909ad9e31e7/ruff-0.17.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e52622ecf3a0df9d03e796fe3eed4aa085adda65520db7e0619cbd2192a97342", size = 10043751, upload-time = "2026-11-12T17:54:19.815Z" }, + { url = "https://files.pythonhosted.org/packages/f8/cf/1c59fdb42d0b5671ad5b160636fab4005ee28db72cb06aef6e3f3c04f377/ruff-0.17.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:54c0f67d1be11b55d12c184a819fc229f5eee3ef45c16c4fcad41258e83b4882", size = 10690562, upload-time = "2026-11-12T17:54:22.789Z" }, + { url = "https://files.pythonhosted.org/packages/49/c5/578074716173fb0c1591e9648a9f85c469888d9530cb35b89b757dc1208b/ruff-0.17.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dd0dfe7c6fe5a447fce467c58e69893be1d9a7e4378f5b9906432da33d94a97f", size = 11338465, upload-time = "2026-11-12T17:54:25.523Z" }, + { url = "https://files.pythonhosted.org/packages/aa/b9/d6428bcf5ed88f4dc1d6e3417ee350236ed36e7a35f9477b727c00e437bf/ruff-0.17.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ec4ecf40fb4d6e1265b009dbe551727920926fc0f769070c452d6d84b422a74d", size = 10895501, upload-time = "2026-11-12T17:54:28.441Z" }, + { url = "https://files.pythonhosted.org/packages/f2/8a/1e29c0c3785ae7e5cd0d54ee8717a08867ef71545796340be4c653c57e24/ruff-0.17.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:40ca8afaac309b41a5b2e09e4e7beb1f824826b93c25697c4d74f573324fba4e", size = 10613231, upload-time = "2026-11-12T17:54:30.862Z" }, + { url = "https://files.pythonhosted.org/packages/32/b6/88944350c14bb90651014d678ad554e233ae2a79c14ad52101845f93d15b/ruff-0.17.5-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:8e85601bd6d9b6c3e3b95c0e0dccdbac1d23c6bcef006d187fbcddaf8225a5df", size = 10562789, upload-time = "2026-11-12T17:54:33.869Z" }, + { url = "https://files.pythonhosted.org/packages/6f/fd/2792e955b0bf54295cdcdddc4bb3f380c0790d7e60e789f528a9e6e48a31/ruff-0.17.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f93d2b7d449ed9545304f6923699ca20d13c675b69f258481709a08ae61076db", size = 10069824, upload-time = "2026-11-12T17:54:36.663Z" }, + { url = "https://files.pythonhosted.org/packages/07/9c/d7cad341b4c19237948a6dd1fcea1c9c39c9d08b70f22f0e157d1236ebd6/ruff-0.17.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0e5c125c5b31dc8efc948d41357496a4c4a312977565ccba740030efdff83580", size = 10038961, upload-time = "2026-11-12T17:54:39.452Z" }, + { url = "https://files.pythonhosted.org/packages/cc/a1/9cd0d4c371ddc70267d3bd557e718e2bdfb94c25e49d25605edfabb764bd/ruff-0.17.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:50dfc3c6b3ebd0a932f11dfd579bd42234b0b7137e68940eb6abdbfdb9d69697", size = 10385012, upload-time = "2026-11-12T17:54:41.808Z" }, + { url = "https://files.pythonhosted.org/packages/8f/a9/35f078ce98d4df318328ea5270382b5b65e680f7953b3db54f8e009c420c/ruff-0.17.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:86bd1f3b83c25f9b8055c6e796f0685b39d3127ce947322098c3108cf82fd586", size = 10793672, upload-time = "2026-11-12T17:54:44.342Z" }, + { url = "https://files.pythonhosted.org/packages/2c/a5/2e136dede2a88aaaf54498bbbdc81bc810f788ef6ef01efb97037d73cd1d/ruff-0.17.5-py3-none-win32.whl", hash = "sha256:e1546609b2ad73f1d6c5c076881b788672b7b3cc3283981182cbdbb6524ed88a", size = 9929908, upload-time = "2026-11-12T17:54:47.067Z" }, + { url = "https://files.pythonhosted.org/packages/ec/8c/e4db9ae1e0ee233c04df007ab6d0d42f799ae9abd95d352b6092ee7bc4bf/ruff-0.17.5-py3-none-win_amd64.whl", hash = "sha256:aa415d57c244299279901d776607fee3df7831c2a7435433fbfacde8632c6550", size = 10275454, upload-time = "2026-11-12T17:54:49.401Z" }, + { url = "https://files.pythonhosted.org/packages/e6/65/a1648bc1550e7683bf7bf1e2ce2485c9f8535cbca6cca9ec7b73cc12fb8e/ruff-0.17.5-py3-none-win_arm64.whl", hash = "sha256:64a6fd668a336df959c522991de33e9e3c8be463afc0c9ac8f029f9d19ef756e", size = 9849020, upload-time = "2026-11-12T17:54:52.055Z" }, +] + +[[package]] +name = "typing-extensions" +version = "4.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" }, +] From 48c35d6a6223c33bd49e9b4c88d45e4087733e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20=C5=81ukawski?= Date: Sun, 15 Nov 2026 14:10:10 +0000 Subject: [PATCH 03/11] Replace black, isort and flake8 with ruff and apply its fixes, moving to built-in generics and union syntax. --- README.md | 1 - pyproject.toml | 22 ++++++++++++ src/mediator/common/factory/__init__.py | 23 +++++------- src/mediator/common/factory/base.py | 3 +- src/mediator/common/factory/cascade.py | 7 ++-- src/mediator/common/factory/mappers.py | 12 +++---- src/mediator/common/factory/policies.py | 9 +++-- src/mediator/common/factory/utils.py | 28 ++++++++------- src/mediator/common/handler/__init__.py | 4 +-- src/mediator/common/handler/base.py | 3 +- src/mediator/common/handler/handlers.py | 35 ++++++++----------- src/mediator/common/modifiers.py | 2 +- src/mediator/common/registry/__init__.py | 7 ++-- src/mediator/common/registry/base.py | 4 +-- src/mediator/common/registry/registry.py | 13 +++---- src/mediator/common/registry/stores.py | 6 ++-- src/mediator/common/types.py | 5 +-- src/mediator/event/__init__.py | 2 +- src/mediator/event/aggregate.py | 6 ++-- src/mediator/event/base.py | 6 ++-- src/mediator/event/local.py | 11 +++--- src/mediator/event/registry.py | 6 ++-- src/mediator/request/__init__.py | 2 +- src/mediator/request/local.py | 15 ++++---- src/mediator/request/registry.py | 6 ++-- src/mediator/utils/context.py | 4 +-- src/mediator/utils/inspection.py | 10 +++--- tests/common/factory/test_cascade.py | 9 ++--- tests/common/factory/test_factories.py | 4 +-- tests/common/factory/test_mappers.py | 2 +- tests/common/factory/test_utils.py | 28 +++++++-------- tests/common/handler/test_handlers.py | 4 +-- tests/common/registry/conftest.py | 5 +-- tests/common/registry/test_base.py | 6 ++-- .../common/registry/test_registry_registry.py | 10 +++--- tests/common/registry/test_registry_stores.py | 8 ++--- tests/common/test_modifiers.py | 2 +- tests/event/test_local.py | 4 +-- tests/request/test_request.py | 8 ++--- tests/utils/test_inspection.py | 16 ++++----- 40 files changed, 186 insertions(+), 172 deletions(-) diff --git a/README.md b/README.md index 0cd317f..f0f4443 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,6 @@ async def main(): # -- output -- # print message: test # data query: 1 - ``` More advanced example available in [example/test_request_advanced.py](example/test_request_advanced.py) for reference. diff --git a/pyproject.toml b/pyproject.toml index f8646aa..06adb2e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,3 +55,25 @@ exclude_also = [ "if TYPE_CHECKING:", "@overload", ] + +[tool.ruff] +line-length = 88 +src = ["src", "."] + +[tool.ruff.lint] +select = [ + "E", # pycodestyle + "W", + "F", # pyflakes + "I", # isort + "UP", # pyupgrade + "B", # bugbear + "C4", # comprehensions + "SIM", # simplify + "PT", # pytest style + "ASYNC", # asyncio pitfalls + "RUF", # ruff specific +] + +[tool.mypy] +files = ["src", "tests", "example"] diff --git a/src/mediator/common/factory/__init__.py b/src/mediator/common/factory/__init__.py index 313bd3f..f652e49 100644 --- a/src/mediator/common/factory/__init__.py +++ b/src/mediator/common/factory/__init__.py @@ -27,26 +27,21 @@ ) __all__ = [ - # base - "HandlerFactory", - "HandlerFactoryError", - "HandlerFactoryMapper", - "IncompatibleHandlerFactoryError", - # cascade + "CallableHandlerFactory", + "CallableHandlerPolicy", "ConfigHandlerFactoryCascadeError", + "DefaultHandlerFactoryMapper", + "HandlerFactory", "HandlerFactoryCascade", "HandlerFactoryCascadeError", + "HandlerFactoryError", + "HandlerFactoryMapper", "IncompatibleHandlerFactoryCascadeError", + "IncompatibleHandlerFactoryError", "InspectionHandlerFactoryCascadeError", - # factories - "CallableHandlerFactory", - "MethodHandlerFactory", - # mappers - "DefaultHandlerFactoryMapper", - "TypeHandlerFactoryMapper", - # policy - "CallableHandlerPolicy", "MappablePolicy", + "MethodHandlerFactory", "MethodHandlerPolicy", "PolicyType", + "TypeHandlerFactoryMapper", ] diff --git a/src/mediator/common/factory/base.py b/src/mediator/common/factory/base.py index ce7cdbf..31ca9fa 100644 --- a/src/mediator/common/factory/base.py +++ b/src/mediator/common/factory/base.py @@ -1,4 +1,5 @@ -from typing import Any, Iterable, Sequence +from collections.abc import Iterable, Sequence +from typing import Any from mediator.common.handler import Handler diff --git a/src/mediator/common/factory/cascade.py b/src/mediator/common/factory/cascade.py index 41a1f2a..2909a09 100644 --- a/src/mediator/common/factory/cascade.py +++ b/src/mediator/common/factory/cascade.py @@ -1,4 +1,5 @@ -from typing import Any, Iterable, Optional, Sequence, Tuple +from collections.abc import Iterable, Sequence +from typing import Any from mediator.common.factory.base import ( HandlerFactoryError, @@ -57,7 +58,7 @@ def __init__( self, *args, factory_errors: Sequence[ - Tuple[HandlerFactory, IncompatibleHandlerFactoryError] + tuple[HandlerFactory, IncompatibleHandlerFactoryError] ], ): """ @@ -81,7 +82,7 @@ class HandlerFactoryCascade: def __init__( self, policies: Iterable[PolicyType], - mapper: Optional[HandlerFactoryMapper] = None, + mapper: HandlerFactoryMapper | None = None, ): """ Initializes handler factory cascade. diff --git a/src/mediator/common/factory/mappers.py b/src/mediator/common/factory/mappers.py index c883cdd..2ca2fb3 100644 --- a/src/mediator/common/factory/mappers.py +++ b/src/mediator/common/factory/mappers.py @@ -1,4 +1,5 @@ -from typing import Any, Callable, Dict, Mapping, Optional, Type +from collections.abc import Callable, Mapping +from typing import Any from mediator.common.factory.base import HandlerFactory, HandlerFactoryMapper from mediator.common.factory.factories import ( @@ -16,7 +17,7 @@ class TypeHandlerFactoryMapper(HandlerFactoryMapper): using policy type to handler factory provider mapping. """ - def __init__(self, mapping: Mapping[Type[Any], Callable[[Any], HandlerFactory]]): + def __init__(self, mapping: Mapping[type[Any], Callable[[Any], HandlerFactory]]): """ Initializes type handler factory mapper. :param mapping: policy type to handler factory provider mapping @@ -48,9 +49,8 @@ class DefaultHandlerFactoryMapper(TypeHandlerFactoryMapper): def __init__( self, - extra_mapping: Optional[ - Mapping[Type[Any], Callable[[Any], HandlerFactory]] - ] = None, + extra_mapping: Mapping[type[Any], Callable[[Any], HandlerFactory]] + | None = None, ): """ Initializes library default handler factory mapper. @@ -68,7 +68,7 @@ def __init__( ) @classmethod - def default_mapping(cls) -> Dict[Type[Any], Type[HandlerFactory]]: + def default_mapping(cls) -> dict[type[Any], type[HandlerFactory]]: """ Provides library default policy type to handler factory provider mapping. :return: default policy type to handler factory provider mapping diff --git a/src/mediator/common/factory/policies.py b/src/mediator/common/factory/policies.py index a0cba92..c6aa886 100644 --- a/src/mediator/common/factory/policies.py +++ b/src/mediator/common/factory/policies.py @@ -1,5 +1,4 @@ from dataclasses import dataclass, field -from typing import Dict, List, Optional, Type, Union class MappablePolicy: @@ -26,9 +25,9 @@ class CallableHandlerPolicy(MappablePolicy): """ # subject arg is to provide explicit primary argument name - subject_arg: Optional[str] = None + subject_arg: str | None = None # arg map can be used for action args names to callable args names mapping - arg_map: Dict[str, str] = field(default_factory=dict) + arg_map: dict[str, str] = field(default_factory=dict) # force fill all action arguments into callable or only ones defined in signature arg_strict: bool = False @@ -67,7 +66,7 @@ class MethodHandlerPolicy(MappablePolicy): # attribute value callable handler policy policy: CallableHandlerPolicy = field(default_factory=CallableHandlerPolicy) # optional object type check (as be one of provided type sequence) - subtype_of: List[Type] = field(default_factory=list) + subtype_of: list[type] = field(default_factory=list) @property def precises_type(self) -> bool: @@ -94,4 +93,4 @@ def replace_map(self, policy: "MappablePolicy") -> "MethodHandlerPolicy": return self -PolicyType = Union[CallableHandlerPolicy, MethodHandlerPolicy, MappablePolicy] +PolicyType = CallableHandlerPolicy | MethodHandlerPolicy | MappablePolicy diff --git a/src/mediator/common/factory/utils.py b/src/mediator/common/factory/utils.py index effe88a..e6f28d6 100644 --- a/src/mediator/common/factory/utils.py +++ b/src/mediator/common/factory/utils.py @@ -1,4 +1,5 @@ -from typing import Any, Dict, Optional, Sequence, Tuple +from collections.abc import Sequence +from typing import Any from mediator.common.factory.base import ( HandlerFactoryError, @@ -24,7 +25,7 @@ def __call__(self, obj: Any) -> CallableDetails: try: return CallableInspector.inspect(obj) except TypeError as e: - raise IncompatibleHandlerFactoryError(f"{obj!r}: {e}") + raise IncompatibleHandlerFactoryError(f"{obj!r}: {e}") from e class CallableAttributeDetails: @@ -34,7 +35,7 @@ class CallableAttributeDetails: """ name: str - subtype_of: Tuple[Any, ...] + subtype_of: tuple[Any, ...] def __init__(self, name: str, owner_subtype_of: Sequence[Any] = ()): """ @@ -61,23 +62,24 @@ def __call__(self, obj: Any) -> CallableDetails: when expected attribute is not callable :return: callable object attribute `CallableDetails` result """ - if self.subtype_of: - if not isinstance(obj, self.subtype_of): - raise IncompatibleHandlerFactoryError( - f"Object {obj!r} is not type of {self.subtype_of}" - ) + if self.subtype_of and not isinstance(obj, self.subtype_of): + raise IncompatibleHandlerFactoryError( + f"Object {obj!r} is not type of {self.subtype_of}" + ) try: attr = getattr(obj, self.name) except AttributeError: raise IncompatibleHandlerFactoryError( f"Object {obj!r} has no attribute named {self.name}" - ) + ) from None try: return CallableInspector.inspect(attr) except TypeError as e: - raise IncompatibleHandlerFactoryError(f"{obj!r} attribute {self.name}: {e}") + raise IncompatibleHandlerFactoryError( + f"{obj!r} attribute {self.name}: {e}" + ) from e class HandlerSubjectArgGet: @@ -86,7 +88,7 @@ class HandlerSubjectArgGet: to be filled with action subject (event, request, command etc object). """ - def __init__(self, name: Optional[str] = None): + def __init__(self, name: str | None = None): """ Initializes utility that finds primary argument for given callable object. :param name: optional argument name hint; @@ -179,7 +181,7 @@ class CallableHandlerCreate: """ def __init__( - self, subject_as_keyword: bool, arg_map: Dict[str, str], arg_strict: bool + self, subject_as_keyword: bool, arg_map: dict[str, str], arg_strict: bool ): """ Initializes callable handler factory using given specification. @@ -208,7 +210,7 @@ def __call__(self, details: CallableDetails, arg: CallableArg, obj: Any) -> Hand if not details.is_async: raise HandlerFactoryError(f"Object {details.obj!r} is not async callable") - subject_name: Optional[str] + subject_name: str | None if self.subject_as_keyword or not arg.is_positional: subject_name = arg.name else: diff --git a/src/mediator/common/handler/__init__.py b/src/mediator/common/handler/__init__.py index 6b73bc5..031a354 100644 --- a/src/mediator/common/handler/__init__.py +++ b/src/mediator/common/handler/__init__.py @@ -2,9 +2,7 @@ from mediator.common.handler.handlers import CallableHandler __all__ = [ - # base + "CallableHandler", "Handler", "HandlerInfo", - # handlers - "CallableHandler", ] diff --git a/src/mediator/common/handler/base.py b/src/mediator/common/handler/base.py index aaa23ef..a5d9442 100644 --- a/src/mediator/common/handler/base.py +++ b/src/mediator/common/handler/base.py @@ -1,4 +1,5 @@ -from typing import Any, Hashable +from collections.abc import Hashable +from typing import Any from mediator.common.types import ActionResult, ActionSubject diff --git a/src/mediator/common/handler/handlers.py b/src/mediator/common/handler/handlers.py index a6ba07a..68b4798 100644 --- a/src/mediator/common/handler/handlers.py +++ b/src/mediator/common/handler/handlers.py @@ -1,13 +1,6 @@ +from collections.abc import Awaitable, Callable, Collection, Hashable, Mapping from typing import ( Any, - Awaitable, - Callable, - Collection, - Dict, - Hashable, - Mapping, - Optional, - Tuple, ) from mediator.common.handler.base import Handler @@ -21,16 +14,16 @@ class CallableHandler(Handler): with prepared arguments sourced from action object. """ - __slots__ = ("_obj", "_fn", "_key", "_arg_map", "_arg_filter", "_args") + __slots__ = ("_arg_filter", "_arg_map", "_args", "_fn", "_key", "_obj") def __init__( self, obj: Any, fn: Callable[..., Awaitable[Any]], key: Hashable, - subject_name: Optional[str], + subject_name: str | None, arg_map: Mapping[str, str], - allow_args: Optional[Collection[str]], + allow_args: Collection[str] | None, ): """ Creates callable handler object. @@ -93,20 +86,20 @@ def _arg_map_factory(cls, arg_map: Mapping[str, str]): """ if arg_map: - def _arg_map(kwargs: Dict[str, Any]): + def _arg_map(kwargs: dict[str, Any]): return { arg_map.get(name, name): value for name, value in kwargs.items() } else: - def _arg_map(kwargs: Dict[str, Any]): + def _arg_map(kwargs: dict[str, Any]): return kwargs return _arg_map @classmethod - def _arg_filter_factory(cls, allow_args: Optional[Collection[str]]): + def _arg_filter_factory(cls, allow_args: Collection[str] | None): """ Argument filter factory. Provides function that filters dictionary of underlying callable keyword args. @@ -117,19 +110,19 @@ def _arg_filter_factory(cls, allow_args: Optional[Collection[str]]): """ if allow_args is None: - def _arg_filter(kwargs: Dict[str, Any]): + def _arg_filter(kwargs: dict[str, Any]): return kwargs else: args = set(allow_args) - def _arg_filter(kwargs: Dict[str, Any]): + def _arg_filter(kwargs: dict[str, Any]): return {name: value for name, value in kwargs.items() if name in args} return _arg_filter @classmethod - def _args_factory(cls, subject_name: Optional[str]): + def _args_factory(cls, subject_name: str | None): """ Argument former factory. Provides function that forms underlying callable *args and **kwargs @@ -142,16 +135,16 @@ def _args_factory(cls, subject_name: Optional[str]): if subject_name: def _args( - subject: Any, kwargs: Dict[str, Any] - ) -> Tuple[Tuple[Any, ...], Dict[str, Any]]: + subject: Any, kwargs: dict[str, Any] + ) -> tuple[tuple[Any, ...], dict[str, Any]]: kwargs[subject_name] = subject # type: ignore return (), kwargs else: def _args( - subject: Any, kwargs: Dict[str, Any] - ) -> Tuple[Tuple[Any, ...], Dict[str, Any]]: + subject: Any, kwargs: dict[str, Any] + ) -> tuple[tuple[Any, ...], dict[str, Any]]: return (subject,), kwargs return _args diff --git a/src/mediator/common/modifiers.py b/src/mediator/common/modifiers.py index 1867ffc..f50bb9a 100644 --- a/src/mediator/common/modifiers.py +++ b/src/mediator/common/modifiers.py @@ -1,4 +1,4 @@ -from typing import Sequence +from collections.abc import Sequence from mediator.common.types import ( # noqa F401 ActionCallType, diff --git a/src/mediator/common/registry/__init__.py b/src/mediator/common/registry/__init__.py index 41fa725..0fc8fe7 100644 --- a/src/mediator/common/registry/__init__.py +++ b/src/mediator/common/registry/__init__.py @@ -14,17 +14,14 @@ ) __all__ = [ - # base + "CollectionHandlerStore", "CollisionHandlerStoreError", "HandlerEntry", + "HandlerRegistry", "HandlerStore", "HandlerStoreError", "InspectionHandlerStoreError", "LookupHandlerStoreError", - # registry - "HandlerRegistry", - # stores - "CollectionHandlerStore", "MappingHandlerStore", "ModifierHandlerStore", ] diff --git a/src/mediator/common/registry/base.py b/src/mediator/common/registry/base.py index 2ecceff..32784b2 100644 --- a/src/mediator/common/registry/base.py +++ b/src/mediator/common/registry/base.py @@ -1,5 +1,5 @@ +from collections.abc import Hashable, Iterable, Iterator, Sequence from dataclasses import dataclass -from typing import Hashable, Iterable, Iterator, Sequence from mediator.common.handler.base import Handler from mediator.common.modifiers import ModifierFactory, ModifierStack @@ -47,7 +47,7 @@ def stack(self, modifiers: Sequence[ModifierFactory]) -> "HandlerEntry": """ return HandlerEntry( handler=self.handler, - modifiers=tuple([*modifiers, *self.modifiers]), + modifiers=(*modifiers, *self.modifiers), ) diff --git a/src/mediator/common/registry/registry.py b/src/mediator/common/registry/registry.py index b164b17..a4f6f20 100644 --- a/src/mediator/common/registry/registry.py +++ b/src/mediator/common/registry/registry.py @@ -1,5 +1,6 @@ import functools -from typing import Any, Iterable, Iterator, Optional, Sequence +from collections.abc import Iterable, Iterator, Sequence +from typing import Any from mediator.common.factory.cascade import HandlerFactoryCascade from mediator.common.factory.policies import PolicyType @@ -19,8 +20,8 @@ class HandlerRegistry(HandlerStore): def __init__( self, store: HandlerStore, - policies: Optional[Sequence[PolicyType]] = None, - cascade: Optional[HandlerFactoryCascade] = None, + policies: Sequence[PolicyType] | None = None, + cascade: HandlerFactoryCascade | None = None, modifiers: Sequence[ModifierFactory] = (), ): """ @@ -47,9 +48,9 @@ def __init__( def register( self, - obj: Optional[Any] = None, + obj: Any | None = None, *, - policies: Optional[Sequence[PolicyType]] = None, + policies: Sequence[PolicyType] | None = None, modifiers: Sequence[ModifierFactory] = (), ): """ @@ -79,7 +80,7 @@ def wrap(fn: Any): return obj def _policies_cascade( - self, policies: Optional[Sequence[PolicyType]] + self, policies: Sequence[PolicyType] | None ) -> HandlerFactoryCascade: """ Provides handler factory cascade customized with given policies. diff --git a/src/mediator/common/registry/stores.py b/src/mediator/common/registry/stores.py index 61da05f..ff697e3 100644 --- a/src/mediator/common/registry/stores.py +++ b/src/mediator/common/registry/stores.py @@ -1,4 +1,4 @@ -from typing import Dict, Hashable, Iterable, Iterator, List, Sequence +from collections.abc import Hashable, Iterable, Iterator, Sequence from mediator.common.modifiers import ModifierFactory from mediator.common.registry.base import ( @@ -21,7 +21,7 @@ def __init__(self): """ Initializes collection handler store """ - self._entries: List[HandlerEntry] = [] + self._entries: list[HandlerEntry] = [] def add(self, entry: HandlerEntry): """ @@ -57,7 +57,7 @@ def __init__(self): """ Initializes mapping handler store """ - self._map: Dict[Hashable, HandlerEntry] = {} + self._map: dict[Hashable, HandlerEntry] = {} def add(self, entry: HandlerEntry): """ diff --git a/src/mediator/common/types.py b/src/mediator/common/types.py index 6770937..ad5405b 100644 --- a/src/mediator/common/types.py +++ b/src/mediator/common/types.py @@ -1,5 +1,6 @@ +from collections.abc import Awaitable, Callable, Hashable from dataclasses import dataclass -from typing import Any, Awaitable, Callable, Dict, Hashable +from typing import Any @dataclass @@ -10,7 +11,7 @@ class ActionSubject: """ subject: Any - inject: Dict[str, Any] + inject: dict[str, Any] @property def key(self) -> Hashable: diff --git a/src/mediator/event/__init__.py b/src/mediator/event/__init__.py index 921feba..045c498 100644 --- a/src/mediator/event/__init__.py +++ b/src/mediator/event/__init__.py @@ -11,9 +11,9 @@ "ConfigEventAggregateError", "EventAggregate", "EventAggregateError", + "EventHandlerRegistry", "EventPublish", "EventPublisher", "EventSubscriber", "LocalEventBus", - "EventHandlerRegistry", ] diff --git a/src/mediator/event/aggregate.py b/src/mediator/event/aggregate.py index 6ed1096..9daa6cc 100644 --- a/src/mediator/event/aggregate.py +++ b/src/mediator/event/aggregate.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, List, Optional, Tuple +from typing import Any from mediator.event.base import EventPublisher @@ -24,8 +24,8 @@ class EventAggregate: Used for staging events and publishing them in one transaction. """ - _publisher: Optional[EventPublisher] - _staged: List[Tuple[Any, Dict[str, Any]]] + _publisher: EventPublisher | None + _staged: list[tuple[Any, dict[str, Any]]] def __init__(self): """ diff --git a/src/mediator/event/base.py b/src/mediator/event/base.py index 2921c2d..f0874ad 100644 --- a/src/mediator/event/base.py +++ b/src/mediator/event/base.py @@ -1,4 +1,6 @@ -from typing import Any, AsyncContextManager, Iterable, Iterator +from collections.abc import Iterable, Iterator +from contextlib import AbstractAsyncContextManager +from typing import Any from mediator.common.registry import HandlerEntry, HandlerStore from mediator.utils.context import AsyncNullContextManager @@ -24,7 +26,7 @@ class EventPublisher(EventPublish): """ # noinspection PyMethodMayBeStatic - def transaction(self) -> AsyncContextManager[EventPublish]: + def transaction(self) -> AbstractAsyncContextManager[EventPublish]: """ Provides transaction context manager returning event publish interface, to publish events inside of transaction. diff --git a/src/mediator/event/local.py b/src/mediator/event/local.py index f64a984..bc4cfd9 100644 --- a/src/mediator/event/local.py +++ b/src/mediator/event/local.py @@ -1,6 +1,7 @@ import asyncio from collections import defaultdict -from typing import Any, DefaultDict, Hashable, Iterable, List, Optional, Sequence +from collections.abc import Hashable, Iterable, Sequence +from typing import Any from mediator.common.factory import ( CallableHandlerPolicy, @@ -24,7 +25,7 @@ class _EventSchedulerHandlerStore(CollectionHandlerStore): Schedules event processing as background asyncio tasks. """ - _groups: DefaultDict[Hashable, List[ActionCallType]] + _groups: defaultdict[Hashable, list[ActionCallType]] def __init__(self, sync_mode: bool = False): """ @@ -72,7 +73,7 @@ async def schedule(self, action: ActionSubject): """ key = action.key group: Sequence[ActionCallType] = self._groups.get(key, ()) - tasks = [asyncio.create_task(call(action)) for call in group] + tasks = [asyncio.ensure_future(call(action)) for call in group] if self.sync_mode: await asyncio.wait(tasks) @@ -87,8 +88,8 @@ class LocalEventBus(EventPublisher, HandlerRegistry, EventSubscriber): def __init__( self, - policies: Optional[Sequence[PolicyType]] = None, - cascade: Optional[HandlerFactoryCascade] = None, + policies: Sequence[PolicyType] | None = None, + cascade: HandlerFactoryCascade | None = None, modifiers: Sequence[ModifierFactory] = (), sync_mode: bool = False, ): diff --git a/src/mediator/event/registry.py b/src/mediator/event/registry.py index 13bbeaa..576015c 100644 --- a/src/mediator/event/registry.py +++ b/src/mediator/event/registry.py @@ -1,4 +1,4 @@ -from typing import Optional, Sequence +from collections.abc import Sequence from mediator.common.factory import ( CallableHandlerPolicy, @@ -18,8 +18,8 @@ class EventHandlerRegistry(HandlerRegistry): def __init__( self, - policies: Optional[Sequence[PolicyType]] = None, - cascade: Optional[HandlerFactoryCascade] = None, + policies: Sequence[PolicyType] | None = None, + cascade: HandlerFactoryCascade | None = None, modifiers: Sequence[ModifierFactory] = (), ): """ diff --git a/src/mediator/request/__init__.py b/src/mediator/request/__init__.py index 83128cb..b1e56be 100644 --- a/src/mediator/request/__init__.py +++ b/src/mediator/request/__init__.py @@ -3,7 +3,7 @@ from mediator.request.registry import RequestHandlerRegistry __all__ = [ - "RequestExecutor", "LocalRequestBus", + "RequestExecutor", "RequestHandlerRegistry", ] diff --git a/src/mediator/request/local.py b/src/mediator/request/local.py index 330965c..8ec64e7 100644 --- a/src/mediator/request/local.py +++ b/src/mediator/request/local.py @@ -1,4 +1,5 @@ -from typing import Any, Dict, Hashable, Iterable, Optional, Sequence +from collections.abc import Hashable, Iterable, Sequence +from typing import Any from mediator.common.factory import ( CallableHandlerPolicy, @@ -22,7 +23,7 @@ class _RequestExecutorHandlerStore(MappingHandlerStore): to work with local request execution. """ - _calls: Dict[Hashable, ActionCallType] + _calls: dict[Hashable, ActionCallType] def __init__(self): """ @@ -87,8 +88,8 @@ class LocalRequestBus(HandlerRegistry, RequestExecutor): def __init__( self, - policies: Optional[Sequence[PolicyType]] = None, - cascade: Optional[HandlerFactoryCascade] = None, + policies: Sequence[PolicyType] | None = None, + cascade: HandlerFactoryCascade | None = None, modifiers: Sequence[ModifierFactory] = (), ): """ @@ -123,7 +124,7 @@ async def execute(self, obj: Any, **kwargs): :return: request processing result """ result = await self._executor(ActionSubject(subject=obj, inject=kwargs)) - assert isinstance( - result, ActionResult - ), "modifier or handler should provide `ActionResult` type object" + assert isinstance(result, ActionResult), ( + "modifier or handler should provide `ActionResult` type object" + ) return result.result diff --git a/src/mediator/request/registry.py b/src/mediator/request/registry.py index cfc870c..8019cee 100644 --- a/src/mediator/request/registry.py +++ b/src/mediator/request/registry.py @@ -1,4 +1,4 @@ -from typing import Optional, Sequence +from collections.abc import Sequence from mediator.common.factory import ( CallableHandlerPolicy, @@ -18,8 +18,8 @@ class RequestHandlerRegistry(HandlerRegistry): def __init__( self, - policies: Optional[Sequence[PolicyType]] = None, - cascade: Optional[HandlerFactoryCascade] = None, + policies: Sequence[PolicyType] | None = None, + cascade: HandlerFactoryCascade | None = None, modifiers: Sequence[ModifierFactory] = (), ): """ diff --git a/src/mediator/utils/context.py b/src/mediator/utils/context.py index e398e52..66d5d68 100644 --- a/src/mediator/utils/context.py +++ b/src/mediator/utils/context.py @@ -1,4 +1,4 @@ -from typing import Generic, Optional, TypeVar +from typing import Generic, TypeVar T = TypeVar("T") @@ -8,7 +8,7 @@ class AsyncNullContextManager(Generic[T]): Asyncio null context manager - zero functionality context manager. """ - def __init__(self, return_value: Optional[T] = None): + def __init__(self, return_value: T | None = None): """ Initializes asyncio null context manager. :param return_value: optional value returned in `when` statement diff --git a/src/mediator/utils/inspection.py b/src/mediator/utils/inspection.py index 133196d..344a974 100644 --- a/src/mediator/utils/inspection.py +++ b/src/mediator/utils/inspection.py @@ -1,7 +1,7 @@ import inspect from dataclasses import dataclass from inspect import Parameter -from typing import Any, List, Optional, get_type_hints +from typing import Any, get_type_hints @dataclass @@ -13,7 +13,7 @@ class CallableArg: # argument name name: str # argument type annotation - type: Optional[Any] + type: Any | None # argument is positional flag is_positional: bool @@ -39,13 +39,13 @@ class CallableIODetails: """ # list of callable arguments details - args: List[CallableArg] + args: list[CallableArg] # when True callable accepts variadic keyword args like **kwargs has_kwargs: bool # return type annotation - return_type: Optional[Any] + return_type: Any | None - def arg_by_name(self, name: str) -> Optional[CallableArg]: + def arg_by_name(self, name: str) -> CallableArg | None: """ Returns callable argument details with matching name, or None when there is no match. diff --git a/tests/common/factory/test_cascade.py b/tests/common/factory/test_cascade.py index 0704a47..14c1992 100644 --- a/tests/common/factory/test_cascade.py +++ b/tests/common/factory/test_cascade.py @@ -1,4 +1,5 @@ -from typing import Any, Callable, Sequence +from collections.abc import Callable, Sequence +from typing import Any import pytest @@ -75,14 +76,14 @@ def _check_incompatible_error(error: HandlerFactoryCascadeError): assert len(factory_errors) == 2 for (factory, factory_error), factory_type in zip( - factory_errors, [MethodHandlerFactory, CallableHandlerFactory] + factory_errors, [MethodHandlerFactory, CallableHandlerFactory], strict=False ): assert isinstance(factory, factory_type) assert isinstance(factory_error, IncompatibleHandlerFactoryError) @pytest.mark.parametrize( - "obj, policies, error_check", + ("obj", "policies", "error_check"), [ (None, [], _check_config_error), (_A(), [MethodHandlerPolicy(name="method_no_type")], _check_inspect_error), @@ -98,7 +99,7 @@ def test_handler_factory_cascade_error( policies: Sequence[PolicyType], error_check: Callable[[HandlerFactoryCascadeError], Any], ): - with pytest.raises(HandlerFactoryCascadeError) as e: + with pytest.raises(HandlerFactoryCascadeError) as e: # noqa: PT012 cascade = HandlerFactoryCascade(policies=policies) cascade(obj) error_check(e.value) diff --git a/tests/common/factory/test_factories.py b/tests/common/factory/test_factories.py index b9f5584..b9efa37 100644 --- a/tests/common/factory/test_factories.py +++ b/tests/common/factory/test_factories.py @@ -34,7 +34,7 @@ async def _check_handler(handler: Handler): @pytest.mark.parametrize( - "obj, policy", + ("obj", "policy"), [ (_A().a, CallableHandlerPolicy(arg_strict=True)), (_A().b, CallableHandlerPolicy(arg_map={"x": "a", "y": "b"}, arg_strict=True)), @@ -49,7 +49,7 @@ async def test_callable_handler_factory(obj, policy: CallableHandlerPolicy): @pytest.mark.parametrize( - "obj, policy", + ("obj", "policy"), [ (_A(), MethodHandlerPolicy(name="a")), ( diff --git a/tests/common/factory/test_mappers.py b/tests/common/factory/test_mappers.py index 8305ca4..4ce8402 100644 --- a/tests/common/factory/test_mappers.py +++ b/tests/common/factory/test_mappers.py @@ -10,7 +10,7 @@ @pytest.mark.parametrize( - "policy, factory_type", + ("policy", "factory_type"), [ (CallableHandlerPolicy(), CallableHandlerFactory), (MethodHandlerPolicy(name="method"), MethodHandlerFactory), diff --git a/tests/common/factory/test_utils.py b/tests/common/factory/test_utils.py index 11dce0c..26a008b 100644 --- a/tests/common/factory/test_utils.py +++ b/tests/common/factory/test_utils.py @@ -1,4 +1,4 @@ -from typing import Dict, Optional, Sequence, Type +from collections.abc import Sequence import pytest @@ -21,7 +21,7 @@ def method_no_args(self): return # noinspection PyUnusedLocal - def method(self, one: str, two: int, three: Optional[str], four) -> _A: + def method(self, one: str, two: int, three: str | None, four) -> _A: return self @@ -61,7 +61,7 @@ def test_callable_obj_details(): @pytest.mark.parametrize( - "obj, subtype_of, error, error_message", + ("obj", "subtype_of", "error", "error_message"), [ (_B(), (), None, None), (_A(), (), IncompatibleHandlerFactoryError, "no attribute"), @@ -72,9 +72,9 @@ def test_callable_obj_details(): ) def test_callable_attribute_details( obj, - subtype_of: Sequence[Type], - error: Optional[Type[Exception]], - error_message: Optional[str], + subtype_of: Sequence[type], + error: type[Exception] | None, + error_message: str | None, ): get_details = CallableAttributeDetails(name="method", owner_subtype_of=subtype_of) if error: @@ -88,7 +88,7 @@ def test_callable_attribute_details( @pytest.mark.parametrize( - "obj, name, expected_name, error, error_message", + ("obj", "name", "expected_name", "error", "error_message"), [ (_B().method, None, "one", None, None), (_B().method, "two", "two", None, None), @@ -118,10 +118,10 @@ def test_callable_attribute_details( ) def test_subject_arg_get( obj, - name: Optional[str], + name: str | None, expected_name, - error: Optional[Type[Exception]], - error_message: Optional[str], + error: type[Exception] | None, + error_message: str | None, ): get_details = CallableObjDetails() arg_get = HandlerSubjectArgGet(name=name) @@ -142,7 +142,7 @@ def _result(*args, **kwargs): @pytest.mark.parametrize( - "obj, sig, name, arg_map, expected_result", + ("obj", "sig", "name", "arg_map", "expected_result"), [ (_C.async_call, _C.a_signature, None, {}, _result("test", x=1, y=2)), (_C.async_call, _C.a_signature, "arg", {}, _result(arg="test", x=1, y=2)), @@ -160,8 +160,8 @@ def _result(*args, **kwargs): async def test_direct_handler_create_successful( obj, sig, - name: Optional[str], - arg_map: Dict[str, str], + name: str | None, + arg_map: dict[str, str], expected_result, ): get_details = CallableObjDetails() @@ -183,7 +183,7 @@ async def test_direct_handler_create_successful( @pytest.mark.parametrize( - "obj, error, error_message", + ("obj", "error", "error_message"), [ (_C.sync_call, HandlerFactoryError, "not async callable"), ], diff --git a/tests/common/handler/test_handlers.py b/tests/common/handler/test_handlers.py index b51b994..84d3ab0 100644 --- a/tests/common/handler/test_handlers.py +++ b/tests/common/handler/test_handlers.py @@ -18,7 +18,7 @@ def _result(*args, **kwargs): @pytest.mark.parametrize( - "subject_name, arg_map, allow_args, expected_result", + ("subject_name", "arg_map", "allow_args", "expected_result"), [ (None, {}, None, _result("test", a=10, b=20)), ("subject", {}, None, _result(subject="test", a=10, b=20)), @@ -39,7 +39,7 @@ async def test_callable_handler_call( arg_map=arg_map, allow_args=allow_args, ) - assert handler.key == str + assert handler.key is str assert handler.obj == _fn result = await handler(action) assert isinstance(result, ActionResult) diff --git a/tests/common/registry/conftest.py b/tests/common/registry/conftest.py index a34e7fe..e983d6e 100644 --- a/tests/common/registry/conftest.py +++ b/tests/common/registry/conftest.py @@ -1,4 +1,5 @@ -from typing import Any, Callable, Hashable, Type +from collections.abc import Callable, Hashable +from typing import Any import pytest @@ -7,7 +8,7 @@ class MockupHandler(Handler): - def __init__(self, type_: Type): + def __init__(self, type_: type): self.type_ = type_ @property diff --git a/tests/common/registry/test_base.py b/tests/common/registry/test_base.py index 90156a6..9f112f6 100644 --- a/tests/common/registry/test_base.py +++ b/tests/common/registry/test_base.py @@ -1,11 +1,11 @@ -from typing import Callable +from collections.abc import Callable import pytest from mediator.common.registry import HandlerEntry +from mediator.common.types import ActionResult, ActionSubject from tests.common.registry.conftest import MockupHandler from tests.common.test_modifiers import MockupModifierFactory -from mediator.common.types import ActionResult, ActionSubject async def _return_seq(subject: ActionSubject) -> ActionResult: @@ -35,7 +35,7 @@ async def test_handler_entry(mockup_action_factory: Callable[[], ActionSubject]) modifiers=MockupModifierFactory.modifiers(extended_seq) ) assert extended_entry.handler == entry.handler - for modifier, seq_item in zip(extended_entry.modifiers, overall_seq): + for modifier, seq_item in zip(extended_entry.modifiers, overall_seq, strict=False): assert isinstance(modifier, MockupModifierFactory) assert modifier.seq_item == seq_item call = extended_entry.pipeline(_return_seq) diff --git a/tests/common/registry/test_registry_registry.py b/tests/common/registry/test_registry_registry.py index 0649f5b..5cde844 100644 --- a/tests/common/registry/test_registry_registry.py +++ b/tests/common/registry/test_registry_registry.py @@ -1,4 +1,4 @@ -from typing import Callable, List, Sequence +from collections.abc import Callable, Sequence import pytest @@ -12,8 +12,8 @@ ) from mediator.common.modifiers import ModifierFactory from mediator.common.registry import CollectionHandlerStore, HandlerRegistry -from tests.common.test_modifiers import MockupModifierFactory from mediator.common.types import ActionSubject +from tests.common.test_modifiers import MockupModifierFactory def test_handler_registry_config_error(): @@ -54,7 +54,7 @@ def _registry_policies_factory(): [_registry_cascade_factory, _registry_policies_factory], ) @pytest.mark.parametrize( - "policies, incompatible, compatible", + ("policies", "incompatible", "compatible"), [ (None, _A(), _handle), ([MethodHandlerPolicy(name="handle")], _handle, _A()), @@ -85,12 +85,12 @@ async def test_handler_registry_policy( assert result.result == "test" -async def _return_seq(_: str, seq: List[str]): +async def _return_seq(_: str, seq: list[str]): return seq @pytest.mark.parametrize( - "global_modifiers, local_modifiers, seq", + ("global_modifiers", "local_modifiers", "seq"), [ (MockupModifierFactory.modifiers("abc"), (), list("abc")), ((), MockupModifierFactory.modifiers("xyz"), list("xyz")), diff --git a/tests/common/registry/test_registry_stores.py b/tests/common/registry/test_registry_stores.py index dd2de07..1022f8d 100644 --- a/tests/common/registry/test_registry_stores.py +++ b/tests/common/registry/test_registry_stores.py @@ -1,4 +1,4 @@ -from typing import Callable, Sequence +from collections.abc import Callable, Sequence import pytest @@ -10,9 +10,9 @@ MappingHandlerStore, ModifierHandlerStore, ) +from mediator.common.types import ActionSubject from tests.common.registry.conftest import MockupHandler from tests.common.test_modifiers import MockupModifierFactory -from mediator.common.types import ActionSubject @pytest.fixture @@ -70,7 +70,7 @@ def test_mapping_handler_store( store.add(first_part[0]) found = store.get(int) - assert found.key == int + assert found.key is int assert found.handler == first_part[1].handler with pytest.raises(LookupHandlerStoreError): @@ -79,7 +79,7 @@ def test_mapping_handler_store( @pytest.mark.asyncio async def test_modifier_handler_store( - mockup_action_factory: Callable[[], ActionSubject] + mockup_action_factory: Callable[[], ActionSubject], ): entry_modifiers = MockupModifierFactory.modifiers("xyz") entry = HandlerEntry( diff --git a/tests/common/test_modifiers.py b/tests/common/test_modifiers.py index f0b50fb..3b697b9 100644 --- a/tests/common/test_modifiers.py +++ b/tests/common/test_modifiers.py @@ -1,4 +1,4 @@ -from typing import Collection +from collections.abc import Collection import pytest diff --git a/tests/event/test_local.py b/tests/event/test_local.py index 44c8d35..fce29be 100644 --- a/tests/event/test_local.py +++ b/tests/event/test_local.py @@ -1,5 +1,5 @@ import asyncio -from typing import Mapping, Type +from collections.abc import Mapping import pytest @@ -15,7 +15,7 @@ class _MockupEvent2: pass -def _create_event_handler(events: Mapping[int, asyncio.Event], index: int, type_: Type): +def _create_event_handler(events: Mapping[int, asyncio.Event], index: int, type_: type): async def _event_handler(_: type_): # type: ignore await asyncio.sleep(0.0) events[index].set() diff --git a/tests/request/test_request.py b/tests/request/test_request.py index 2ecef74..69d9e3e 100644 --- a/tests/request/test_request.py +++ b/tests/request/test_request.py @@ -1,11 +1,9 @@ -from typing import List - import pytest from mediator.common.factory import CallableHandlerPolicy from mediator.common.registry import LookupHandlerStoreError -from tests.common.test_modifiers import MockupModifierFactory from mediator.request import LocalRequestBus, RequestHandlerRegistry +from tests.common.test_modifiers import MockupModifierFactory class _RequestA: @@ -17,12 +15,12 @@ class _RequestB: # noinspection PyUnusedLocal -async def _handle_a(a: _RequestA, seq: List[str]): +async def _handle_a(a: _RequestA, seq: list[str]): return seq # noinspection PyUnusedLocal -async def _handle_b(b: _RequestB, seq: List[str]): +async def _handle_b(b: _RequestB, seq: list[str]): return seq diff --git a/tests/utils/test_inspection.py b/tests/utils/test_inspection.py index c4ccf01..cfa4142 100644 --- a/tests/utils/test_inspection.py +++ b/tests/utils/test_inspection.py @@ -1,4 +1,4 @@ -from typing import Optional, Sequence, Type +from collections.abc import Sequence import pytest @@ -12,15 +12,15 @@ class X: def _check_arg( args: Sequence[CallableArg], names: Sequence[str] = ("x", "other"), - types: Sequence[Optional[Type]] = (X, int), + types: Sequence[type | None] = (X, int), positionals: Sequence[bool] = (True, True), ): assert len(args) == len(names) - for arg, name in zip(args, names): + for arg, name in zip(args, names, strict=False): assert arg.name == name - for arg, type_ in zip(args, types): + for arg, type_ in zip(args, types, strict=False): assert arg.type == type_ - for arg, is_positional in zip(args, positionals): + for arg, is_positional in zip(args, positionals, strict=False): assert arg.is_positional == is_positional @@ -94,13 +94,13 @@ def call_check(details: CallableDetails): assert not details.is_method assert not details.is_routine assert details.is_async - assert details.return_type == str + assert details.return_type is str _check_arg(details.args, types=[X, int]) # noinspection PyUnusedLocal async def a(x: X, other: int) -> X: - pass + return x def a_check(details: CallableDetails): @@ -123,7 +123,7 @@ def b_check(details: CallableDetails): @pytest.mark.parametrize( - "fn, test_fn", + ("fn", "test_fn"), [ (Methods().a, Methods.a_check), (Methods().b, Methods.b_check), From 18591c626ea01787c9f5caf506ba7fd6eab329cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20=C5=81ukawski?= Date: Sun, 15 Nov 2026 14:10:59 +0000 Subject: [PATCH 04/11] Rewrite the CI workflow around uv and ruff, test Python 3.11 to 3.14 and PyPy, and publish with PyPI trusted publishing. --- .github/workflows/ci.yml | 150 ++++++++------------------------------- 1 file changed, 29 insertions(+), 121 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3be32b..b53b05f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,35 +8,22 @@ on: - '**' pull_request: {} +permissions: + contents: read + jobs: lints: name: Code lints runs-on: ubuntu-latest steps: - #---------------------------------------------- - # check-out repo and set-up python - #---------------------------------------------- - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: 3.8 - #---------------------------------------------- - # load pip cache if cache exists - #---------------------------------------------- - - uses: actions/cache@v2 + - uses: actions/checkout@v7 + - uses: astral-sh/setup-uv@v7 with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip - restore-keys: ${{ runner.os }}-pip - #---------------------------------------------- - # install and run linters - #---------------------------------------------- - - run: python -m pip install black flake8 isort mypy pytest - - run: | - flake8 src/ tests/ example/ - black src/ tests/ example/ --check - isort src/ tests/ example/ --check - mypy src/ tests/ example/ + enable-cache: true + - run: uv sync --locked + - run: uv run ruff check . + - run: uv run ruff format --check . + - run: uv run mypy tests: needs: [lints] @@ -45,113 +32,34 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.7'] - env: - PYTHONPATH: src - PYTHON: ${{ matrix.python-version }} - + python-version: ['3.11', '3.12', '3.13', '3.14', 'pypy3.11'] steps: - #---------------------------------------------- - # check-out repo and set-up environment - #---------------------------------------------- - - uses: actions/checkout@v2 - - name: Set up python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + - uses: actions/checkout@v7 + - uses: astral-sh/setup-uv@v7 with: + enable-cache: true python-version: ${{ matrix.python-version }} - - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - #---------------------------------------------- - # setup only test dependencies - #---------------------------------------------- - - name: Remove lint dependencies - run: | - mv pyproject.toml ~pyproject.toml - cat ~pyproject.toml | sed '/^mypy =/d' | sed '/^black =/d' | sed '/^isort =/d' | sed '/^flake8[a-zA-Z-]* =/d' > pyproject.toml - - name: Install dependencies - run: poetry install --no-interaction --no-root - #---------------------------------------------- - # run tests with code coverage - #---------------------------------------------- - - name: Run tests - run: | - source .venv/bin/activate - pytest tests/ example/ --cov - env: - COVERAGE_FILE: coverage/.coverage.py${{ matrix.python-version }} - #---------------------------------------------- - # store code coverage - #---------------------------------------------- - - name: Store coverage files - uses: actions/upload-artifact@v2 - with: - name: coverage - path: coverage - - coverage-upload: - needs: [tests] - name: Coverage upload - runs-on: ubuntu-latest - steps: - #---------------------------------------------- - # setup environment - #---------------------------------------------- - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: Setup depdendencies - run: pip install coverage - #---------------------------------------------- - # prepare coverage data - #---------------------------------------------- - - name: Get coverage files - uses: actions/download-artifact@v2 - with: - name: coverage - path: coverage - - name: Combine coverage files - run: | - coverage combine coverage - coverage report - coverage xml - #---------------------------------------------- - # upload code coverage - #---------------------------------------------- + - run: uv sync --locked --no-dev --group test + - run: uv run --no-sync pytest --cov --cov-report=xml - name: Upload coverage - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v7 with: - file: ./coverage.xml - fail_ci_if_error: true + files: coverage.xml + flags: py${{ matrix.python-version }} + token: ${{ secrets.CODECOV_TOKEN }} build-deploy: name: Build & deploy needs: [lints, tests] if: "success() && startsWith(github.ref, 'refs/tags/')" - env: - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} - runs-on: ubuntu-latest + environment: pypi + permissions: + contents: read + # required for PyPI trusted publishing + id-token: write steps: - #---------------------------------------------- - # check-out repo and set-up python - #---------------------------------------------- - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - - name: Configure poetry credentials - run: | - poetry config pypi-token.pypi "${PYPI_TOKEN}" - #---------------------------------------------- - # build and deploy with poetry - #---------------------------------------------- - - name: Build & deploy - run: | - poetry publish --build + - uses: actions/checkout@v7 + - uses: astral-sh/setup-uv@v7 + - run: uv build + - run: uv publish From dff530cdffc1b6cfa9e6614b36938c0b92e26ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20=C5=81ukawski?= Date: Sun, 15 Nov 2026 14:13:47 +0000 Subject: [PATCH 05/11] Type the package strictly: ports become Protocols, the package ships py.typed and mypy runs in strict mode. Modifier factories now receive the target as an explicit keyword argument. --- pyproject.toml | 7 ++ src/mediator/common/factory/base.py | 19 +++-- src/mediator/common/factory/cascade.py | 16 ++--- src/mediator/common/factory/factories.py | 4 +- src/mediator/common/factory/mappers.py | 6 +- src/mediator/common/factory/policies.py | 2 +- src/mediator/common/factory/utils.py | 10 +-- src/mediator/common/handler/base.py | 29 ++------ src/mediator/common/handler/handlers.py | 34 +++++---- src/mediator/common/modifiers.py | 21 +++--- src/mediator/common/registry/base.py | 13 ++-- src/mediator/common/registry/registry.py | 47 ++++++++----- src/mediator/common/registry/stores.py | 20 +++--- src/mediator/event/aggregate.py | 12 ++-- src/mediator/event/base.py | 39 +++++----- src/mediator/event/local.py | 21 +++--- src/mediator/event/registry.py | 5 +- src/mediator/py.typed | 0 src/mediator/request/base.py | 8 +-- src/mediator/request/local.py | 15 ++-- src/mediator/request/registry.py | 5 +- src/mediator/utils/context.py | 22 ------ tests/common/factory/test_policies.py | 6 +- tests/common/registry/conftest.py | 2 +- tests/common/test_modifiers.py | 2 +- tests/test_ports.py | 90 ++++++++++++++++++++++++ 26 files changed, 264 insertions(+), 191 deletions(-) create mode 100644 src/mediator/py.typed delete mode 100644 src/mediator/utils/context.py create mode 100644 tests/test_ports.py diff --git a/pyproject.toml b/pyproject.toml index 06adb2e..4fde2c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,3 +77,10 @@ select = [ [tool.mypy] files = ["src", "tests", "example"] +strict = true + +[[tool.mypy.overrides]] +module = ["tests.*", "example.*"] +disallow_untyped_defs = false +disallow_incomplete_defs = false +disallow_untyped_calls = false diff --git a/src/mediator/common/factory/base.py b/src/mediator/common/factory/base.py index 31ca9fa..96c7ec8 100644 --- a/src/mediator/common/factory/base.py +++ b/src/mediator/common/factory/base.py @@ -1,5 +1,6 @@ +from abc import ABC, abstractmethod from collections.abc import Iterable, Sequence -from typing import Any +from typing import Any, Protocol from mediator.common.handler import Handler @@ -21,17 +22,25 @@ class IncompatibleHandlerFactoryError(TypeError, HandlerFactoryError): """ -class HandlerFactory: +class HandlerFactory(Protocol): """ Handler factory is an abstraction over action handler creation form underlying object. """ def create(self, obj: Any) -> Handler: - raise NotImplementedError + """ + Creates handler for given object. + :param obj: object to create handler for + :raises IncompatibleHandlerFactoryError: when object is incompatible + with factory specification + :raises HandlerFactoryError: when there is failure during object inspection + :return: handler for given object + """ + ... -class HandlerFactoryMapper: +class HandlerFactoryMapper(ABC): """ Handler factory mapper abstraction. Maps policy (specification) into handler factory object. @@ -45,10 +54,10 @@ def map_all(self, policies: Iterable[Any]) -> Sequence[HandlerFactory]: """ return [self.map(policy) for policy in policies] + @abstractmethod def map(self, policy: Any) -> HandlerFactory: """ Maps given policy (specification) into handler factory :param policy: given policy (specification) :return: handler factory object """ - raise NotImplementedError diff --git a/src/mediator/common/factory/cascade.py b/src/mediator/common/factory/cascade.py index 2909a09..b246027 100644 --- a/src/mediator/common/factory/cascade.py +++ b/src/mediator/common/factory/cascade.py @@ -2,14 +2,12 @@ from typing import Any from mediator.common.factory.base import ( - HandlerFactoryError, - IncompatibleHandlerFactoryError, -) -from mediator.common.factory.mappers import ( - DefaultHandlerFactoryMapper, HandlerFactory, + HandlerFactoryError, HandlerFactoryMapper, + IncompatibleHandlerFactoryError, ) +from mediator.common.factory.mappers import DefaultHandlerFactoryMapper from mediator.common.factory.policies import PolicyType from mediator.common.handler import Handler @@ -36,7 +34,7 @@ class InspectionHandlerFactoryCascadeError(HandlerFactoryCascadeError): raises inspection machinery failure (non usual situation) error. """ - def __init__(self, *args, factory: HandlerFactory): + def __init__(self, *args: object, factory: HandlerFactory) -> None: """ Initializes inspection handler factory cascade error. :param args: python exception args @@ -56,11 +54,11 @@ class IncompatibleHandlerFactoryCascadeError(HandlerFactoryCascadeError): def __init__( self, - *args, + *args: object, factory_errors: Sequence[ tuple[HandlerFactory, IncompatibleHandlerFactoryError] ], - ): + ) -> None: """ Initializes incompatible handler factory cascade error. :param args: python exception args @@ -83,7 +81,7 @@ def __init__( self, policies: Iterable[PolicyType], mapper: HandlerFactoryMapper | None = None, - ): + ) -> None: """ Initializes handler factory cascade. :param policies: iterable providing sequence of policies diff --git a/src/mediator/common/factory/factories.py b/src/mediator/common/factory/factories.py index 0721bde..88a0f26 100644 --- a/src/mediator/common/factory/factories.py +++ b/src/mediator/common/factory/factories.py @@ -18,7 +18,7 @@ class CallableHandlerFactory(HandlerFactory): Factory that produces callable handler directly from callable object. """ - def __init__(self, policy: CallableHandlerPolicy): + def __init__(self, policy: CallableHandlerPolicy) -> None: """ Initializes callable handler factory. :param policy: policy used as a configuration or specification @@ -54,7 +54,7 @@ class MethodHandlerFactory(HandlerFactory): - in most cases method. """ - def __init__(self, policy: MethodHandlerPolicy): + def __init__(self, policy: MethodHandlerPolicy) -> None: """ Initializes method handler factory. :param policy: policy used as a configuration or specification diff --git a/src/mediator/common/factory/mappers.py b/src/mediator/common/factory/mappers.py index 2ca2fb3..904f704 100644 --- a/src/mediator/common/factory/mappers.py +++ b/src/mediator/common/factory/mappers.py @@ -17,7 +17,9 @@ class TypeHandlerFactoryMapper(HandlerFactoryMapper): using policy type to handler factory provider mapping. """ - def __init__(self, mapping: Mapping[type[Any], Callable[[Any], HandlerFactory]]): + def __init__( + self, mapping: Mapping[type[Any], Callable[[Any], HandlerFactory]] + ) -> None: """ Initializes type handler factory mapper. :param mapping: policy type to handler factory provider mapping @@ -51,7 +53,7 @@ def __init__( self, extra_mapping: Mapping[type[Any], Callable[[Any], HandlerFactory]] | None = None, - ): + ) -> None: """ Initializes library default handler factory mapper. :param extra_mapping: diff --git a/src/mediator/common/factory/policies.py b/src/mediator/common/factory/policies.py index c6aa886..0a2fc7f 100644 --- a/src/mediator/common/factory/policies.py +++ b/src/mediator/common/factory/policies.py @@ -32,7 +32,7 @@ class CallableHandlerPolicy(MappablePolicy): arg_strict: bool = False @property - def subject_as_keyword(self): + def subject_as_keyword(self) -> bool: """ Should primary argument provided as a keyword arg. :return: True when according to policy primary argument diff --git a/src/mediator/common/factory/utils.py b/src/mediator/common/factory/utils.py index e6f28d6..1c85c62 100644 --- a/src/mediator/common/factory/utils.py +++ b/src/mediator/common/factory/utils.py @@ -37,7 +37,7 @@ class CallableAttributeDetails: name: str subtype_of: tuple[Any, ...] - def __init__(self, name: str, owner_subtype_of: Sequence[Any] = ()): + def __init__(self, name: str, owner_subtype_of: Sequence[Any] = ()) -> None: """ Initializes callable attribute inspection object, that (optionally) checks if object has valid type @@ -88,7 +88,7 @@ class HandlerSubjectArgGet: to be filled with action subject (event, request, command etc object). """ - def __init__(self, name: str | None = None): + def __init__(self, name: str | None = None) -> None: """ Initializes utility that finds primary argument for given callable object. :param name: optional argument name hint; @@ -131,7 +131,7 @@ def _find(self, details: CallableDetails) -> CallableArg: return self._get_first(details) @staticmethod - def _find_by_name(details: CallableDetails, name: str): + def _find_by_name(details: CallableDetails, name: str) -> CallableArg: """ Tries to find primary argument by name using given callable details. :param details: callable details @@ -156,7 +156,7 @@ def _get_first(details: CallableDetails) -> CallableArg: return details.args[0] @staticmethod - def _check_type(details: CallableDetails, arg: CallableArg): + def _check_type(details: CallableDetails, arg: CallableArg) -> None: """ Checks given primary argument candidate is a valid one :param details: callable details @@ -182,7 +182,7 @@ class CallableHandlerCreate: def __init__( self, subject_as_keyword: bool, arg_map: dict[str, str], arg_strict: bool - ): + ) -> None: """ Initializes callable handler factory using given specification. :param subject_as_keyword: diff --git a/src/mediator/common/handler/base.py b/src/mediator/common/handler/base.py index a5d9442..d26b6e8 100644 --- a/src/mediator/common/handler/base.py +++ b/src/mediator/common/handler/base.py @@ -1,10 +1,10 @@ from collections.abc import Hashable -from typing import Any +from typing import Any, Protocol, runtime_checkable from mediator.common.types import ActionResult, ActionSubject -class HandlerInfo: +class HandlerInfo(Protocol): """ An abstraction that defines handler specification interface. """ @@ -15,7 +15,7 @@ def key(self) -> Hashable: Provides unique key that will be used to match given handler with action. :return: hashable key """ - raise NotImplementedError + ... @property def obj(self) -> Any: @@ -23,35 +23,20 @@ def obj(self) -> Any: Provides handler related object - source of handler behaviour :return: handler related object - source of handler behaviour """ - raise NotImplementedError + ... -class Handler(HandlerInfo): +@runtime_checkable +class Handler(HandlerInfo, Protocol): """ An abstraction that unifies the handler specification and invocation interface. Is an adapter to the underlying object complexity. """ - @property - def key(self) -> Hashable: - """ - Provides unique key that will be used to match given handler with action. - :return: hashable key - """ - raise NotImplementedError - - @property - def obj(self) -> Any: - """ - Provides handler related object - source of handler behaviour - :return: handler related object - source of handler behaviour - """ - raise NotImplementedError - async def __call__(self, action: ActionSubject) -> ActionResult: """ Performs handler action with given argument values. :param action: action subject including argument values :return: action result object including return value """ - raise NotImplementedError + ... diff --git a/src/mediator/common/handler/handlers.py b/src/mediator/common/handler/handlers.py index 68b4798..24ff72e 100644 --- a/src/mediator/common/handler/handlers.py +++ b/src/mediator/common/handler/handlers.py @@ -1,11 +1,13 @@ from collections.abc import Awaitable, Callable, Collection, Hashable, Mapping -from typing import ( - Any, -) +from typing import Any from mediator.common.handler.base import Handler from mediator.common.types import ActionResult, ActionSubject +_Kwargs = dict[str, Any] +_KwargsMap = Callable[[_Kwargs], _Kwargs] +_ArgsFormer = Callable[[Any, _Kwargs], tuple[tuple[Any, ...], _Kwargs]] + class CallableHandler(Handler): """ @@ -24,7 +26,7 @@ def __init__( subject_name: str | None, arg_map: Mapping[str, str], allow_args: Collection[str] | None, - ): + ) -> None: """ Creates callable handler object. :param obj: object used as information of handler behaviour source @@ -76,7 +78,7 @@ async def __call__(self, action: ActionSubject) -> ActionResult: return ActionResult(result) @classmethod - def _arg_map_factory(cls, arg_map: Mapping[str, str]): + def _arg_map_factory(cls, arg_map: Mapping[str, str]) -> _KwargsMap: """ Argument mapping factory. Provides function that maps dictionary of keyword args @@ -86,20 +88,20 @@ def _arg_map_factory(cls, arg_map: Mapping[str, str]): """ if arg_map: - def _arg_map(kwargs: dict[str, Any]): + def _arg_map(kwargs: _Kwargs) -> _Kwargs: return { arg_map.get(name, name): value for name, value in kwargs.items() } else: - def _arg_map(kwargs: dict[str, Any]): + def _arg_map(kwargs: _Kwargs) -> _Kwargs: return kwargs return _arg_map @classmethod - def _arg_filter_factory(cls, allow_args: Collection[str] | None): + def _arg_filter_factory(cls, allow_args: Collection[str] | None) -> _KwargsMap: """ Argument filter factory. Provides function that filters dictionary of underlying callable keyword args. @@ -110,19 +112,19 @@ def _arg_filter_factory(cls, allow_args: Collection[str] | None): """ if allow_args is None: - def _arg_filter(kwargs: dict[str, Any]): + def _arg_filter(kwargs: _Kwargs) -> _Kwargs: return kwargs else: args = set(allow_args) - def _arg_filter(kwargs: dict[str, Any]): + def _arg_filter(kwargs: _Kwargs) -> _Kwargs: return {name: value for name, value in kwargs.items() if name in args} return _arg_filter @classmethod - def _args_factory(cls, subject_name: str | None): + def _args_factory(cls, subject_name: str | None) -> _ArgsFormer: """ Argument former factory. Provides function that forms underlying callable *args and **kwargs @@ -134,17 +136,13 @@ def _args_factory(cls, subject_name: str | None): """ if subject_name: - def _args( - subject: Any, kwargs: dict[str, Any] - ) -> tuple[tuple[Any, ...], dict[str, Any]]: - kwargs[subject_name] = subject # type: ignore + def _args(subject: Any, kwargs: _Kwargs) -> tuple[tuple[Any, ...], _Kwargs]: + kwargs[subject_name] = subject return (), kwargs else: - def _args( - subject: Any, kwargs: dict[str, Any] - ) -> tuple[tuple[Any, ...], dict[str, Any]]: + def _args(subject: Any, kwargs: _Kwargs) -> tuple[tuple[Any, ...], _Kwargs]: return (subject,), kwargs return _args diff --git a/src/mediator/common/modifiers.py b/src/mediator/common/modifiers.py index f50bb9a..d44022c 100644 --- a/src/mediator/common/modifiers.py +++ b/src/mediator/common/modifiers.py @@ -1,13 +1,10 @@ from collections.abc import Sequence +from typing import Protocol -from mediator.common.types import ( # noqa F401 - ActionCallType, - ActionResult, - ActionSubject, -) +from mediator.common.types import ActionCallType -class ModifierFactory: +class ModifierFactory(Protocol): """ Modifier factory. @@ -15,13 +12,15 @@ class ModifierFactory: that wraps given callable into it with extra behaviour. """ - def create(self, call: ActionCallType, **kwargs) -> ActionCallType: + def create(self, call: ActionCallType, *, target: ActionCallType) -> ActionCallType: """ Produces action callable that wraps given one with extra behaviour. Example: >>> class SomeModifierFactory: - >>> def create(self, call: ActionCallType, **kwargs) -> ActionCallType: + >>> def create( + >>> self, call: ActionCallType, *, target: ActionCallType + >>> ) -> ActionCallType: >>> async def wrapper(action: ActionSubject) -> ActionResult: >>> # ... extra logic for arguments inspection or modification >>> result = await call(action) @@ -31,12 +30,12 @@ def create(self, call: ActionCallType, **kwargs) -> ActionCallType: >>> return wrapper :param call: callable to be wrapped - :param kwargs: extra context information; currently contains: - target - final callable in stack (if stack of modifiers is built) + :param target: final callable in stack (if stack of modifiers is built); + it is a `Handler` object when stack is built by handler registry :return: wrapped action callable that calls given one and acts with arguments or result """ - raise NotImplementedError + ... class ModifierStack: diff --git a/src/mediator/common/registry/base.py b/src/mediator/common/registry/base.py index 32784b2..ebac3e9 100644 --- a/src/mediator/common/registry/base.py +++ b/src/mediator/common/registry/base.py @@ -1,5 +1,6 @@ from collections.abc import Hashable, Iterable, Iterator, Sequence from dataclasses import dataclass +from typing import Protocol from mediator.common.handler.base import Handler from mediator.common.modifiers import ModifierFactory, ModifierStack @@ -86,30 +87,30 @@ class LookupHandlerStoreError(LookupError, HandlerStoreError): """ -class HandlerStore: +class HandlerStore(Protocol): """ Handler store abstraction. Handler stores are used for storing handler entries. """ - def add(self, entry: HandlerEntry): + def add(self, entry: HandlerEntry) -> None: """ Adds given handler entry into store. :param entry: handler entry to add into store """ - raise NotImplementedError + ... - def include(self, entries: Iterable[HandlerEntry]): + def include(self, entries: Iterable[HandlerEntry]) -> None: """ Adds all handler entries from given iterable into store. :param entries: handler entries iterator """ - raise NotImplementedError + ... def __iter__(self) -> Iterator[HandlerEntry]: """ Returns iterator providing all underlying store handler entries. :return: iterator providing all underlying store handler entries. """ - raise NotImplementedError + ... diff --git a/src/mediator/common/registry/registry.py b/src/mediator/common/registry/registry.py index a4f6f20..ba38726 100644 --- a/src/mediator/common/registry/registry.py +++ b/src/mediator/common/registry/registry.py @@ -1,6 +1,5 @@ -import functools -from collections.abc import Iterable, Iterator, Sequence -from typing import Any +from collections.abc import Callable, Iterable, Iterator, Sequence +from typing import Any, TypeVar, overload from mediator.common.factory.cascade import HandlerFactoryCascade from mediator.common.factory.policies import PolicyType @@ -8,6 +7,8 @@ from mediator.common.registry.base import HandlerEntry, HandlerStore from mediator.common.registry.stores import ModifierHandlerStore +_T = TypeVar("_T") + class HandlerRegistry(HandlerStore): """ @@ -23,7 +24,7 @@ def __init__( policies: Sequence[PolicyType] | None = None, cascade: HandlerFactoryCascade | None = None, modifiers: Sequence[ModifierFactory] = (), - ): + ) -> None: """ Initializes handler registry. :param store: underlying handler store used for handler entry storage @@ -46,13 +47,31 @@ def __init__( raise TypeError("policies or cascade argument should be provided") self._store = ModifierHandlerStore.wrap(nested=store, modifiers=modifiers) + @overload + def register( + self, + obj: None = None, + *, + policies: Sequence[PolicyType] | None = None, + modifiers: Sequence[ModifierFactory] = (), + ) -> Callable[[_T], _T]: ... + + @overload + def register( + self, + obj: _T, + *, + policies: Sequence[PolicyType] | None = None, + modifiers: Sequence[ModifierFactory] = (), + ) -> _T: ... + def register( self, obj: Any | None = None, *, policies: Sequence[PolicyType] | None = None, modifiers: Sequence[ModifierFactory] = (), - ): + ) -> Any: """ Registers given raw object as an action handler or provides decorator that registers given raw object as an action handler. @@ -65,19 +84,15 @@ def register( """ cascade = self._policies_cascade(policies) if obj is None: - register = functools.partial( - self._process_obj, cascade=cascade, modifiers=modifiers - ) - def wrap(fn: Any): - register(fn) + def wrap(fn: _T) -> _T: + self._process_obj(fn, cascade=cascade, modifiers=modifiers) return fn return wrap - else: - self._process_obj(obj, cascade=cascade, modifiers=modifiers) - return obj + self._process_obj(obj, cascade=cascade, modifiers=modifiers) + return obj def _policies_cascade( self, policies: Sequence[PolicyType] | None @@ -99,7 +114,7 @@ def _process_obj( *, cascade: HandlerFactoryCascade, modifiers: Sequence[ModifierFactory], - ): + ) -> None: """ Creates handler entry for given raw action handler object. :param obj: raw action handler object @@ -109,14 +124,14 @@ def _process_obj( handler = cascade(obj) self.add(HandlerEntry(handler=handler, modifiers=modifiers)) - def add(self, entry: HandlerEntry): + def add(self, entry: HandlerEntry) -> None: """ Adds given handler entry into store. :param entry: handler entry to add into store """ self._store.add(entry) - def include(self, entries: Iterable[HandlerEntry]): + def include(self, entries: Iterable[HandlerEntry]) -> None: """ Adds all handler entries from given iterable into store. :param entries: handler entries iterator diff --git a/src/mediator/common/registry/stores.py b/src/mediator/common/registry/stores.py index ff697e3..5e16066 100644 --- a/src/mediator/common/registry/stores.py +++ b/src/mediator/common/registry/stores.py @@ -17,20 +17,20 @@ class CollectionHandlerStore(HandlerStore): without any constraints. """ - def __init__(self): + def __init__(self) -> None: """ Initializes collection handler store """ self._entries: list[HandlerEntry] = [] - def add(self, entry: HandlerEntry): + def add(self, entry: HandlerEntry) -> None: """ Adds given handler entry into store. :param entry: handler entry to add into store """ self._entries.append(entry) - def include(self, entries: Iterable[HandlerEntry]): + def include(self, entries: Iterable[HandlerEntry]) -> None: """ Adds all handler entries from given iterable into store. :param entries: handler entries iterator @@ -53,13 +53,13 @@ class MappingHandlerStore(HandlerStore): and preserves uniqueness of stored entries by its keys. """ - def __init__(self): + def __init__(self) -> None: """ Initializes mapping handler store """ self._map: dict[Hashable, HandlerEntry] = {} - def add(self, entry: HandlerEntry): + def add(self, entry: HandlerEntry) -> None: """ Adds given handler entry into store. :param entry: handler entry to add into store @@ -73,7 +73,7 @@ def add(self, entry: HandlerEntry): ) self._map[entry.key] = entry - def include(self, entries: Iterable[HandlerEntry]): + def include(self, entries: Iterable[HandlerEntry]) -> None: """ Adds all handler entries from given iterable into store. :param entries: handler entries iterator @@ -110,7 +110,9 @@ class ModifierHandlerStore(HandlerStore): and adds modified entries into underlying handler store. """ - def __init__(self, nested: HandlerStore, modifiers: Sequence[ModifierFactory]): + def __init__( + self, nested: HandlerStore, modifiers: Sequence[ModifierFactory] + ) -> None: """ Initializes modifier handler store. :param nested: handler store used for modified entries storage @@ -119,14 +121,14 @@ def __init__(self, nested: HandlerStore, modifiers: Sequence[ModifierFactory]): self._nested = nested self._modifiers = tuple(modifiers) - def add(self, entry: HandlerEntry): + def add(self, entry: HandlerEntry) -> None: """ Adds given handler entry into store. :param entry: handler entry to add into store """ self._nested.add(entry.stack(self._modifiers)) - def include(self, entries: Iterable[HandlerEntry]): + def include(self, entries: Iterable[HandlerEntry]) -> None: """ Adds all handler entries from given iterable into store. :param entries: handler entries iterator diff --git a/src/mediator/event/aggregate.py b/src/mediator/event/aggregate.py index 9daa6cc..3b6715e 100644 --- a/src/mediator/event/aggregate.py +++ b/src/mediator/event/aggregate.py @@ -1,4 +1,4 @@ -from typing import Any +from typing import Any, Self from mediator.event.base import EventPublisher @@ -27,14 +27,14 @@ class EventAggregate: _publisher: EventPublisher | None _staged: list[tuple[Any, dict[str, Any]]] - def __init__(self): + def __init__(self) -> None: """ Initializes empty event aggregate. """ self._publisher = None self._staged = [] - def use(self, publisher: EventPublisher): + def use(self, publisher: EventPublisher) -> Self: """ Sets event publisher used for event sending. :param publisher: event publisher to use @@ -43,7 +43,7 @@ def use(self, publisher: EventPublisher): self._publisher = publisher return self - async def commit(self): + async def commit(self) -> None: """ Commits staged events by underlying publisher. """ @@ -57,13 +57,13 @@ async def commit(self): self._staged.clear() - def cleanup(self): + def cleanup(self) -> None: """ Clears all staged events. """ self._staged.clear() - def enqueue(self, obj: Any, **kwargs): + def enqueue(self, obj: Any, **kwargs: Any) -> None: """ Stages given event object with optional extra arguments. :param obj: event object diff --git a/src/mediator/event/base.py b/src/mediator/event/base.py index f0874ad..027dff9 100644 --- a/src/mediator/event/base.py +++ b/src/mediator/event/base.py @@ -1,70 +1,63 @@ from collections.abc import Iterable, Iterator -from contextlib import AbstractAsyncContextManager -from typing import Any +from contextlib import AbstractAsyncContextManager, nullcontext +from typing import Any, Protocol from mediator.common.registry import HandlerEntry, HandlerStore -from mediator.utils.context import AsyncNullContextManager -class EventPublish: +class EventPublish(Protocol): """ Event publishing interface. """ - async def publish(self, obj: Any, **kwargs): + async def publish(self, obj: Any, **kwargs: Any) -> None: """ Publishes given event object. :param obj: event object to be published :param kwargs: extra event arguments """ - raise NotImplementedError + ... -class EventPublisher(EventPublish): +class EventPublisher(EventPublish, Protocol): """ Event publisher interface, supporting transactions. """ - # noinspection PyMethodMayBeStatic def transaction(self) -> AbstractAsyncContextManager[EventPublish]: """ Provides transaction context manager returning event publish interface, to publish events inside of transaction. - :return: async context manager returning event publish interface - """ - return AsyncNullContextManager(self) - async def publish(self, obj: Any, **kwargs): - """ - Publishes given event object. - :param obj: event object to be published - :param kwargs: extra event arguments + Classes that explicitly inherit from this protocol get default behaviour: + no transaction, events are published directly by this publisher. + :return: async context manager returning event publish interface """ - raise NotImplementedError + return nullcontext(self) -class EventSubscriber(HandlerStore): +class EventSubscriber(HandlerStore, Protocol): """ Event subscriber """ - def add(self, entry: HandlerEntry): + def add(self, entry: HandlerEntry) -> None: """ Connects handler entry to process events. :param entry: handler entry to connect """ - raise NotImplementedError + ... - def include(self, entries: Iterable[HandlerEntry]): + def include(self, entries: Iterable[HandlerEntry]) -> None: """ Connects all handler entries from given iterable to process events. :param entries: handler entries iterator """ - raise NotImplementedError + ... def __iter__(self) -> Iterator[HandlerEntry]: """ Returns iterator providing all underlying handler entries. :return: iterator providing all underlying handler entries. """ - raise NotImplementedError + ... diff --git a/src/mediator/event/local.py b/src/mediator/event/local.py index bc4cfd9..8e344d9 100644 --- a/src/mediator/event/local.py +++ b/src/mediator/event/local.py @@ -15,7 +15,7 @@ HandlerRegistry, ) from mediator.common.types import ActionCallType, ActionSubject -from mediator.event.base import EventPublisher, EventSubscriber +from mediator.event.base import EventPublisher class _EventSchedulerHandlerStore(CollectionHandlerStore): @@ -27,7 +27,7 @@ class _EventSchedulerHandlerStore(CollectionHandlerStore): _groups: defaultdict[Hashable, list[ActionCallType]] - def __init__(self, sync_mode: bool = False): + def __init__(self, sync_mode: bool = False) -> None: """ Initializes event scheduler handler store. :param sync_mode: are events should be processed in background @@ -39,7 +39,7 @@ def __init__(self, sync_mode: bool = False): self._groups = defaultdict(list) self.sync_mode = sync_mode - def add(self, entry: HandlerEntry): + def add(self, entry: HandlerEntry) -> None: """ Adds given handler entry into store and connects handler entry to process events. @@ -48,7 +48,7 @@ def add(self, entry: HandlerEntry): super().add(entry) self._map_call(entry) - def include(self, entries: Iterable[HandlerEntry]): + def include(self, entries: Iterable[HandlerEntry]) -> None: """ Adds all handler entries from given iterable into store and connects all handler entries from given iterable to process events. @@ -58,14 +58,14 @@ def include(self, entries: Iterable[HandlerEntry]): for entry in entries: self._map_call(entry) - def _map_call(self, entry: HandlerEntry): + def _map_call(self, entry: HandlerEntry) -> None: """ Add given handler entry to event processing. :param entry: handler entry to add """ self._groups[entry.key].append(entry.handler_pipeline()) - async def schedule(self, action: ActionSubject): + async def schedule(self, action: ActionSubject) -> None: """ Schedule given action object to be processed as event by all collected handlers. @@ -78,7 +78,7 @@ async def schedule(self, action: ActionSubject): await asyncio.wait(tasks) -class LocalEventBus(EventPublisher, HandlerRegistry, EventSubscriber): +class LocalEventBus(HandlerRegistry, EventPublisher): """ Local event bus. @@ -92,7 +92,7 @@ def __init__( cascade: HandlerFactoryCascade | None = None, modifiers: Sequence[ModifierFactory] = (), sync_mode: bool = False, - ): + ) -> None: """ Initializes local event bus with given specification. :param policies: @@ -106,8 +106,7 @@ def __init__( :param modifiers: sequence of modifiers to be applied on new handler entries """ scheduler_store = _EventSchedulerHandlerStore(sync_mode=sync_mode) - HandlerRegistry.__init__( - self, + super().__init__( store=scheduler_store, policies=policies or [CallableHandlerPolicy()], cascade=cascade, @@ -115,7 +114,7 @@ def __init__( ) self._scheduler = scheduler_store - async def publish(self, obj: Any, **kwargs): + async def publish(self, obj: Any, **kwargs: Any) -> None: """ Publishes given event. :param obj: event object diff --git a/src/mediator/event/registry.py b/src/mediator/event/registry.py index 576015c..2b97685 100644 --- a/src/mediator/event/registry.py +++ b/src/mediator/event/registry.py @@ -21,7 +21,7 @@ def __init__( policies: Sequence[PolicyType] | None = None, cascade: HandlerFactoryCascade | None = None, modifiers: Sequence[ModifierFactory] = (), - ): + ) -> None: """ Initializes event handler registry. :param policies: @@ -34,8 +34,7 @@ def __init__( policy into handler factory mapping :param modifiers: sequence of modifiers to be applied on new handler entries """ - HandlerRegistry.__init__( - self, + super().__init__( store=CollectionHandlerStore(), policies=policies or [CallableHandlerPolicy()], cascade=cascade, diff --git a/src/mediator/py.typed b/src/mediator/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/src/mediator/request/base.py b/src/mediator/request/base.py index dad8a60..dc713a3 100644 --- a/src/mediator/request/base.py +++ b/src/mediator/request/base.py @@ -1,16 +1,16 @@ -from typing import Any +from typing import Any, Protocol -class RequestExecutor: +class RequestExecutor(Protocol): """ Request executor interface. """ - async def execute(self, obj: Any, **kwargs) -> Any: + async def execute(self, obj: Any, **kwargs: Any) -> Any: """ Executes given request and returns execution result. :param obj: request object :param kwargs: optional extra arguments :return: request execution result """ - raise NotImplementedError + ... diff --git a/src/mediator/request/local.py b/src/mediator/request/local.py index 8ec64e7..48d8553 100644 --- a/src/mediator/request/local.py +++ b/src/mediator/request/local.py @@ -25,14 +25,14 @@ class _RequestExecutorHandlerStore(MappingHandlerStore): _calls: dict[Hashable, ActionCallType] - def __init__(self): + def __init__(self) -> None: """ Initializes empty request executor handler store. """ super().__init__() self._calls = {} - def add(self, entry: HandlerEntry): + def add(self, entry: HandlerEntry) -> None: """ Adds given handler entry into store and connects handler entry to process requests. @@ -43,7 +43,7 @@ def add(self, entry: HandlerEntry): super().add(entry) self._map_call(entry) - def include(self, entries: Iterable[HandlerEntry]): + def include(self, entries: Iterable[HandlerEntry]) -> None: """ Adds all handler entries from given iterable into store and connects all handler entries from given iterable to process requests. @@ -55,7 +55,7 @@ def include(self, entries: Iterable[HandlerEntry]): for entry in entries: self._map_call(entry) - def _map_call(self, entry: HandlerEntry): + def _map_call(self, entry: HandlerEntry) -> None: """ Sets given handler entry to request processing. :param entry: handler entry to add @@ -91,7 +91,7 @@ def __init__( policies: Sequence[PolicyType] | None = None, cascade: HandlerFactoryCascade | None = None, modifiers: Sequence[ModifierFactory] = (), - ): + ) -> None: """ Initializes local request bus with given specification. :param policies: @@ -105,8 +105,7 @@ def __init__( :param modifiers: sequence of modifiers to be applied on new handler entries """ executor_store = _RequestExecutorHandlerStore() - HandlerRegistry.__init__( - self, + super().__init__( store=executor_store, policies=policies or [CallableHandlerPolicy()], cascade=cascade, @@ -114,7 +113,7 @@ def __init__( ) self._executor = executor_store - async def execute(self, obj: Any, **kwargs): + async def execute(self, obj: Any, **kwargs: Any) -> Any: """ Executes given request. :param obj: request object diff --git a/src/mediator/request/registry.py b/src/mediator/request/registry.py index 8019cee..8cb5052 100644 --- a/src/mediator/request/registry.py +++ b/src/mediator/request/registry.py @@ -21,7 +21,7 @@ def __init__( policies: Sequence[PolicyType] | None = None, cascade: HandlerFactoryCascade | None = None, modifiers: Sequence[ModifierFactory] = (), - ): + ) -> None: """ Initializes request handler registry. :param policies: @@ -34,8 +34,7 @@ def __init__( policy into handler factory mapping :param modifiers: sequence of modifiers to be applied on new handler entries """ - HandlerRegistry.__init__( - self, + super().__init__( store=MappingHandlerStore(), policies=policies or [CallableHandlerPolicy()], cascade=cascade, diff --git a/src/mediator/utils/context.py b/src/mediator/utils/context.py deleted file mode 100644 index 66d5d68..0000000 --- a/src/mediator/utils/context.py +++ /dev/null @@ -1,22 +0,0 @@ -from typing import Generic, TypeVar - -T = TypeVar("T") - - -class AsyncNullContextManager(Generic[T]): - """ - Asyncio null context manager - zero functionality context manager. - """ - - def __init__(self, return_value: T | None = None): - """ - Initializes asyncio null context manager. - :param return_value: optional value returned in `when` statement - """ - self.return_value = return_value - - async def __aenter__(self): - return self.return_value - - async def __aexit__(self, exc_type, exc_val, exc_tb): - pass diff --git a/tests/common/factory/test_policies.py b/tests/common/factory/test_policies.py index ea2df81..b46ac04 100644 --- a/tests/common/factory/test_policies.py +++ b/tests/common/factory/test_policies.py @@ -7,7 +7,7 @@ def test_base_handler_policy(): policy = MappablePolicy() - returned_policy = policy.replace_map(None) + returned_policy = policy.replace_map(MappablePolicy()) assert returned_policy is policy @@ -20,7 +20,7 @@ def test_callable_handler_policy(): second_policy = CallableHandlerPolicy() assert policy.replace_map(second_policy) is second_policy - assert policy.replace_map(None) is policy + assert policy.replace_map(MappablePolicy()) is policy def test_method_handler_policy(): @@ -40,4 +40,4 @@ def test_method_handler_policy(): second_policy = MethodHandlerPolicy(name="other") assert policy.replace_map(second_policy) is second_policy - assert policy.replace_map(None) is policy + assert policy.replace_map(MappablePolicy()) is policy diff --git a/tests/common/registry/conftest.py b/tests/common/registry/conftest.py index e983d6e..676a092 100644 --- a/tests/common/registry/conftest.py +++ b/tests/common/registry/conftest.py @@ -13,7 +13,7 @@ def __init__(self, type_: type): @property def key(self) -> Hashable: - return self.type_ # type: ignore + return self.type_ @property def obj(self) -> Any: diff --git a/tests/common/test_modifiers.py b/tests/common/test_modifiers.py index 3b697b9..d650c4d 100644 --- a/tests/common/test_modifiers.py +++ b/tests/common/test_modifiers.py @@ -10,7 +10,7 @@ class MockupModifierFactory(ModifierFactory): def __init__(self, seq_item: str): self.seq_item = seq_item - def create(self, call: ActionCallType, **kwargs) -> ActionCallType: + def create(self, call: ActionCallType, *, target: ActionCallType) -> ActionCallType: seq_item = self.seq_item async def _op(action: ActionSubject): diff --git a/tests/test_ports.py b/tests/test_ports.py new file mode 100644 index 0000000..be1af3a --- /dev/null +++ b/tests/test_ports.py @@ -0,0 +1,90 @@ +""" +Checks that library ports are structural: +objects satisfy them by shape, without inheriting from library classes. +""" + +from collections.abc import Hashable +from contextlib import AbstractAsyncContextManager, nullcontext +from typing import Any + +import pytest + +from mediator.common.handler import Handler +from mediator.common.modifiers import ModifierFactory, ModifierStack +from mediator.common.registry import HandlerStore +from mediator.common.types import ActionCallType, ActionResult, ActionSubject +from mediator.event import ( + EventAggregate, + EventPublish, + EventPublisher, + EventSubscriber, + LocalEventBus, +) +from mediator.request import LocalRequestBus, RequestExecutor + + +class _PlainHandler: + @property + def key(self) -> Hashable: + return str + + @property + def obj(self) -> Any: + return self + + async def __call__(self, action: ActionSubject) -> ActionResult: + return ActionResult(action.subject) + + +class _PlainPublisher: + def __init__(self) -> None: + self.published: list[Any] = [] + + def transaction(self) -> AbstractAsyncContextManager[EventPublish]: + return nullcontext(self) + + async def publish(self, obj: Any, **kwargs: Any) -> None: + self.published.append(obj) + + +class _TargetModifier: + def __init__(self) -> None: + self.targets: list[ActionCallType] = [] + + def create(self, call: ActionCallType, *, target: ActionCallType) -> ActionCallType: + self.targets.append(target) + return call + + +def test_local_buses_satisfy_ports() -> None: + event_bus = LocalEventBus() + publisher: EventPublisher = event_bus + subscriber: EventSubscriber = event_bus + store: HandlerStore = event_bus + executor: RequestExecutor = LocalRequestBus() + assert all(port is not None for port in (publisher, subscriber, store, executor)) + + +def test_handler_is_runtime_checkable() -> None: + assert isinstance(_PlainHandler(), Handler) + assert not isinstance(object(), Handler) + + +@pytest.mark.asyncio +async def test_plain_publisher_with_aggregate() -> None: + publisher = _PlainPublisher() + aggregate = EventAggregate().use(publisher) + aggregate.enqueue("event") + await aggregate.commit() + assert publisher.published == ["event"] + + +@pytest.mark.asyncio +async def test_plain_modifier_receives_target() -> None: + handler = _PlainHandler() + modifier = _TargetModifier() + factories: list[ModifierFactory] = [modifier, modifier] + call = ModifierStack.build(factories, handler) + result = await call(ActionSubject(subject="test", inject={})) + assert result.result == "test" + assert modifier.targets == [handler, handler] From 40ee3eb1d1f64e2172814198848109c6bdb742e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20=C5=81ukawski?= Date: Sun, 15 Nov 2026 14:15:09 +0000 Subject: [PATCH 06/11] Make action, handler entry, policy and inspection records immutable. Callable handlers no longer write the subject into the shared extra arguments, which leaked it into other handlers of the same event. --- src/mediator/common/factory/policies.py | 4 +- src/mediator/common/handler/base.py | 4 + src/mediator/common/handler/handlers.py | 102 ++++++------------------ src/mediator/common/registry/base.py | 2 +- src/mediator/common/types.py | 9 ++- src/mediator/utils/inspection.py | 8 +- tests/common/factory/test_utils.py | 3 +- tests/common/handler/test_handlers.py | 18 +++++ 8 files changed, 62 insertions(+), 88 deletions(-) diff --git a/src/mediator/common/factory/policies.py b/src/mediator/common/factory/policies.py index 0a2fc7f..b501fc7 100644 --- a/src/mediator/common/factory/policies.py +++ b/src/mediator/common/factory/policies.py @@ -15,7 +15,7 @@ def replace_map(self, policy: "MappablePolicy") -> "MappablePolicy": return self -@dataclass +@dataclass(frozen=True) class CallableHandlerPolicy(MappablePolicy): """ Callable handler policy. @@ -52,7 +52,7 @@ def replace_map(self, policy: "MappablePolicy") -> "CallableHandlerPolicy": return self -@dataclass +@dataclass(frozen=True) class MethodHandlerPolicy(MappablePolicy): """ Method handler policy. diff --git a/src/mediator/common/handler/base.py b/src/mediator/common/handler/base.py index d26b6e8..733dea1 100644 --- a/src/mediator/common/handler/base.py +++ b/src/mediator/common/handler/base.py @@ -9,6 +9,8 @@ class HandlerInfo(Protocol): An abstraction that defines handler specification interface. """ + __slots__ = () + @property def key(self) -> Hashable: """ @@ -33,6 +35,8 @@ class Handler(HandlerInfo, Protocol): Is an adapter to the underlying object complexity. """ + __slots__ = () + async def __call__(self, action: ActionSubject) -> ActionResult: """ Performs handler action with given argument values. diff --git a/src/mediator/common/handler/handlers.py b/src/mediator/common/handler/handlers.py index 24ff72e..426d02c 100644 --- a/src/mediator/common/handler/handlers.py +++ b/src/mediator/common/handler/handlers.py @@ -4,10 +4,6 @@ from mediator.common.handler.base import Handler from mediator.common.types import ActionResult, ActionSubject -_Kwargs = dict[str, Any] -_KwargsMap = Callable[[_Kwargs], _Kwargs] -_ArgsFormer = Callable[[Any, _Kwargs], tuple[tuple[Any, ...], _Kwargs]] - class CallableHandler(Handler): """ @@ -16,7 +12,7 @@ class CallableHandler(Handler): with prepared arguments sourced from action object. """ - __slots__ = ("_arg_filter", "_arg_map", "_args", "_fn", "_key", "_obj") + __slots__ = ("_allow_args", "_arg_map", "_fn", "_key", "_obj", "_subject_name") def __init__( self, @@ -45,9 +41,9 @@ def __init__( self._obj = obj self._fn = fn self._key = key - self._arg_map = self._arg_map_factory(arg_map) - self._arg_filter = self._arg_filter_factory(allow_args) - self._args = self._args_factory(subject_name) + self._subject_name = subject_name or None + self._arg_map = dict(arg_map) + self._allow_args = None if allow_args is None else frozenset(allow_args) @property def key(self) -> Hashable: @@ -71,78 +67,30 @@ async def __call__(self, action: ActionSubject) -> ActionResult: :param action: action containing call values :return: callable returned value wrapped into `ActionResult` object """ - kwargs = self._arg_map(action.inject) - kwargs = self._arg_filter(kwargs) - args, kwargs = self._args(action.subject, kwargs) - result = await self._fn(*args, **kwargs) + kwargs = self._kwargs(action.inject) + if self._subject_name is None: + result = await self._fn(action.subject, **kwargs) + else: + kwargs[self._subject_name] = action.subject + result = await self._fn(**kwargs) return ActionResult(result) - @classmethod - def _arg_map_factory(cls, arg_map: Mapping[str, str]) -> _KwargsMap: + def _kwargs(self, inject: Mapping[str, Any]) -> dict[str, Any]: """ - Argument mapping factory. - Provides function that maps dictionary of keyword args - to another one that fits into callable spec. - :param arg_map: action arg name into callable arg name mapping - :return: function that performs keyword args dict mapping + Forms underlying callable keyword arguments from action extra arguments: + translates names using argument map and drops not allowed ones. + :param inject: action extra arguments + :return: new dictionary of callable keyword arguments; + action extra arguments are never modified """ + arg_map = self._arg_map if arg_map: - - def _arg_map(kwargs: _Kwargs) -> _Kwargs: - return { - arg_map.get(name, name): value for name, value in kwargs.items() - } - - else: - - def _arg_map(kwargs: _Kwargs) -> _Kwargs: - return kwargs - - return _arg_map - - @classmethod - def _arg_filter_factory(cls, allow_args: Collection[str] | None) -> _KwargsMap: - """ - Argument filter factory. - Provides function that filters dictionary of underlying callable keyword args. - :param allow_args: collection of action only necessary argument names, - used to make filter removing excessive arguments - that may not fit into callable signature - :return: function that filters dictionary of underlying callable keyword args - """ - if allow_args is None: - - def _arg_filter(kwargs: _Kwargs) -> _Kwargs: - return kwargs - - else: - args = set(allow_args) - - def _arg_filter(kwargs: _Kwargs) -> _Kwargs: - return {name: value for name, value in kwargs.items() if name in args} - - return _arg_filter - - @classmethod - def _args_factory(cls, subject_name: str | None) -> _ArgsFormer: - """ - Argument former factory. - Provides function that forms underlying callable *args and **kwargs - regarding to subject (main argument name) name . - :param subject_name: main argument name; - when is not None, action main argument (subject) is provided as keyword arg, - else action main argument (subject) is placed as positional one - :return: function that forms underlying callable *args and **kwargs - """ - if subject_name: - - def _args(subject: Any, kwargs: _Kwargs) -> tuple[tuple[Any, ...], _Kwargs]: - kwargs[subject_name] = subject - return (), kwargs - + kwargs = {arg_map.get(name, name): value for name, value in inject.items()} else: - - def _args(subject: Any, kwargs: _Kwargs) -> tuple[tuple[Any, ...], _Kwargs]: - return (subject,), kwargs - - return _args + kwargs = dict(inject) + allow_args = self._allow_args + if allow_args is not None: + kwargs = { + name: value for name, value in kwargs.items() if name in allow_args + } + return kwargs diff --git a/src/mediator/common/registry/base.py b/src/mediator/common/registry/base.py index ebac3e9..f3ea1fd 100644 --- a/src/mediator/common/registry/base.py +++ b/src/mediator/common/registry/base.py @@ -7,7 +7,7 @@ from mediator.common.types import ActionCallType -@dataclass +@dataclass(frozen=True, slots=True) class HandlerEntry: """ Handler entry - combines handler with call modifiers. diff --git a/src/mediator/common/types.py b/src/mediator/common/types.py index ad5405b..6ceedfa 100644 --- a/src/mediator/common/types.py +++ b/src/mediator/common/types.py @@ -3,11 +3,14 @@ from typing import Any -@dataclass +@dataclass(frozen=True, slots=True) class ActionSubject: """ Unified action subject. Holds primary and extra injection arguments for action handler. + + Object is immutable; to pass changed subject or arguments down the call stack + create new one, i.e. using `dataclasses.replace`. """ subject: Any @@ -19,10 +22,10 @@ def key(self) -> Hashable: Action subject key. Used to find corresponding action handler. :return: action subject key """ - return type(self.subject) # type: ignore + return type(self.subject) # type: ignore[return-value] -@dataclass +@dataclass(frozen=True, slots=True) class ActionResult: """ Library unified action result object. diff --git a/src/mediator/utils/inspection.py b/src/mediator/utils/inspection.py index 344a974..a73c01d 100644 --- a/src/mediator/utils/inspection.py +++ b/src/mediator/utils/inspection.py @@ -4,7 +4,7 @@ from typing import Any, get_type_hints -@dataclass +@dataclass(frozen=True) class CallableArg: """ Stores information about given callable argument. @@ -18,7 +18,7 @@ class CallableArg: is_positional: bool -@dataclass +@dataclass(frozen=True) class CallableType: """ Stores information about callable type. @@ -32,7 +32,7 @@ class CallableType: is_async: bool -@dataclass +@dataclass(frozen=True) class CallableIODetails: """ Stores all information about input arguments and output data type. @@ -58,7 +58,7 @@ def arg_by_name(self, name: str) -> CallableArg | None: return None -@dataclass +@dataclass(frozen=True) class CallableDetails(CallableType, CallableIODetails): """ Stores all inspection data about callable. diff --git a/tests/common/factory/test_utils.py b/tests/common/factory/test_utils.py index 26a008b..07d2f7c 100644 --- a/tests/common/factory/test_utils.py +++ b/tests/common/factory/test_utils.py @@ -1,4 +1,5 @@ from collections.abc import Sequence +from dataclasses import replace import pytest @@ -174,7 +175,7 @@ async def test_direct_handler_create_successful( details = get_details(sig) arg = arg_get(details) - details.obj = obj + details = replace(details, obj=obj) handler = handler_create(details, arg, obj) result = await handler(ActionSubject(subject="test", inject={"x": 1, "y": 2})) diff --git a/tests/common/handler/test_handlers.py b/tests/common/handler/test_handlers.py index 84d3ab0..864b907 100644 --- a/tests/common/handler/test_handlers.py +++ b/tests/common/handler/test_handlers.py @@ -66,3 +66,21 @@ async def test_callable_handler_error(action: ActionSubject): ) with pytest.raises(_SpecificError): await handler(action) + + +@pytest.mark.parametrize("subject_name", [None, "subject"]) +@pytest.mark.asyncio +async def test_callable_handler_keeps_action_untouched( + action: ActionSubject, subject_name +): + handler = CallableHandler( + obj=_fn, + fn=_fn, + key=str, + subject_name=subject_name, + arg_map={}, + allow_args=None, + ) + await handler(action) + assert action.inject == {"a": 10, "b": 20} + assert not hasattr(handler, "__dict__") From aee30651e8ccc9df950245b1d9d69aa50d0f2d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20=C5=81ukawski?= Date: Sun, 15 Nov 2026 14:16:54 +0000 Subject: [PATCH 07/11] Replace the event bus sync_mode flag with pluggable event dispatchers. Background tasks are now referenced and their errors reported, awaited publishing raises handler errors as an ExceptionGroup, and including handlers from a one-shot iterator works. --- src/mediator/event/__init__.py | 10 +++ src/mediator/event/dispatch.py | 131 +++++++++++++++++++++++++++++++++ src/mediator/event/local.py | 72 +++++++++--------- src/mediator/request/local.py | 23 ++---- tests/event/test_local.py | 125 +++++++++++++++++++++++++++++-- tests/request/test_request.py | 29 ++++++++ 6 files changed, 330 insertions(+), 60 deletions(-) create mode 100644 src/mediator/event/dispatch.py diff --git a/src/mediator/event/__init__.py b/src/mediator/event/__init__.py index 045c498..a04cc67 100644 --- a/src/mediator/event/__init__.py +++ b/src/mediator/event/__init__.py @@ -4,13 +4,23 @@ EventAggregateError, ) from mediator.event.base import EventPublish, EventPublisher, EventSubscriber +from mediator.event.dispatch import ( + AwaitingEventDispatcher, + BackgroundEventDispatcher, + EventDispatcher, + EventErrorHandler, +) from mediator.event.local import LocalEventBus from mediator.event.registry import EventHandlerRegistry __all__ = [ + "AwaitingEventDispatcher", + "BackgroundEventDispatcher", "ConfigEventAggregateError", "EventAggregate", "EventAggregateError", + "EventDispatcher", + "EventErrorHandler", "EventHandlerRegistry", "EventPublish", "EventPublisher", diff --git a/src/mediator/event/dispatch.py b/src/mediator/event/dispatch.py new file mode 100644 index 0000000..02b37a9 --- /dev/null +++ b/src/mediator/event/dispatch.py @@ -0,0 +1,131 @@ +import asyncio +import logging +from collections.abc import Callable, Sequence +from typing import Protocol + +from mediator.common.types import ActionCallType, ActionSubject + +logger = logging.getLogger(__name__) + +EventErrorHandler = Callable[[ActionSubject, Exception], object] + + +class EventDispatcher(Protocol): + """ + Event dispatcher. + + Strategy that decides how event handlers are run when event is published. + """ + + async def dispatch( + self, calls: Sequence[ActionCallType], action: ActionSubject + ) -> None: + """ + Runs all given event handler calls with given event action. + :param calls: event handler calls to run (may be empty) + :param action: event action to be processed + """ + ... + + async def drain(self) -> None: + """ + Waits until all event handler calls started by this dispatcher are finished. + """ + ... + + +class AwaitingEventDispatcher: + """ + Awaiting event dispatcher. + + Runs event handlers concurrently and waits until all of them are finished, + so event is fully processed when publishing returns. + Failure of one handler does not stop the other ones. + """ + + async def dispatch( + self, calls: Sequence[ActionCallType], action: ActionSubject + ) -> None: + """ + Runs all given event handler calls and waits for them. + :param calls: event handler calls to run (may be empty) + :param action: event action to be processed + :raises ExceptionGroup: with errors of all failed event handlers + """ + results = await asyncio.gather( + *(call(action) for call in calls), return_exceptions=True + ) + errors = [result for result in results if isinstance(result, Exception)] + if errors: + raise ExceptionGroup( + f"Event {type(action.subject).__qualname__} handlers failed", errors + ) + + async def drain(self) -> None: + """ + Returns immediately: every dispatch waits for its event handlers. + """ + + +class BackgroundEventDispatcher: + """ + Background event dispatcher. + + Runs every event handler as separate background asyncio task, + so publishing returns before event is processed. + Event handler failures are passed to error handler. + """ + + def __init__(self, on_error: EventErrorHandler | None = None) -> None: + """ + Initializes background event dispatcher. + :param on_error: (optional) callable invoked + with event action and error raised by its handler; + by default errors are logged using `mediator.event.dispatch` logger + """ + self._on_error = on_error if on_error is not None else _log_error + self._tasks: set[asyncio.Task[None]] = set() + + async def dispatch( + self, calls: Sequence[ActionCallType], action: ActionSubject + ) -> None: + """ + Schedules all given event handler calls as background tasks. + :param calls: event handler calls to run (may be empty) + :param action: event action to be processed + """ + for call in calls: + task = asyncio.create_task(self._run(call, action)) + # event loop keeps only weak references to tasks + self._tasks.add(task) + task.add_done_callback(self._tasks.discard) + + async def drain(self) -> None: + """ + Waits until all scheduled event handler calls are finished, + including ones scheduled in meantime (i.e. by running event handlers). + """ + while self._tasks: + await asyncio.wait(tuple(self._tasks)) + + async def _run(self, call: ActionCallType, action: ActionSubject) -> None: + """ + Runs single event handler call and reports its failure. + :param call: event handler call to run + :param action: event action to be processed + """ + try: + await call(action) + except Exception as error: + self._on_error(action, error) + + +def _log_error(action: ActionSubject, error: Exception) -> None: + """ + Default background event handler error handler - logs given error. + :param action: event action that was processed + :param error: error raised by event handler + """ + logger.error( + "Event %s handler failed", type(action.subject).__qualname__, exc_info=error + ) diff --git a/src/mediator/event/local.py b/src/mediator/event/local.py index 8e344d9..08dc78f 100644 --- a/src/mediator/event/local.py +++ b/src/mediator/event/local.py @@ -1,4 +1,3 @@ -import asyncio from collections import defaultdict from collections.abc import Hashable, Iterable, Sequence from typing import Any @@ -16,28 +15,22 @@ ) from mediator.common.types import ActionCallType, ActionSubject from mediator.event.base import EventPublisher +from mediator.event.dispatch import BackgroundEventDispatcher, EventDispatcher -class _EventSchedulerHandlerStore(CollectionHandlerStore): +class _EventCallHandlerStore(CollectionHandlerStore): """ Utility event handler store, based on collection handler store to work with local event execution. - Schedules event processing as background asyncio tasks. + Keeps event handler calls grouped by event key. """ - _groups: defaultdict[Hashable, list[ActionCallType]] - - def __init__(self, sync_mode: bool = False) -> None: + def __init__(self) -> None: """ - Initializes event scheduler handler store. - :param sync_mode: are events should be processed in background - when True every schedule call waits on event processing to finish - when False (default) event processing is executed in background; - useful in test cases + Initializes empty event call handler store. """ super().__init__() - self._groups = defaultdict(list) - self.sync_mode = sync_mode + self._groups: defaultdict[Hashable, list[ActionCallType]] = defaultdict(list) def add(self, entry: HandlerEntry) -> None: """ @@ -46,7 +39,7 @@ def add(self, entry: HandlerEntry) -> None: :param entry: handler entry to connect """ super().add(entry) - self._map_call(entry) + self._groups[entry.key].append(entry.handler_pipeline()) def include(self, entries: Iterable[HandlerEntry]) -> None: """ @@ -54,35 +47,24 @@ def include(self, entries: Iterable[HandlerEntry]) -> None: and connects all handler entries from given iterable to process events. :param entries: handler entries iterator """ - super().include(entries) for entry in entries: - self._map_call(entry) + self.add(entry) - def _map_call(self, entry: HandlerEntry) -> None: + def calls(self, key: Hashable) -> Sequence[ActionCallType]: """ - Add given handler entry to event processing. - :param entry: handler entry to add + Provides all event handler calls connected to given event key. + :param key: event key + :return: sequence of event handler calls (empty when nothing is connected) """ - self._groups[entry.key].append(entry.handler_pipeline()) - - async def schedule(self, action: ActionSubject) -> None: - """ - Schedule given action object to be processed as event - by all collected handlers. - :param action: event action to be processed - """ - key = action.key - group: Sequence[ActionCallType] = self._groups.get(key, ()) - tasks = [asyncio.ensure_future(call(action)) for call in group] - if self.sync_mode: - await asyncio.wait(tasks) + return self._groups.get(key, ()) class LocalEventBus(HandlerRegistry, EventPublisher): """ Local event bus. - Performs event execution scheduling locally in-place as asyncio backgrount tasks. + Runs event handlers locally in-place using event dispatcher + (by default as asyncio background tasks). Connects behaviours of handler registry and event publisher interface. """ @@ -91,7 +73,7 @@ def __init__( policies: Sequence[PolicyType] | None = None, cascade: HandlerFactoryCascade | None = None, modifiers: Sequence[ModifierFactory] = (), - sync_mode: bool = False, + dispatcher: EventDispatcher | None = None, ) -> None: """ Initializes local event bus with given specification. @@ -104,15 +86,21 @@ def __init__( (optional) custom handler factory cascade to customize policy into handler factory mapping :param modifiers: sequence of modifiers to be applied on new handler entries + :param dispatcher: + (optional) strategy that runs event handlers; + by default `BackgroundEventDispatcher` is used + (publishing does not wait for event handlers); + use `AwaitingEventDispatcher` to wait for event handlers when publishing """ - scheduler_store = _EventSchedulerHandlerStore(sync_mode=sync_mode) + store = _EventCallHandlerStore() super().__init__( - store=scheduler_store, + store=store, policies=policies or [CallableHandlerPolicy()], cascade=cascade, modifiers=modifiers, ) - self._scheduler = scheduler_store + self._calls = store + self._dispatcher = dispatcher or BackgroundEventDispatcher() async def publish(self, obj: Any, **kwargs: Any) -> None: """ @@ -120,4 +108,12 @@ async def publish(self, obj: Any, **kwargs: Any) -> None: :param obj: event object :param kwargs: event extra arguments """ - await self._scheduler.schedule(ActionSubject(subject=obj, inject=kwargs)) + action = ActionSubject(subject=obj, inject=kwargs) + await self._dispatcher.dispatch(self._calls.calls(action.key), action) + + async def drain(self) -> None: + """ + Waits until all event handlers started by this bus are finished. + Useful for graceful shutdown when events are processed in background. + """ + await self._dispatcher.drain() diff --git a/src/mediator/request/local.py b/src/mediator/request/local.py index 48d8553..d42098e 100644 --- a/src/mediator/request/local.py +++ b/src/mediator/request/local.py @@ -1,4 +1,4 @@ -from collections.abc import Hashable, Iterable, Sequence +from collections.abc import Hashable, Sequence from typing import Any from mediator.common.factory import ( @@ -43,18 +43,6 @@ def add(self, entry: HandlerEntry) -> None: super().add(entry) self._map_call(entry) - def include(self, entries: Iterable[HandlerEntry]) -> None: - """ - Adds all handler entries from given iterable into store - and connects all handler entries from given iterable to process requests. - :param entries: handler entries iterator - :raises CollisionHandlerStoreError: - when handler entry with given key already exists in this store - """ - super().include(entries) - for entry in entries: - self._map_call(entry) - def _map_call(self, entry: HandlerEntry) -> None: """ Sets given handler entry to request processing. @@ -120,10 +108,13 @@ async def execute(self, obj: Any, **kwargs: Any) -> Any: :param kwargs: request extra arguments :raises LookupHandlerStoreError: when there is no matching handler to process given request + :raises TypeError: when modifier or handler returns unexpected type object :return: request processing result """ result = await self._executor(ActionSubject(subject=obj, inject=kwargs)) - assert isinstance(result, ActionResult), ( - "modifier or handler should provide `ActionResult` type object" - ) + if not isinstance(result, ActionResult): + raise TypeError( + "modifier or handler should provide `ActionResult` type object," + f" got {type(result).__qualname__}" + ) return result.result diff --git a/tests/event/test_local.py b/tests/event/test_local.py index fce29be..cd36239 100644 --- a/tests/event/test_local.py +++ b/tests/event/test_local.py @@ -1,10 +1,16 @@ import asyncio +import logging from collections.abc import Mapping import pytest from mediator.common.factory import CallableHandlerPolicy -from mediator.event import EventHandlerRegistry, LocalEventBus +from mediator.event import ( + AwaitingEventDispatcher, + BackgroundEventDispatcher, + EventHandlerRegistry, + LocalEventBus, +) class _MockupEvent1: @@ -47,17 +53,124 @@ async def test_local_event_bus(): await asyncio.wait_for(event.wait(), timeout=0.5) +class _HandlerError(Exception): + pass + + @pytest.mark.asyncio -async def test_local_event_bus_sync(): +async def test_local_event_bus_awaiting(): cnt = {"test": 0} async def _handler(event: str): await asyncio.sleep(0.0) cnt[event] += 1 - policies = [CallableHandlerPolicy()] - bus = LocalEventBus(policies=policies, sync_mode=True) - bus.register(_handler, policies=policies) - bus.register(_handler, policies=policies) + bus = LocalEventBus(dispatcher=AwaitingEventDispatcher()) + bus.register(_handler) + bus.register(_handler) await bus.publish("test") assert cnt["test"] == 2 + + # nothing to wait for + await bus.publish(object()) + await bus.drain() + + +@pytest.mark.asyncio +async def test_local_event_bus_awaiting_error(): + finished = [] + + async def _failing(event: str): + raise _HandlerError(event) + + async def _working(event: str): + await asyncio.sleep(0.0) + finished.append(event) + + bus = LocalEventBus(dispatcher=AwaitingEventDispatcher()) + bus.register(_failing) + bus.register(_working) + bus.register(_failing) + + with pytest.raises(ExceptionGroup) as e: + await bus.publish("test") + assert [type(error) for error in e.value.exceptions] == [_HandlerError] * 2 + assert finished == ["test"] + + +@pytest.mark.asyncio +async def test_local_event_bus_background_drain(): + finished: list[object] = [] + bus = LocalEventBus() + + @bus.register + async def _first(event: str): + await asyncio.sleep(0.0) + await bus.publish(len(event)) + finished.append(event) + + @bus.register + async def _second(event: int): + await asyncio.sleep(0.0) + finished.append(event) + + await bus.publish("test") + assert finished == [] + + await bus.drain() + assert finished == ["test", 4] + await bus.drain() + + +@pytest.mark.asyncio +async def test_local_event_bus_background_error(): + errors = [] + bus = LocalEventBus( + dispatcher=BackgroundEventDispatcher( + on_error=lambda action, error: errors.append((action.subject, error)) + ) + ) + + @bus.register + async def _failing(event: str): + raise _HandlerError(event) + + await bus.publish("test") + await bus.drain() + [(subject, error)] = errors + assert subject == "test" + assert isinstance(error, _HandlerError) + + +@pytest.mark.asyncio +async def test_local_event_bus_background_error_log(caplog: pytest.LogCaptureFixture): + bus = LocalEventBus() + + @bus.register + async def _failing(event: str): + raise _HandlerError(event) + + with caplog.at_level(logging.ERROR, logger="mediator.event.dispatch"): + await bus.publish("test") + await bus.drain() + [record] = caplog.records + assert "Event str handler failed" in record.getMessage() + assert record.exc_info is not None + assert isinstance(record.exc_info[1], _HandlerError) + + +@pytest.mark.asyncio +async def test_local_event_bus_include_iterator(): + handled = [] + registry = EventHandlerRegistry() + + @registry.register + async def _handler(event: str): + handled.append(event) + + bus = LocalEventBus(dispatcher=AwaitingEventDispatcher()) + bus.include(iter(registry)) + assert len(list(bus)) == 1 + + await bus.publish("test") + assert handled == ["test"] diff --git a/tests/request/test_request.py b/tests/request/test_request.py index 69d9e3e..05c24e7 100644 --- a/tests/request/test_request.py +++ b/tests/request/test_request.py @@ -1,7 +1,10 @@ +from typing import Any + import pytest from mediator.common.factory import CallableHandlerPolicy from mediator.common.registry import LookupHandlerStoreError +from mediator.common.types import ActionCallType, ActionSubject from mediator.request import LocalRequestBus, RequestHandlerRegistry from tests.common.test_modifiers import MockupModifierFactory @@ -47,3 +50,29 @@ async def test_local_request_executor(): with pytest.raises(LookupHandlerStoreError): await executor.execute(object()) + + +@pytest.mark.asyncio +async def test_local_request_executor_include_iterator(): + registry = RequestHandlerRegistry() + registry.register(_handle_a) + + executor = LocalRequestBus() + executor.include(iter(registry)) + assert await executor.execute(_RequestA(), seq=["x"]) == ["x"] + + +class _BrokenModifierFactory: + def create(self, call: ActionCallType, *, target: ActionCallType) -> ActionCallType: + async def _op(action: ActionSubject) -> Any: + return (await call(action)).result + + return _op + + +@pytest.mark.asyncio +async def test_local_request_executor_result_type(): + executor = LocalRequestBus(modifiers=[_BrokenModifierFactory()]) + executor.register(_handle_a) + with pytest.raises(TypeError, match="ActionResult"): + await executor.execute(_RequestA(), seq=[]) From ace89d02eb4cf42e3a44eb30b409bcbad6fb1257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20=C5=81ukawski?= Date: Sun, 15 Nov 2026 14:18:20 +0000 Subject: [PATCH 08/11] Replace the single-method helper classes of the handler factories with plain functions. --- src/mediator/common/factory/factories.py | 37 +-- src/mediator/common/factory/utils.py | 309 ++++++++--------------- tests/common/factory/test_utils.py | 61 ++--- 3 files changed, 144 insertions(+), 263 deletions(-) diff --git a/src/mediator/common/factory/factories.py b/src/mediator/common/factory/factories.py index 88a0f26..52ff546 100644 --- a/src/mediator/common/factory/factories.py +++ b/src/mediator/common/factory/factories.py @@ -3,10 +3,9 @@ from mediator.common.factory.base import HandlerFactory from mediator.common.factory.policies import CallableHandlerPolicy, MethodHandlerPolicy from mediator.common.factory.utils import ( - CallableAttributeDetails, - CallableHandlerCreate, - CallableObjDetails, - HandlerSubjectArgGet, + create_callable_handler, + inspect_attribute, + inspect_callable, ) from mediator.common.handler import Handler @@ -24,13 +23,7 @@ def __init__(self, policy: CallableHandlerPolicy) -> None: :param policy: policy used as a configuration or specification for producing handler object """ - self._obj_details = CallableObjDetails() - self._arg_get = HandlerSubjectArgGet(name=policy.subject_arg) - self._handler_create = CallableHandlerCreate( - subject_as_keyword=policy.subject_as_keyword, - arg_map=policy.arg_map, - arg_strict=policy.arg_strict, - ) + self._policy = policy def create(self, obj: Any) -> Handler: """ @@ -41,9 +34,8 @@ def create(self, obj: Any) -> Handler: :raises HandlerFactoryError: when there is failure during object inspection :return: handler invoking given callable object """ - details = self._obj_details(obj) - arg = self._arg_get(details) - return self._handler_create(details=details, arg=arg, obj=obj) + details = inspect_callable(obj) + return create_callable_handler(details, obj=obj, policy=self._policy) class MethodHandlerFactory(HandlerFactory): @@ -60,16 +52,7 @@ def __init__(self, policy: MethodHandlerPolicy) -> None: :param policy: policy used as a configuration or specification for producing handler object """ - self._attribute_details = CallableAttributeDetails( - name=policy.name, owner_subtype_of=policy.subtype_of - ) - callable_policy = policy.policy - self._arg_get = HandlerSubjectArgGet(name=callable_policy.subject_arg) - self._handler_create = CallableHandlerCreate( - subject_as_keyword=callable_policy.subject_as_keyword, - arg_map=callable_policy.arg_map, - arg_strict=callable_policy.arg_strict, - ) + self._policy = policy def create(self, obj: Any) -> Handler: """ @@ -80,6 +63,6 @@ def create(self, obj: Any) -> Handler: :raises HandlerFactoryError: when there is failure during object inspection :return: handler invoking given object callable attribute """ - details = self._attribute_details(obj) - arg = self._arg_get(details) - return self._handler_create(details=details, arg=arg, obj=obj) + policy = self._policy + details = inspect_attribute(obj, policy.name, policy.subtype_of) + return create_callable_handler(details, obj=obj, policy=policy.policy) diff --git a/src/mediator/common/factory/utils.py b/src/mediator/common/factory/utils.py index 1c85c62..abc4569 100644 --- a/src/mediator/common/factory/utils.py +++ b/src/mediator/common/factory/utils.py @@ -5,227 +5,142 @@ HandlerFactoryError, IncompatibleHandlerFactoryError, ) +from mediator.common.factory.policies import CallableHandlerPolicy from mediator.common.handler import CallableHandler, Handler from mediator.utils.inspection import CallableArg, CallableDetails, CallableInspector -class CallableObjDetails: +def inspect_callable(obj: Any) -> CallableDetails: """ - Utility that wraps callable object inspection procedure into handler factory world. + Provides callable object inspection result + or raises an error when obj is not callable. + :param obj: callable object to inspect + :raises IncompatibleHandlerFactoryError: when obj is not valid callable + :return: `CallableDetails` object """ + try: + return CallableInspector.inspect(obj) + except TypeError as e: + raise IncompatibleHandlerFactoryError(f"{obj!r}: {e}") from e - def __call__(self, obj: Any) -> CallableDetails: - """ - Provides callable object inspection result - or raises an error when obj is not callable. - :param obj: callable object to inspect - :raises IncompatibleHandlerFactoryError: when obj is not valid callable - :return: `CallableDetails` object - """ - try: - return CallableInspector.inspect(obj) - except TypeError as e: - raise IncompatibleHandlerFactoryError(f"{obj!r}: {e}") from e - - -class CallableAttributeDetails: + +def inspect_attribute( + obj: Any, name: str, subtype_of: Sequence[type] = () +) -> CallableDetails: """ - Utility that (optionally) checks if object has valid type + (Optionally) checks if object has valid type and performs callable inspection for given object attribute. + :param obj: input object + :param name: inspection object attribute name + :param subtype_of: sequence of types to check + if an instance of an input object is one of them; + just like `isinstance(obj, subtype_of)` + :raises IncompatibleHandlerFactoryError: when object type is not supported + :raises IncompatibleHandlerFactoryError: + when object has no attribute with expected name + :raises IncompatibleHandlerFactoryError: + when expected attribute is not callable + :return: callable object attribute `CallableDetails` result """ + if subtype_of and not isinstance(obj, tuple(subtype_of)): + raise IncompatibleHandlerFactoryError( + f"Object {obj!r} is not type of {tuple(subtype_of)}" + ) - name: str - subtype_of: tuple[Any, ...] - - def __init__(self, name: str, owner_subtype_of: Sequence[Any] = ()) -> None: - """ - Initializes callable attribute inspection object, - that (optionally) checks if object has valid type - and performs callable inspection for given object attribute - :param name: inspection object attribute name - :param owner_subtype_of: sequence of types to check - if an instance of an input object is one of them; - just like `isinstance(obj, owner_subtype_of)` - """ - self.name = name - self.subtype_of = tuple(owner_subtype_of) - - def __call__(self, obj: Any) -> CallableDetails: - """ - (Optionally) checks if object has valid type - and performs callable inspection for given object attribute. - :param obj: input object - :raises IncompatibleHandlerFactoryError: when object type is not supported - :raises IncompatibleHandlerFactoryError: - when object has no attribute with expected name - :raises IncompatibleHandlerFactoryError: - when expected attribute is not callable - :return: callable object attribute `CallableDetails` result - """ - if self.subtype_of and not isinstance(obj, self.subtype_of): - raise IncompatibleHandlerFactoryError( - f"Object {obj!r} is not type of {self.subtype_of}" - ) + try: + attr = getattr(obj, name) + except AttributeError: + raise IncompatibleHandlerFactoryError( + f"Object {obj!r} has no attribute named {name}" + ) from None - try: - attr = getattr(obj, self.name) - except AttributeError: - raise IncompatibleHandlerFactoryError( - f"Object {obj!r} has no attribute named {self.name}" - ) from None - - try: - return CallableInspector.inspect(attr) - except TypeError as e: - raise IncompatibleHandlerFactoryError( - f"{obj!r} attribute {self.name}: {e}" - ) from e + try: + return CallableInspector.inspect(attr) + except TypeError as e: + raise IncompatibleHandlerFactoryError(f"{obj!r} attribute {name}: {e}") from e -class HandlerSubjectArgGet: +def find_subject_arg(details: CallableDetails, name: str | None = None) -> CallableArg: """ - Utility that finds primary argument for given callable object, + Finds primary argument for given callable, to be filled with action subject (event, request, command etc object). + :param details: callable details to use + :param name: optional argument name hint; + when provided argument with that name is assumed as primary, + otherwise first callable argument is used + :raises IncompatibleHandlerFactoryError: when callable has no arguments + :raises IncompatibleHandlerFactoryError: when argument name was specified, + but no matching argument was found + :raises HandlerFactoryError: + when for found primary argument cannot be determined unequivocal type + :return: primary argument details """ + if not details.args: + raise IncompatibleHandlerFactoryError( + f"Callable {details.obj!r} has no explicit argument" + ) - def __init__(self, name: str | None = None) -> None: - """ - Initializes utility that finds primary argument for given callable object. - :param name: optional argument name hint; - when provided utility will assume argument with that name as primary - """ - self.name = name - - def __call__(self, details: CallableDetails) -> CallableArg: - """ - Provides callable primary argument using `CallableDetails` object. - :param details: callable details to use - :raises IncompatibleHandlerFactoryError: when callable has no arguments - :raises IncompatibleHandlerFactoryError: when argument name was specified, - but no matching argument was found - :raises IncompatibleHandlerFactoryError: when argument has no or invalid type - :raises HandlerFactoryError: - when for found primary argument cannot be determined unequivocal type - :return: primary argument details - """ - if not details.args: - raise IncompatibleHandlerFactoryError( - f"Callable {details.obj!r} has no explicit argument" - ) - arg = self._find(details) - self._check_type(details, arg) - return arg - - def _find(self, details: CallableDetails) -> CallableArg: - """ - Finds primary callable argument using given details - :param details: callable details - :raises IncompatibleHandlerFactoryError: when callable has no arguments - :raises IncompatibleHandlerFactoryError: when argument name was specified, - but no matching argument was found - :return: primary argument details - """ - if self.name: - return self._find_by_name(details, self.name) - else: - return self._get_first(details) - - @staticmethod - def _find_by_name(details: CallableDetails, name: str) -> CallableArg: - """ - Tries to find primary argument by name using given callable details. - :param details: callable details - :param name: argument name - :raises IncompatibleHandlerFactoryError: when no matching argument was found - :return: primary argument details - """ + if name: arg = details.arg_by_name(name) - if not arg: + if arg is None: raise IncompatibleHandlerFactoryError( f"Callable {details.obj!r} has no argument named {name}" ) - return arg - - @staticmethod - def _get_first(details: CallableDetails) -> CallableArg: - """ - Returns first callable argument as primary - :param details: callable details - :return: primary argument details - """ - return details.args[0] - - @staticmethod - def _check_type(details: CallableDetails, arg: CallableArg) -> None: - """ - Checks given primary argument candidate is a valid one - :param details: callable details - :param arg: primary argument candidate details - :raises HandlerFactoryError: - when for given primary argument cannot be determined unequivocal type - """ - if arg.type is None: - raise HandlerFactoryError( - f"Callable {details.obj!r} argument {arg.name} has no type annotation" - ) - if not isinstance(arg.type, type): - raise HandlerFactoryError( - f"Callable {details.obj!r} argument {arg.name}" - f" type annotation is not a type" - ) + else: + arg = details.args[0] + + if arg.type is None: + raise HandlerFactoryError( + f"Callable {details.obj!r} argument {arg.name} has no type annotation" + ) + if not isinstance(arg.type, type): + raise HandlerFactoryError( + f"Callable {details.obj!r} argument {arg.name}" + f" type annotation is not a type" + ) + return arg -class CallableHandlerCreate: +def create_callable_handler( + details: CallableDetails, obj: Any, policy: CallableHandlerPolicy +) -> Handler: """ Creates callable handler using given specification. + :param details: details of callable to be invoked by handler + :param obj: underlying object + - source of callable object and handler behaviour information object + :param policy: specification how handler should invoke callable + :raises IncompatibleHandlerFactoryError: + when callable has no usable primary (subject) argument + :raises HandlerFactoryError: + when for primary (subject) argument cannot be determined unequivocal type + :raises HandlerFactoryError: when callable object is not async callable + :return: handler object that can call underlying callable using provided action """ - - def __init__( - self, subject_as_keyword: bool, arg_map: dict[str, str], arg_strict: bool - ) -> None: - """ - Initializes callable handler factory using given specification. - :param subject_as_keyword: - force to provide primary (subject) argument as keyword argument - :param arg_map: action extra arguments to callable arguments name mapping; - used for translation to reconcile argument name differences - :param arg_strict: when True all action arguments will be provided for handler, - when False only those that fits into handler callable arguments set - (excessive ones will be dropped) - """ - self.subject_as_keyword = subject_as_keyword - self.arg_map = arg_map - self.arg_strict = arg_strict - - def __call__(self, details: CallableDetails, arg: CallableArg, obj: Any) -> Handler: - """ - Creates callable handler using given specification and configuration. - :param details: callable details - :param arg: primary (subject) argument specification - :param obj: underlying object - - source of callable object and handler behaviour information object - :raises HandlerFactoryError: when callable object is not async callable - :return: handler object that can call underlying callable using provided action - """ - if not details.is_async: - raise HandlerFactoryError(f"Object {details.obj!r} is not async callable") - - subject_name: str | None - if self.subject_as_keyword or not arg.is_positional: - subject_name = arg.name - else: - subject_name = None - - if self.arg_strict or details.has_kwargs: - allow_args = None - else: - allow_args = {arg.name for arg in details.args} - - return CallableHandler( - obj=obj, - fn=details.obj, - key=arg.type, - subject_name=subject_name, - arg_map=self.arg_map, - allow_args=allow_args, - ) + arg = find_subject_arg(details, policy.subject_arg) + if not details.is_async: + raise HandlerFactoryError(f"Object {details.obj!r} is not async callable") + + subject_name: str | None + if policy.subject_as_keyword or not arg.is_positional: + # subject has to be provided as keyword argument + subject_name = arg.name + else: + subject_name = None + + allow_args: set[str] | None + if policy.arg_strict or details.has_kwargs: + # all action arguments are provided for callable + allow_args = None + else: + # only arguments that fit into callable signature are provided + allow_args = {arg.name for arg in details.args} + + return CallableHandler( + obj=obj, + fn=details.obj, + key=arg.type, + subject_name=subject_name, + arg_map=policy.arg_map, + allow_args=allow_args, + ) diff --git a/tests/common/factory/test_utils.py b/tests/common/factory/test_utils.py index 07d2f7c..2d00708 100644 --- a/tests/common/factory/test_utils.py +++ b/tests/common/factory/test_utils.py @@ -3,12 +3,16 @@ import pytest -from mediator.common.factory import HandlerFactoryError, IncompatibleHandlerFactoryError +from mediator.common.factory import ( + CallableHandlerPolicy, + HandlerFactoryError, + IncompatibleHandlerFactoryError, +) from mediator.common.factory.utils import ( - CallableAttributeDetails, - CallableHandlerCreate, - CallableObjDetails, - HandlerSubjectArgGet, + create_callable_handler, + find_subject_arg, + inspect_attribute, + inspect_callable, ) from mediator.common.types import ActionResult, ActionSubject @@ -52,12 +56,10 @@ def sync_call(arg: str, x: int, y: int): def test_callable_obj_details(): - get_details = CallableObjDetails() - - assert get_details(_B().method).return_type == _A + assert inspect_callable(_B().method).return_type == _A with pytest.raises(IncompatibleHandlerFactoryError) as e: - get_details(_A()) + inspect_callable(_A()) assert "not callable" in str(e.value) @@ -77,14 +79,13 @@ def test_callable_attribute_details( error: type[Exception] | None, error_message: str | None, ): - get_details = CallableAttributeDetails(name="method", owner_subtype_of=subtype_of) if error: with pytest.raises(error) as e: - get_details(obj) + inspect_attribute(obj, "method", subtype_of) if error_message: assert error_message in str(e.value) else: - details = get_details(obj) + details = inspect_attribute(obj, "method", subtype_of) assert details.return_type == _A @@ -124,17 +125,14 @@ def test_subject_arg_get( error: type[Exception] | None, error_message: str | None, ): - get_details = CallableObjDetails() - arg_get = HandlerSubjectArgGet(name=name) - - details = get_details(obj) + details = inspect_callable(obj) if error: with pytest.raises(error) as e: - arg_get(details) + find_subject_arg(details, name) if error_message: assert error_message in str(e.value) else: - arg = arg_get(details) + arg = find_subject_arg(details, name) assert arg.name == expected_name @@ -165,18 +163,9 @@ async def test_direct_handler_create_successful( arg_map: dict[str, str], expected_result, ): - get_details = CallableObjDetails() - arg_get = HandlerSubjectArgGet(name=name) - handler_create = CallableHandlerCreate( - subject_as_keyword=name is not None, - arg_map=arg_map, - arg_strict=True, - ) - - details = get_details(sig) - arg = arg_get(details) - details = replace(details, obj=obj) - handler = handler_create(details, arg, obj) + policy = CallableHandlerPolicy(subject_arg=name, arg_map=arg_map, arg_strict=True) + details = replace(inspect_callable(sig), obj=obj) + handler = create_callable_handler(details, obj=obj, policy=policy) result = await handler(ActionSubject(subject="test", inject={"x": 1, "y": 2})) assert isinstance(result, ActionResult) @@ -190,14 +179,8 @@ async def test_direct_handler_create_successful( ], ) def test_direct_handler_create_fail(obj, error, error_message): - get_details = CallableObjDetails() - arg_get = HandlerSubjectArgGet(name="arg") - handler_create = CallableHandlerCreate( - subject_as_keyword=False, arg_map={}, arg_strict=True - ) - - details = get_details(obj) - arg = arg_get(details) + policy = CallableHandlerPolicy(subject_arg="arg", arg_strict=True) + details = inspect_callable(obj) with pytest.raises(error) as e: - handler_create(details, arg, obj) + create_callable_handler(details, obj=obj, policy=policy) assert error_message in str(e.value) From 16b2fe7ae4ca84ef654d86ad728aff1dd56a5d38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20=C5=81ukawski?= Date: Sun, 15 Nov 2026 14:20:19 +0000 Subject: [PATCH 09/11] Let one handler accept a union of subject types and register it for each of them. An unresolvable annotation on a non-subject argument no longer fails handler registration, including lazily evaluated annotations on Python 3.14. --- src/mediator/common/factory/base.py | 11 ++-- src/mediator/common/factory/cascade.py | 7 +-- src/mediator/common/factory/factories.py | 21 ++++---- src/mediator/common/factory/utils.py | 64 +++++++++++++++------- src/mediator/common/registry/registry.py | 6 +-- src/mediator/utils/inspection.py | 67 ++++++++++++++++++++++-- tests/common/factory/test_cascade.py | 4 +- tests/common/factory/test_factories.py | 4 +- tests/common/factory/test_utils.py | 66 +++++++++++++++++++++-- tests/event/test_local.py | 15 ++++++ tests/request/test_request.py | 12 +++++ tests/utils/test_inspection.py | 38 ++++++++++++++ 12 files changed, 266 insertions(+), 49 deletions(-) diff --git a/src/mediator/common/factory/base.py b/src/mediator/common/factory/base.py index 96c7ec8..38f63cd 100644 --- a/src/mediator/common/factory/base.py +++ b/src/mediator/common/factory/base.py @@ -28,14 +28,17 @@ class HandlerFactory(Protocol): form underlying object. """ - def create(self, obj: Any) -> Handler: + def create(self, obj: Any) -> Sequence[Handler]: """ - Creates handler for given object. - :param obj: object to create handler for + Creates handlers for given object. + + Usually single handler is created, but object that accepts + many action subject types (like `A | B`) gets one handler for each type. + :param obj: object to create handlers for :raises IncompatibleHandlerFactoryError: when object is incompatible with factory specification :raises HandlerFactoryError: when there is failure during object inspection - :return: handler for given object + :return: handlers for given object """ ... diff --git a/src/mediator/common/factory/cascade.py b/src/mediator/common/factory/cascade.py index b246027..e7a4915 100644 --- a/src/mediator/common/factory/cascade.py +++ b/src/mediator/common/factory/cascade.py @@ -99,9 +99,9 @@ def __init__( self._mapper = mapper self._factories = mapper.map_all(policies) - def __call__(self, obj: Any) -> Handler: + def __call__(self, obj: Any) -> Sequence[Handler]: """ - Tries to create handler object for given python object + Tries to create handler objects for given python object (compatible with cascade policy sequence). :param obj: any compatible python object :raises InspectionHandlerFactoryCascadeError: @@ -109,7 +109,8 @@ def __call__(self, obj: Any) -> Handler: :raises IncompatibleHandlerFactoryCascadeError: when object cannot be mapped by any handler factory - is incompatible cascade configuration - :return: handler object for given python object + :return: handler objects for given python object + (one for every action subject type accepted by it) """ factory_errors = [] for factory in self._factories: diff --git a/src/mediator/common/factory/factories.py b/src/mediator/common/factory/factories.py index 52ff546..1addcc5 100644 --- a/src/mediator/common/factory/factories.py +++ b/src/mediator/common/factory/factories.py @@ -1,9 +1,10 @@ +from collections.abc import Sequence from typing import Any from mediator.common.factory.base import HandlerFactory from mediator.common.factory.policies import CallableHandlerPolicy, MethodHandlerPolicy from mediator.common.factory.utils import ( - create_callable_handler, + create_callable_handlers, inspect_attribute, inspect_callable, ) @@ -25,17 +26,18 @@ def __init__(self, policy: CallableHandlerPolicy) -> None: """ self._policy = policy - def create(self, obj: Any) -> Handler: + def create(self, obj: Any) -> Sequence[Handler]: """ - Creates handler directly form callable object. + Creates handlers directly form callable object. :param obj: callable object :raises IncompatibleHandlerFactoryError: when callable object is incompatible with factory specification :raises HandlerFactoryError: when there is failure during object inspection - :return: handler invoking given callable object + :return: handlers invoking given callable object + (one for every action subject type accepted by it) """ details = inspect_callable(obj) - return create_callable_handler(details, obj=obj, policy=self._policy) + return create_callable_handlers(details, obj=obj, policy=self._policy) class MethodHandlerFactory(HandlerFactory): @@ -54,15 +56,16 @@ def __init__(self, policy: MethodHandlerPolicy) -> None: """ self._policy = policy - def create(self, obj: Any) -> Handler: + def create(self, obj: Any) -> Sequence[Handler]: """ - Creates handler from given object attribute according to specification. + Creates handlers from given object attribute according to specification. :param obj: callable object :raises IncompatibleHandlerFactoryError: when callable object is incompatible with factory specification :raises HandlerFactoryError: when there is failure during object inspection - :return: handler invoking given object callable attribute + :return: handlers invoking given object callable attribute + (one for every action subject type accepted by it) """ policy = self._policy details = inspect_attribute(obj, policy.name, policy.subtype_of) - return create_callable_handler(details, obj=obj, policy=policy.policy) + return create_callable_handlers(details, obj=obj, policy=policy.policy) diff --git a/src/mediator/common/factory/utils.py b/src/mediator/common/factory/utils.py index abc4569..0a963d3 100644 --- a/src/mediator/common/factory/utils.py +++ b/src/mediator/common/factory/utils.py @@ -1,5 +1,6 @@ from collections.abc import Sequence -from typing import Any +from types import NoneType, UnionType +from typing import Any, Union, get_args, get_origin from mediator.common.factory.base import ( HandlerFactoryError, @@ -71,8 +72,6 @@ def find_subject_arg(details: CallableDetails, name: str | None = None) -> Calla :raises IncompatibleHandlerFactoryError: when callable has no arguments :raises IncompatibleHandlerFactoryError: when argument name was specified, but no matching argument was found - :raises HandlerFactoryError: - when for found primary argument cannot be determined unequivocal type :return: primary argument details """ if not details.args: @@ -88,24 +87,47 @@ def find_subject_arg(details: CallableDetails, name: str | None = None) -> Calla ) else: arg = details.args[0] + return arg + - if arg.type is None: +def subject_types(details: CallableDetails, arg: CallableArg) -> tuple[type, ...]: + """ + Provides action subject types accepted by given primary callable argument. + :param details: callable details + :param arg: primary argument details + :raises HandlerFactoryError: when argument has no type annotation + or its type annotation cannot be resolved + :raises HandlerFactoryError: when argument type annotation + is not a type or union of types + :return: single type or all types of union (like `A | B`) in declared order + """ + annotation = arg.type + if annotation is None: raise HandlerFactoryError( f"Callable {details.obj!r} argument {arg.name} has no type annotation" + f" or it cannot be resolved" ) - if not isinstance(arg.type, type): + + types: tuple[Any, ...] + if get_origin(annotation) in (Union, UnionType): + types = get_args(annotation) + else: + types = (annotation,) + + if not all(isinstance(type_, type) and type_ is not NoneType for type_ in types): raise HandlerFactoryError( f"Callable {details.obj!r} argument {arg.name}" - f" type annotation is not a type" + f" type annotation is not a type or union of types" ) - return arg + return types -def create_callable_handler( +def create_callable_handlers( details: CallableDetails, obj: Any, policy: CallableHandlerPolicy -) -> Handler: +) -> Sequence[Handler]: """ - Creates callable handler using given specification. + Creates callable handlers using given specification: + one for every action subject type accepted by callable. :param details: details of callable to be invoked by handler :param obj: underlying object - source of callable object and handler behaviour information object @@ -115,9 +137,10 @@ def create_callable_handler( :raises HandlerFactoryError: when for primary (subject) argument cannot be determined unequivocal type :raises HandlerFactoryError: when callable object is not async callable - :return: handler object that can call underlying callable using provided action + :return: handler objects that can call underlying callable using provided action """ arg = find_subject_arg(details, policy.subject_arg) + types = subject_types(details, arg) if not details.is_async: raise HandlerFactoryError(f"Object {details.obj!r} is not async callable") @@ -136,11 +159,14 @@ def create_callable_handler( # only arguments that fit into callable signature are provided allow_args = {arg.name for arg in details.args} - return CallableHandler( - obj=obj, - fn=details.obj, - key=arg.type, - subject_name=subject_name, - arg_map=policy.arg_map, - allow_args=allow_args, - ) + return [ + CallableHandler( + obj=obj, + fn=details.obj, + key=type_, + subject_name=subject_name, + arg_map=policy.arg_map, + allow_args=allow_args, + ) + for type_ in types + ] diff --git a/src/mediator/common/registry/registry.py b/src/mediator/common/registry/registry.py index ba38726..a8267ab 100644 --- a/src/mediator/common/registry/registry.py +++ b/src/mediator/common/registry/registry.py @@ -116,13 +116,13 @@ def _process_obj( modifiers: Sequence[ModifierFactory], ) -> None: """ - Creates handler entry for given raw action handler object. + Creates handler entries for given raw action handler object. :param obj: raw action handler object :param cascade: cascade to use for handler factory :param modifiers: modifiers to be directly applied on given handler entry """ - handler = cascade(obj) - self.add(HandlerEntry(handler=handler, modifiers=modifiers)) + for handler in cascade(obj): + self.add(HandlerEntry(handler=handler, modifiers=modifiers)) def add(self, entry: HandlerEntry) -> None: """ diff --git a/src/mediator/utils/inspection.py b/src/mediator/utils/inspection.py index a73c01d..4fe44fd 100644 --- a/src/mediator/utils/inspection.py +++ b/src/mediator/utils/inspection.py @@ -1,7 +1,13 @@ import inspect +import sys from dataclasses import dataclass from inspect import Parameter -from typing import Any, get_type_hints +from typing import Annotated, Any, ForwardRef, get_args, get_origin, get_type_hints + +if sys.version_info >= (3, 14): + import annotationlib + + _FORWARDREF = annotationlib.Format.FORWARDREF @dataclass(frozen=True) @@ -124,8 +130,8 @@ def io_details(cls, fn: Any) -> CallableIODetails: """ if not inspect.isroutine(fn): fn = fn.__call__ - signature = inspect.signature(fn) - annotations = get_type_hints(fn) + signature = _signature(fn) + annotations = _type_hints(fn) return CallableIODetails( args=[ CallableArg( @@ -142,3 +148,58 @@ def io_details(cls, fn: Any) -> CallableIODetails: ), return_type=annotations.get("return"), ) + + +def _type_hints(fn: Any) -> dict[str, Any]: + """ + Provides resolved annotations of given callable. + + Works like `typing.get_type_hints`, but annotation that cannot be resolved + (i.e. name imported only for type checking) does not fail the other ones. + Such annotation is omitted in result. + :param fn: callable to inspect + :return: argument name (or `return`) to resolved annotation mapping + """ + try: + return get_type_hints(fn) + except (NameError, AttributeError): + pass + + globalns = getattr(inspect.unwrap(fn), "__globals__", {}) + hints: dict[str, Any] = {} + for name, annotation in _raw_annotations(fn).items(): + if isinstance(annotation, str): + try: + annotation = eval(annotation, globalns) + except Exception: + continue + elif isinstance(annotation, ForwardRef): + continue + if get_origin(annotation) is Annotated: + annotation = get_args(annotation)[0] + hints[name] = annotation + return hints + + +def _signature(fn: Any) -> inspect.Signature: + """ + Provides signature of given callable without failing on unresolvable annotations. + :param fn: callable to inspect + :return: callable signature + """ + if sys.version_info >= (3, 14): + # annotations are evaluated lazily, so reading them may fail + return inspect.signature(fn, annotation_format=_FORWARDREF) + return inspect.signature(fn) + + +def _raw_annotations(fn: Any) -> dict[str, Any]: + """ + Provides annotations of given callable without failing on unresolvable ones. + :param fn: callable to inspect + :return: argument name (or `return`) to annotation mapping, + where not evaluated annotation is a string or forward reference object + """ + if sys.version_info >= (3, 14): + return annotationlib.get_annotations(fn, format=_FORWARDREF) + return inspect.get_annotations(fn) diff --git a/tests/common/factory/test_cascade.py b/tests/common/factory/test_cascade.py index 14c1992..3c1ce12 100644 --- a/tests/common/factory/test_cascade.py +++ b/tests/common/factory/test_cascade.py @@ -42,7 +42,7 @@ async def test_handler_factory_cascade_success(obj): cascade = HandlerFactoryCascade( policies=[CallableHandlerPolicy(), MethodHandlerPolicy(name="method")] ) - handler = cascade(obj) + [handler] = cascade(obj) await _check_handler_works(handler) @@ -55,7 +55,7 @@ async def test_handler_factory_cascade_replace(): cascade(obj) cascade = cascade.replace(policies=[MethodHandlerPolicy(name="method")]) - handler = cascade(obj) + [handler] = cascade(obj) await _check_handler_works(handler) diff --git a/tests/common/factory/test_factories.py b/tests/common/factory/test_factories.py index b9efa37..d70b0b7 100644 --- a/tests/common/factory/test_factories.py +++ b/tests/common/factory/test_factories.py @@ -44,7 +44,7 @@ async def _check_handler(handler: Handler): @pytest.mark.asyncio async def test_callable_handler_factory(obj, policy: CallableHandlerPolicy): factory = CallableHandlerFactory(policy) - handler = factory.create(obj) + [handler] = factory.create(obj) await _check_handler(handler) @@ -65,5 +65,5 @@ async def test_callable_handler_factory(obj, policy: CallableHandlerPolicy): @pytest.mark.asyncio async def test_method_handler_factory(obj, policy: MethodHandlerPolicy): factory = MethodHandlerFactory(policy) - handler = factory.create(obj) + [handler] = factory.create(obj) await _check_handler(handler) diff --git a/tests/common/factory/test_utils.py b/tests/common/factory/test_utils.py index 2d00708..b8c20ab 100644 --- a/tests/common/factory/test_utils.py +++ b/tests/common/factory/test_utils.py @@ -1,5 +1,6 @@ from collections.abc import Sequence from dataclasses import replace +from typing import Union import pytest @@ -9,10 +10,11 @@ IncompatibleHandlerFactoryError, ) from mediator.common.factory.utils import ( - create_callable_handler, + create_callable_handlers, find_subject_arg, inspect_attribute, inspect_callable, + subject_types, ) from mediator.common.types import ActionResult, ActionSubject @@ -128,7 +130,7 @@ def test_subject_arg_get( details = inspect_callable(obj) if error: with pytest.raises(error) as e: - find_subject_arg(details, name) + subject_types(details, find_subject_arg(details, name)) if error_message: assert error_message in str(e.value) else: @@ -165,7 +167,7 @@ async def test_direct_handler_create_successful( ): policy = CallableHandlerPolicy(subject_arg=name, arg_map=arg_map, arg_strict=True) details = replace(inspect_callable(sig), obj=obj) - handler = create_callable_handler(details, obj=obj, policy=policy) + [handler] = create_callable_handlers(details, obj=obj, policy=policy) result = await handler(ActionSubject(subject="test", inject={"x": 1, "y": 2})) assert isinstance(result, ActionResult) @@ -182,5 +184,61 @@ def test_direct_handler_create_fail(obj, error, error_message): policy = CallableHandlerPolicy(subject_arg="arg", arg_strict=True) details = inspect_callable(obj) with pytest.raises(error) as e: - create_callable_handler(details, obj=obj, policy=policy) + create_callable_handlers(details, obj=obj, policy=policy) + assert error_message in str(e.value) + + +class _D: + @staticmethod + async def union(arg: _A | _C, x: int): + pass + + @staticmethod + async def typing_union(arg: Union[_A, _C], x: int): # noqa: UP007 + pass + + @staticmethod + async def single(arg: _A, x: int): + pass + + @staticmethod + async def unresolvable(arg: "Missing", x: int): # type: ignore[name-defined] # noqa: F821 + pass + + @staticmethod + async def generic(arg: list[_A], x: int): + pass + + +@pytest.mark.parametrize( + ("obj", "expected_types"), + [ + (_D.union, (_A, _C)), + (_D.typing_union, (_A, _C)), + (_D.single, (_A,)), + ], +) +def test_subject_types(obj, expected_types: tuple[type, ...]): + details = inspect_callable(obj) + arg = find_subject_arg(details) + assert subject_types(details, arg) == expected_types + + handlers = create_callable_handlers( + details, obj=obj, policy=CallableHandlerPolicy() + ) + assert tuple(handler.key for handler in handlers) == expected_types + + +@pytest.mark.parametrize( + ("obj", "error_message"), + [ + (_D.unresolvable, "cannot be resolved"), + (_D.generic, "not a type or union of types"), + ], +) +def test_subject_types_fail(obj, error_message: str): + details = inspect_callable(obj) + arg = find_subject_arg(details) + with pytest.raises(HandlerFactoryError) as e: + subject_types(details, arg) assert error_message in str(e.value) diff --git a/tests/event/test_local.py b/tests/event/test_local.py index cd36239..cce27ba 100644 --- a/tests/event/test_local.py +++ b/tests/event/test_local.py @@ -174,3 +174,18 @@ async def _handler(event: str): await bus.publish("test") assert handled == ["test"] + + +@pytest.mark.asyncio +async def test_local_event_bus_union_handler(): + handled: list[object] = [] + bus = LocalEventBus(dispatcher=AwaitingEventDispatcher()) + + @bus.register + async def _handler(event: _MockupEvent1 | _MockupEvent2): + handled.append(event) + + first, second = _MockupEvent1(), _MockupEvent2() + await bus.publish(first) + await bus.publish(second) + assert handled == [first, second] diff --git a/tests/request/test_request.py b/tests/request/test_request.py index 05c24e7..97f0fb3 100644 --- a/tests/request/test_request.py +++ b/tests/request/test_request.py @@ -76,3 +76,15 @@ async def test_local_request_executor_result_type(): executor.register(_handle_a) with pytest.raises(TypeError, match="ActionResult"): await executor.execute(_RequestA(), seq=[]) + + +@pytest.mark.asyncio +async def test_local_request_executor_union_handler(): + executor = LocalRequestBus() + + @executor.register + async def _handle(request: _RequestA | _RequestB): + return type(request) + + assert await executor.execute(_RequestA()) is _RequestA + assert await executor.execute(_RequestB()) is _RequestB diff --git a/tests/utils/test_inspection.py b/tests/utils/test_inspection.py index cfa4142..e1f822e 100644 --- a/tests/utils/test_inspection.py +++ b/tests/utils/test_inspection.py @@ -1,4 +1,7 @@ +import inspect +import sys from collections.abc import Sequence +from typing import Annotated import pytest @@ -139,3 +142,38 @@ def b_check(details: CallableDetails): def test_callable_inspector(fn, test_fn): result = CallableInspector.inspect(fn) test_fn(result) + + +# noinspection PyUnusedLocal +async def unresolvable_a(x: X, other: "Missing") -> "X": # type: ignore[name-defined] # noqa: F821 + return x + + +# noinspection PyUnusedLocal +async def unresolvable_b(x: "X", other: "inspect.Missing"): # type: ignore[name-defined] + pass + + +# noinspection PyUnusedLocal +async def unresolvable_c(x: 'Annotated[X, "meta"]', other: "Missing"): # type: ignore[name-defined] # noqa: F821 + pass + + +@pytest.mark.parametrize("fn", [unresolvable_a, unresolvable_b, unresolvable_c]) +def test_callable_inspector_unresolvable_annotation(fn): + details = CallableInspector.inspect(fn) + _check_arg(details.args, types=[X, None]) + + +def test_callable_inspector_unresolvable_return_annotation(): + assert CallableInspector.inspect(unresolvable_a).return_type is X + + +@pytest.mark.skipif( + sys.version_info < (3, 14), reason="requires deferred evaluation of annotations" +) +def test_callable_inspector_unresolvable_deferred_annotation(): + namespace = {"X": X} + exec("async def fn(x: X, other: Missing): pass", namespace) + details = CallableInspector.inspect(namespace["fn"]) + _check_arg(details.args, types=[X, None]) From 780e4718c24718cf6af0a9469e98a7283160e206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20=C5=81ukawski?= Date: Sun, 15 Nov 2026 14:21:01 +0000 Subject: [PATCH 10/11] Add an optional generic Request base class, so type checkers know the result type of executing a request. --- example/test_request_simple.py | 8 +++++--- src/mediator/request/__init__.py | 3 ++- src/mediator/request/base.py | 29 +++++++++++++++++++++++++- src/mediator/request/local.py | 10 +++++++-- tests/request/test_request.py | 35 ++++++++++++++++++++++++++++++-- 5 files changed, 76 insertions(+), 9 deletions(-) diff --git a/example/test_request_simple.py b/example/test_request_simple.py index 79ade66..846ee33 100644 --- a/example/test_request_simple.py +++ b/example/test_request_simple.py @@ -2,7 +2,7 @@ import pytest -from mediator.request import LocalRequestBus +from mediator.request import LocalRequestBus, Request bus = LocalRequestBus() @@ -18,13 +18,15 @@ async def command_handler(event: PrintMessageCommand): return event.message +# Request base class is optional: it tells type checker +# what is the result type of request execution @dataclass -class DataQuery: +class DataQuery(Request[dict[str, object]]): id: int @bus.register -async def query_handler(query: DataQuery): +async def query_handler(query: DataQuery) -> dict[str, object]: print(f"data query: {query.id}") return {"id": query.id, "data": "test"} diff --git a/src/mediator/request/__init__.py b/src/mediator/request/__init__.py index b1e56be..5c2d37f 100644 --- a/src/mediator/request/__init__.py +++ b/src/mediator/request/__init__.py @@ -1,9 +1,10 @@ -from mediator.request.base import RequestExecutor +from mediator.request.base import Request, RequestExecutor from mediator.request.local import LocalRequestBus from mediator.request.registry import RequestHandlerRegistry __all__ = [ "LocalRequestBus", + "Request", "RequestExecutor", "RequestHandlerRegistry", ] diff --git a/src/mediator/request/base.py b/src/mediator/request/base.py index dc713a3..067d195 100644 --- a/src/mediator/request/base.py +++ b/src/mediator/request/base.py @@ -1,4 +1,25 @@ -from typing import Any, Protocol +from typing import Any, Generic, Protocol, TypeVar, overload + +R = TypeVar("R") +R_co = TypeVar("R_co", covariant=True) + + +class Request(Generic[R_co]): + """ + Optional base class for request objects, that declares request result type. + + Request executor returns precise result type for objects of such classes: + >>> @dataclass(frozen=True) + >>> class GetUserName(Request[str]): + >>> user_id: int + >>> + >>> name = await bus.execute(GetUserName(user_id=1)) # type checker knows: str + + Usage is not required: any object can be a request, + in that case result type is not known to type checker. + """ + + __slots__ = () class RequestExecutor(Protocol): @@ -6,6 +27,12 @@ class RequestExecutor(Protocol): Request executor interface. """ + @overload + async def execute(self, obj: Request[R], **kwargs: Any) -> R: ... + + @overload + async def execute(self, obj: Any, **kwargs: Any) -> Any: ... + async def execute(self, obj: Any, **kwargs: Any) -> Any: """ Executes given request and returns execution result. diff --git a/src/mediator/request/local.py b/src/mediator/request/local.py index d42098e..9a0975b 100644 --- a/src/mediator/request/local.py +++ b/src/mediator/request/local.py @@ -1,5 +1,5 @@ from collections.abc import Hashable, Sequence -from typing import Any +from typing import Any, overload from mediator.common.factory import ( CallableHandlerPolicy, @@ -14,7 +14,7 @@ MappingHandlerStore, ) from mediator.common.types import ActionCallType, ActionResult, ActionSubject -from mediator.request.base import RequestExecutor +from mediator.request.base import R, Request, RequestExecutor class _RequestExecutorHandlerStore(MappingHandlerStore): @@ -101,6 +101,12 @@ def __init__( ) self._executor = executor_store + @overload + async def execute(self, obj: Request[R], **kwargs: Any) -> R: ... + + @overload + async def execute(self, obj: Any, **kwargs: Any) -> Any: ... + async def execute(self, obj: Any, **kwargs: Any) -> Any: """ Executes given request. diff --git a/tests/request/test_request.py b/tests/request/test_request.py index 97f0fb3..6c74474 100644 --- a/tests/request/test_request.py +++ b/tests/request/test_request.py @@ -1,11 +1,17 @@ -from typing import Any +from dataclasses import dataclass +from typing import Any, assert_type import pytest from mediator.common.factory import CallableHandlerPolicy from mediator.common.registry import LookupHandlerStoreError from mediator.common.types import ActionCallType, ActionSubject -from mediator.request import LocalRequestBus, RequestHandlerRegistry +from mediator.request import ( + LocalRequestBus, + Request, + RequestExecutor, + RequestHandlerRegistry, +) from tests.common.test_modifiers import MockupModifierFactory @@ -88,3 +94,28 @@ async def _handle(request: _RequestA | _RequestB): assert await executor.execute(_RequestA()) is _RequestA assert await executor.execute(_RequestB()) is _RequestB + + +@dataclass(frozen=True, slots=True) +class _GetLength(Request[int]): + text: str + + +@pytest.mark.asyncio +async def test_local_request_executor_typed_result() -> None: + executor = LocalRequestBus() + + @executor.register + async def _handle(request: _GetLength) -> int: + return len(request.text) + + result = await executor.execute(_GetLength("test")) + assert_type(result, int) + assert result == 4 + + port: RequestExecutor = executor + assert_type(await port.execute(_GetLength("test")), int) + + # result type of plain request object is not known + executor.register(_handle_a) + assert_type(await port.execute(_RequestA(), seq=[]), Any) From d859e7e5c8511476e9071e3ed8c32b7f1ca52f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20=C5=81ukawski?= Date: Sun, 15 Nov 2026 14:22:27 +0000 Subject: [PATCH 11/11] Export the main names from the mediator package, document the new features in the README, add a changelog and bump the version to 0.8.0. --- CHANGELOG.md | 44 +++++++++++++ README.md | 103 ++++++++++++++++++++++++++++--- example/test_event_advanced.py | 1 + example/test_event_simple.py | 3 + pyproject.toml | 2 +- src/mediator/__init__.py | 42 +++++++++++++ src/mediator/request/registry.py | 2 +- uv.lock | 2 +- 8 files changed, 188 insertions(+), 11 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..2dc2fc6 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,44 @@ +# Changelog + +## 0.8.0 + +Requires Python 3.11 or newer. + +### Added +- Type information is shipped with the package (`py.typed`), checked with strict mypy. +- `Request[R]` optional base class - `execute` returns precise result type for it. +- Event dispatchers: `BackgroundEventDispatcher` (default) and `AwaitingEventDispatcher`, + custom ones can be provided by `LocalEventBus(dispatcher=...)`. +- `LocalEventBus.drain()` waits until background event handlers are finished. +- Handler annotated with union of types (`A | B`) is registered for all of them. +- Main names can be imported directly from `mediator` package. + +### Changed +- `LocalEventBus(sync_mode=True)` is replaced by + `LocalEventBus(dispatcher=AwaitingEventDispatcher())`. + Handler errors are raised from `publish` as `ExceptionGroup`. +- Background event handler errors are logged (or passed to `on_error` callable) + instead of being lost. +- Interfaces (`Handler`, `HandlerStore`, `HandlerFactory`, `ModifierFactory`, + `EventPublish`, `EventPublisher`, `EventSubscriber`, `RequestExecutor`) + are `typing.Protocol` classes. Inheriting from them still works. +- `ModifierFactory.create(call, *, target)` - target is explicit keyword argument + instead of being part of `**kwargs`. +- `HandlerFactory.create` and `HandlerFactoryCascade.__call__` return + sequence of handlers instead of single one. +- `ActionSubject`, `ActionResult`, `HandlerEntry`, policies and inspection records + are immutable. +- Helper classes of `mediator.common.factory.utils` are replaced by functions. +- `LocalRequestBus.execute` raises `TypeError` instead of `AssertionError` + when modifier does not return `ActionResult`. +- `mediator.utils.context.AsyncNullContextManager` is removed, + use `contextlib.nullcontext`. + +### Fixed +- Publishing event without handlers failed with `ValueError` in sync mode. +- Background event handler task could be garbage collected before it finished. +- `include()` given one-shot iterator stored handlers but never called them. +- Handler taking subject as keyword argument leaked it + into extra arguments of other handlers of the same event. +- Annotation that cannot be resolved (i.e. `TYPE_CHECKING` only import) + on argument other than subject failed handler registration. diff --git a/README.md b/README.md index f0f4443..b0f27b6 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![license](https://img.shields.io/github/license/dlski/python-mediator.svg)](https://github.com/dlski/python-mediator/blob/master/LICENSE) Elastic and extensible high-performance asyncio CQRS + ES python microframework. -Compatible with recent python versions of CPython and pypy3. +Compatible with Python 3.11+ (CPython and PyPy). Corresponds to clean architecture patterns, ideal for command/query segregation scenarios and event-driven design approaches. @@ -24,18 +24,25 @@ Key features: handler call flow can be extended easily with i.e. data mapping, special exception handling or extra logging by defining modifier stack that wraps handler execution +- **fully typed** - + ships type information, interfaces are `typing.Protocol` classes, + so application code does not have to inherit from library classes - **ultra-lightweight and performance optimized** - has no external dependencies and all features are implemented in care of low runtime overhead -## Help -Work in progress... +## Installation +```shell +pip install python-mediator +# or +uv add python-mediator +``` ## A command/query handling example ```python from dataclasses import dataclass -from mediator.request import LocalRequestBus +from mediator import LocalRequestBus, Request bus = LocalRequestBus() @@ -51,13 +58,15 @@ async def command_handler(event: PrintMessageCommand): return event.message +# Request base class is optional: it tells type checker +# what is the result type of request execution @dataclass -class DataQuery: +class DataQuery(Request[dict[str, object]]): id: int @bus.register -async def query_handler(query: DataQuery): +async def query_handler(query: DataQuery) -> dict[str, object]: print(f"data query: {query.id}") return {"id": query.id, "data": "test"} @@ -66,20 +75,21 @@ async def main(): printed_message = await bus.execute(PrintMessageCommand(message="test")) assert printed_message == "test" - data = await bus.execute(DataQuery(id=1)) + data = await bus.execute(DataQuery(id=1)) # type checker knows: dict[str, object] assert data == {"id": 1, "data": "test"} # -- output -- # print message: test # data query: 1 ``` +Every request type has exactly one handler. More advanced example available in [example/test_request_advanced.py](example/test_request_advanced.py) for reference. ## An event handling example ```python from dataclasses import dataclass -from mediator.event import LocalEventBus +from mediator import LocalEventBus bus = LocalEventBus() @@ -100,9 +110,86 @@ async def second_handler(event: MessageEvent): async def main(): + # handlers run in background, publishing does not wait for them await bus.publish(MessageEvent(message="test")) + # wait until all handlers are finished (i.e. on application shutdown) + await bus.drain() # -- output -- # first handler: test # second handler: test ``` +Event type can have any number of handlers. More advanced example available in [example/test_event_advanced.py](example/test_event_advanced.py) for reference. + +### Event dispatching +The way event handlers are run is decided by event dispatcher: + +| Dispatcher | `publish` returns | Handler error | +|---|---|---| +| `BackgroundEventDispatcher` (default) | immediately, handlers run as background tasks | passed to `on_error` callable, logged by default | +| `AwaitingEventDispatcher` | when all handlers are finished | raised from `publish` as `ExceptionGroup`, other handlers still run | + +```python +from mediator import AwaitingEventDispatcher, BackgroundEventDispatcher, LocalEventBus + +# useful in tests or when event has to be processed before going further +bus = LocalEventBus(dispatcher=AwaitingEventDispatcher()) + +# custom reaction on handler failure +bus = LocalEventBus( + dispatcher=BackgroundEventDispatcher( + on_error=lambda action, error: print(f"{action.subject} failed: {error!r}") + ) +) +``` +Custom strategy is any object with `dispatch` and `drain` methods (see `EventDispatcher`). + +## Handler for many types +Handler with union type annotation is registered for all types of union: +```python +@bus.register +async def audit_handler(event: UserCreated | UserDeleted): ... +``` + +## Extra parameters injection +Keyword arguments given on execution or publishing are passed to handlers +that declare them, other handlers simply do not get them: +```python +@bus.register +async def command_handler(command: PrintMessageCommand, user: str): + print(f"{user} prints: {command.message}") + + +await bus.execute(PrintMessageCommand(message="test"), user="admin", trace_id="1234") +``` + +## Modifiers +Modifier wraps handler execution. Modifier stack can be defined for whole bus, +for registry or for single handler: +```python +from mediator import ActionCallType, ActionResult, ActionSubject, LocalRequestBus + + +class LogModifierFactory: + def create(self, call: ActionCallType, *, target: ActionCallType) -> ActionCallType: + async def wrapper(action: ActionSubject) -> ActionResult: + print(f"before: {action.subject}") + result = await call(action) + print(f"after: {result.result}") + return result + + return wrapper + + +bus = LocalRequestBus(modifiers=[LogModifierFactory()]) +``` + +## Development +Project uses [uv](https://docs.astral.sh/uv/): +```shell +uv sync # create environment +uv run pytest # tests +uv run ruff check . # lints +uv run ruff format . # code formatting +uv run mypy # static type check +``` diff --git a/example/test_event_advanced.py b/example/test_event_advanced.py index f801104..10e3638 100644 --- a/example/test_event_advanced.py +++ b/example/test_event_advanced.py @@ -49,6 +49,7 @@ async def test_event_advanced(): # publish event await bus.publish(MessageEvent(message="test")) + await bus.drain() # output: # from object handler: test diff --git a/example/test_event_simple.py b/example/test_event_simple.py index a2ada44..e97a511 100644 --- a/example/test_event_simple.py +++ b/example/test_event_simple.py @@ -24,7 +24,10 @@ async def second_handler(event: MessageEvent): @pytest.mark.asyncio async def test_event_simple(): + # handlers run in background, publishing does not wait for them await bus.publish(MessageEvent(message="test")) + # wait until all handlers are finished (i.e. on application shutdown) + await bus.drain() # -- output -- # first handler: test # second handler: test diff --git a/pyproject.toml b/pyproject.toml index 4fde2c5..8ec2902 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "python-mediator" -version = "0.7.0" +version = "0.8.0" description = "Python mediator bus microframework for CQRS + ES" readme = "README.md" license = "MIT" diff --git a/src/mediator/__init__.py b/src/mediator/__init__.py index e69de29..5aad32d 100644 --- a/src/mediator/__init__.py +++ b/src/mediator/__init__.py @@ -0,0 +1,42 @@ +from mediator.common.factory import CallableHandlerPolicy, MethodHandlerPolicy +from mediator.common.modifiers import ModifierFactory +from mediator.common.types import ActionCallType, ActionResult, ActionSubject +from mediator.event import ( + AwaitingEventDispatcher, + BackgroundEventDispatcher, + EventAggregate, + EventDispatcher, + EventHandlerRegistry, + EventPublish, + EventPublisher, + EventSubscriber, + LocalEventBus, +) +from mediator.request import ( + LocalRequestBus, + Request, + RequestExecutor, + RequestHandlerRegistry, +) + +__all__ = [ + "ActionCallType", + "ActionResult", + "ActionSubject", + "AwaitingEventDispatcher", + "BackgroundEventDispatcher", + "CallableHandlerPolicy", + "EventAggregate", + "EventDispatcher", + "EventHandlerRegistry", + "EventPublish", + "EventPublisher", + "EventSubscriber", + "LocalEventBus", + "LocalRequestBus", + "MethodHandlerPolicy", + "ModifierFactory", + "Request", + "RequestExecutor", + "RequestHandlerRegistry", +] diff --git a/src/mediator/request/registry.py b/src/mediator/request/registry.py index 8cb5052..c9af007 100644 --- a/src/mediator/request/registry.py +++ b/src/mediator/request/registry.py @@ -11,7 +11,7 @@ class RequestHandlerRegistry(HandlerRegistry): """ - Event handler registry class. + Request handler registry class. Registry that registers (adds) and stores request handlers. """ diff --git a/uv.lock b/uv.lock index 8f7f2c2..8ac0c42 100644 --- a/uv.lock +++ b/uv.lock @@ -480,7 +480,7 @@ wheels = [ [[package]] name = "python-mediator" -version = "0.7.0" +version = "0.8.0" source = { editable = "." } [package.dev-dependencies]