diff --git a/services/api-server/requirements/_base.in b/services/api-server/requirements/_base.in index ae031f2f639..f63ab332f47 100644 --- a/services/api-server/requirements/_base.in +++ b/services/api-server/requirements/_base.in @@ -23,6 +23,7 @@ fastapi[all] httpx orjson packaging +parse pydantic[dotenv] pyyaml tenacity diff --git a/services/api-server/requirements/_base.txt b/services/api-server/requirements/_base.txt index 6588ceaaa78..67bd69f7c0e 100644 --- a/services/api-server/requirements/_base.txt +++ b/services/api-server/requirements/_base.txt @@ -1,57 +1,16 @@ aio-pika==9.4.1 - # via - # -c requirements/../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in aiocache==0.12.2 - # via -r requirements/../../../packages/simcore-sdk/requirements/_base.in aiodebug==2.3.0 - # via - # -c requirements/../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in aiodocker==0.21.0 - # via - # -c requirements/../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in aiofiles==23.2.1 - # via - # -c requirements/../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/_base.in - # -r requirements/_base.in aiohttp==3.9.3 - # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt - # -r requirements/../../../packages/simcore-sdk/requirements/_base.in - # aiodocker + # via aiodocker aiopg==1.4.0 - # via - # -r requirements/../../../packages/simcore-sdk/requirements/_base.in - # -r requirements/_base.in aiormq==6.8.0 # via aio-pika aiosignal==1.3.1 # via aiohttp alembic==1.13.1 - # via - # -r requirements/../../../packages/postgres-database/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in anyio==4.3.0 # via # fast-depends @@ -60,15 +19,6 @@ anyio==4.3.0 # starlette # watchfiles arrow==1.3.0 - # via - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in - # -c requirements/../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../packages/models-library/requirements/_base.in - # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in - # -r requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in async-timeout==4.0.3 # via # aiohttp @@ -83,20 +33,6 @@ attrs==23.2.0 # jsonschema certifi==2024.2.2 # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt # httpcore # httpx cffi==1.16.0 @@ -106,22 +42,6 @@ click==8.1.7 # typer # uvicorn cryptography==42.0.5 - # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt - # -r requirements/_base.in dnspython==2.6.1 # via email-validator email-validator==2.1.1 @@ -134,33 +54,10 @@ fast-depends==2.4.2 # via faststream fastapi==0.99.1 # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt - # -r requirements/../../../packages/service-library/requirements/_fastapi.in - # -r requirements/_base.in # fastapi-pagination # prometheus-fastapi-instrumentator fastapi-pagination==0.12.17 - # via - # -c requirements/./constraints.txt - # -r requirements/_base.in faststream==0.5.10 - # via - # -c requirements/../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in frozenlist==1.4.1 # via # aiohttp @@ -176,24 +73,7 @@ httpcore==1.0.5 httptools==0.6.1 # via uvicorn httpx==0.27.0 - # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt - # -r requirements/../../../packages/service-library/requirements/_fastapi.in - # -r requirements/_base.in - # fastapi + # via fastapi idna==3.6 # via # anyio @@ -203,47 +83,10 @@ idna==3.6 itsdangerous==2.1.2 # via fastapi jinja2==3.1.3 - # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt - # fastapi + # via fastapi jsonschema==3.2.0 - # via - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in - # -c requirements/./constraints.txt - # -r requirements/../../../packages/models-library/requirements/_base.in - # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in mako==1.3.2 - # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt - # alembic + # via alembic markdown-it-py==3.0.0 # via rich markupsafe==2.1.5 @@ -257,42 +100,15 @@ multidict==6.0.5 # aiohttp # yarl orjson==3.10.0 - # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt - # -r requirements/../../../packages/models-library/requirements/_base.in - # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in - # -r requirements/_base.in - # fastapi + # via fastapi packaging==24.0 - # via - # -r requirements/../../../packages/simcore-sdk/requirements/_base.in - # -r requirements/_base.in pamqp==3.3.0 # via aiormq +parse==1.20.2 pint==0.23 - # via -r requirements/../../../packages/simcore-sdk/requirements/_base.in prometheus-client==0.20.0 - # via - # -r requirements/../../../packages/service-library/requirements/_fastapi.in - # prometheus-fastapi-instrumentator + # via prometheus-fastapi-instrumentator prometheus-fastapi-instrumentator==6.1.0 - # via -r requirements/../../../packages/service-library/requirements/_fastapi.in psycopg2-binary==2.9.9 # via # aiopg @@ -301,47 +117,12 @@ pycparser==2.22 # via cffi pydantic==1.10.14 # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/./_base.in - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt - # -r requirements/../../../packages/models-library/requirements/_base.in - # -r requirements/../../../packages/postgres-database/requirements/_base.in - # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in - # -r requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/_base.in - # -r requirements/_base.in # fast-depends # fastapi # fastapi-pagination pygments==2.17.2 # via rich pyinstrument==4.6.2 - # via - # -c requirements/../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in pyrsistent==0.20.0 # via jsonschema python-dateutil==2.9.0.post0 @@ -354,53 +135,11 @@ python-multipart==0.0.9 # via fastapi pyyaml==6.0.1 # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/./_base.in - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt - # -r requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/_base.in # fastapi # uvicorn redis==5.0.4 - # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/./_base.in - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt - # -r requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in rich==13.7.1 - # via - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/_base.in - # typer + # via typer setuptools==69.2.0 # via jsonschema shellingham==1.5.4 @@ -415,68 +154,15 @@ sniffio==1.3.1 # httpx sqlalchemy==1.4.52 # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt - # -r requirements/../../../packages/postgres-database/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in # aiopg # alembic starlette==0.27.0 - # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt - # fastapi + # via fastapi tenacity==8.2.3 - # via - # -c requirements/../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/_base.in - # -r requirements/_base.in toolz==0.12.1 - # via - # -c requirements/../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in tqdm==4.66.2 - # via - # -c requirements/../../../packages/service-library/requirements/./_base.in - # -r requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/_base.in typer==0.12.3 - # via - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/_base.in - # -r requirements/_base.in - # faststream + # via faststream types-python-dateutil==2.9.0.20240316 # via arrow typing-extensions==4.10.0 @@ -493,26 +179,9 @@ typing-extensions==4.10.0 # typer # uvicorn ujson==5.9.0 - # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt - # fastapi + # via fastapi uvicorn==0.29.0 - # via - # -r requirements/../../../packages/service-library/requirements/_fastapi.in - # fastapi + # via fastapi uvloop==0.19.0 # via uvicorn watchfiles==0.21.0 @@ -521,8 +190,6 @@ websockets==12.0 # via uvicorn yarl==1.9.4 # via - # -r requirements/../../../packages/postgres-database/requirements/_base.in - # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in # aio-pika # aiohttp # aiormq diff --git a/services/api-server/requirements/_test.txt b/services/api-server/requirements/_test.txt index ca841ba0136..20398e30a38 100644 --- a/services/api-server/requirements/_test.txt +++ b/services/api-server/requirements/_test.txt @@ -1,40 +1,23 @@ aiohttp==3.9.3 - # via - # -c requirements/../../../requirements/constraints.txt - # -c requirements/_base.txt - # aioresponses + # via aioresponses aioresponses==0.7.6 - # via -r requirements/_test.in aiosignal==1.3.1 - # via - # -c requirements/_base.txt - # aiohttp + # via aiohttp alembic==1.13.1 - # via - # -c requirements/_base.txt - # -r requirements/_test.in anyio==4.3.0 - # via - # -c requirements/_base.txt - # httpx + # via httpx asgi-lifespan==2.1.0 - # via -r requirements/_test.in async-timeout==4.0.3 - # via - # -c requirements/_base.txt - # aiohttp + # via aiohttp attrs==23.2.0 # via - # -c requirements/_base.txt # aiohttp # jschema-to-python # jsonschema # pytest-docker # sarif-om aws-sam-translator==1.55.0 - # via - # -c requirements/./constraints.txt - # cfn-lint + # via cfn-lint aws-xray-sdk==2.13.0 # via moto boto3==1.34.98 @@ -53,39 +36,26 @@ botocore-stubs==1.34.94 # via boto3-stubs certifi==2024.2.2 # via - # -c requirements/../../../requirements/constraints.txt - # -c requirements/_base.txt # httpcore # httpx # requests cffi==1.16.0 - # via - # -c requirements/_base.txt - # cryptography + # via cryptography cfn-lint==0.72.0 - # via - # -c requirements/./constraints.txt - # moto + # via moto charset-normalizer==3.3.2 # via requests click==8.1.7 - # via - # -c requirements/_base.txt - # -r requirements/_test.in - # flask + # via flask coverage==7.5.1 # via pytest-cov cryptography==42.0.5 # via - # -c requirements/../../../requirements/constraints.txt - # -c requirements/_base.txt # moto # python-jose # sshpubkeys docker==7.1.0 - # via - # -r requirements/_test.in - # moto + # via moto ecdsa==0.19.0 # via # moto @@ -93,11 +63,9 @@ ecdsa==0.19.0 # sshpubkeys exceptiongroup==1.2.0 # via - # -c requirements/_base.txt # anyio # pytest faker==25.0.1 - # via -r requirements/_test.in flask==2.1.3 # via # flask-cors @@ -106,31 +74,20 @@ flask-cors==4.0.1 # via moto frozenlist==1.4.1 # via - # -c requirements/_base.txt # aiohttp # aiosignal graphql-core==3.2.3 # via moto greenlet==3.0.3 - # via - # -c requirements/_base.txt - # sqlalchemy + # via sqlalchemy h11==0.14.0 - # via - # -c requirements/_base.txt - # httpcore + # via httpcore httpcore==1.0.5 - # via - # -c requirements/_base.txt - # httpx + # via httpx httpx==0.27.0 - # via - # -c requirements/../../../requirements/constraints.txt - # -c requirements/_base.txt - # respx + # via respx idna==3.6 # via - # -c requirements/_base.txt # anyio # httpx # moto @@ -139,13 +96,9 @@ idna==3.6 iniconfig==2.0.0 # via pytest itsdangerous==2.1.2 - # via - # -c requirements/_base.txt - # flask + # via flask jinja2==3.1.3 # via - # -c requirements/../../../requirements/constraints.txt - # -c requirements/_base.txt # flask # moto jmespath==1.0.1 @@ -163,11 +116,8 @@ jsonpickle==3.0.4 jsonpointer==2.4 # via jsonpatch jsonref==1.1.0 - # via -r requirements/_test.in jsonschema==3.2.0 # via - # -c requirements/_base.txt - # -c requirements/./constraints.txt # aws-sam-translator # cfn-lint # openapi-schema-validator @@ -175,23 +125,15 @@ jsonschema==3.2.0 junit-xml==1.9 # via cfn-lint mako==1.3.2 - # via - # -c requirements/../../../requirements/constraints.txt - # -c requirements/_base.txt - # alembic + # via alembic markupsafe==2.1.5 # via - # -c requirements/_base.txt # jinja2 # mako # moto moto==4.0.1 - # via - # -c requirements/./constraints.txt - # -r requirements/_test.in multidict==6.0.5 # via - # -c requirements/_base.txt # aiohttp # yarl mypy==1.10.0 @@ -203,13 +145,9 @@ networkx==2.8.8 openapi-schema-validator==0.2.3 # via openapi-spec-validator openapi-spec-validator==0.4.0 - # via - # -c requirements/./constraints.txt - # moto + # via moto packaging==24.0 - # via - # -c requirements/_base.txt - # pytest + # via pytest pbr==6.0.0 # via # jschema-to-python @@ -221,41 +159,25 @@ pyasn1==0.6.0 # python-jose # rsa pycparser==2.22 - # via - # -c requirements/_base.txt - # cffi + # via cffi pyinstrument==4.6.2 - # via - # -c requirements/_base.txt - # -r requirements/_test.in pyparsing==3.1.2 # via moto pyrsistent==0.20.0 - # via - # -c requirements/_base.txt - # jsonschema + # via jsonschema pytest==8.2.0 # via - # -r requirements/_test.in # pytest-asyncio # pytest-cov # pytest-docker # pytest-mock pytest-asyncio==0.21.2 - # via - # -c requirements/../../../requirements/constraints.txt - # -r requirements/_test.in pytest-cov==5.0.0 - # via -r requirements/_test.in pytest-docker==3.1.1 - # via -r requirements/_test.in pytest-mock==3.14.0 - # via -r requirements/_test.in pytest-runner==6.0.1 - # via -r requirements/_test.in python-dateutil==2.9.0.post0 # via - # -c requirements/_base.txt # botocore # faker # moto @@ -265,8 +187,6 @@ pytz==2024.1 # via moto pyyaml==6.0.1 # via - # -c requirements/../../../requirements/constraints.txt - # -c requirements/_base.txt # cfn-lint # moto # openapi-spec-validator @@ -279,40 +199,30 @@ requests==2.32.2 responses==0.25.0 # via moto respx==0.21.1 - # via -r requirements/_test.in rsa==4.9 - # via - # -c requirements/../../../requirements/constraints.txt - # python-jose + # via python-jose s3transfer==0.10.1 # via boto3 sarif-om==1.0.4 # via cfn-lint setuptools==69.2.0 # via - # -c requirements/_base.txt # jsonschema # moto # openapi-spec-validator six==1.16.0 # via - # -c requirements/_base.txt # ecdsa # jsonschema # junit-xml # python-dateutil sniffio==1.3.1 # via - # -c requirements/_base.txt # anyio # asgi-lifespan # httpx sqlalchemy==1.4.52 - # via - # -c requirements/../../../requirements/constraints.txt - # -c requirements/_base.txt - # -r requirements/_test.in - # alembic + # via alembic sqlalchemy2-stubs==0.0.2a38 # via sqlalchemy sshpubkeys==3.3.1 @@ -325,12 +235,10 @@ tomli==2.0.1 types-awscrt==0.20.9 # via botocore-stubs types-boto3==1.0.2 - # via -r requirements/_test.in types-s3transfer==0.10.1 # via boto3-stubs typing-extensions==4.10.0 # via - # -c requirements/_base.txt # alembic # anyio # boto3-stubs @@ -338,7 +246,6 @@ typing-extensions==4.10.0 # sqlalchemy2-stubs urllib3==2.2.1 # via - # -c requirements/../../../requirements/constraints.txt # botocore # docker # requests @@ -352,6 +259,4 @@ wrapt==1.16.0 xmltodict==0.13.0 # via moto yarl==1.9.4 - # via - # -c requirements/_base.txt - # aiohttp + # via aiohttp diff --git a/services/api-server/requirements/_tools.txt b/services/api-server/requirements/_tools.txt index 00916438631..cf4dc5cb535 100644 --- a/services/api-server/requirements/_tools.txt +++ b/services/api-server/requirements/_tools.txt @@ -1,19 +1,14 @@ astroid==3.1.0 # via pylint black==24.4.2 - # via -r requirements/../../../requirements/devenv.txt build==1.2.1 # via pip-tools bump2version==1.0.1 - # via -r requirements/../../../requirements/devenv.txt cfgv==3.4.0 # via pre-commit change-case==0.5.2 - # via -r requirements/_tools.in click==8.1.7 # via - # -c requirements/_base.txt - # -c requirements/_test.txt # black # pip-tools dill==0.3.8 @@ -25,32 +20,18 @@ filelock==3.14.0 identify==2.5.36 # via pre-commit isort==5.13.2 - # via - # -r requirements/../../../requirements/devenv.txt - # pylint + # via pylint jinja2==3.1.3 - # via - # -c requirements/../../../requirements/constraints.txt - # -c requirements/_base.txt - # -c requirements/_test.txt - # -r requirements/_tools.in markupsafe==2.1.5 - # via - # -c requirements/_base.txt - # -c requirements/_test.txt - # jinja2 + # via jinja2 mccabe==0.7.0 # via pylint mypy-extensions==1.0.0 - # via - # -c requirements/_test.txt - # black + # via black nodeenv==1.8.0 # via pre-commit packaging==24.0 # via - # -c requirements/_base.txt - # -c requirements/_test.txt # black # build pathspec==0.12.1 @@ -58,38 +39,28 @@ pathspec==0.12.1 pip==24.0 # via pip-tools pip-tools==7.4.1 - # via -r requirements/../../../requirements/devenv.txt platformdirs==4.2.1 # via # black # pylint # virtualenv pre-commit==3.7.0 - # via -r requirements/../../../requirements/devenv.txt pylint==3.1.0 - # via -r requirements/../../../requirements/devenv.txt pyproject-hooks==1.1.0 # via # build # pip-tools pyyaml==6.0.1 # via - # -c requirements/../../../requirements/constraints.txt - # -c requirements/_base.txt - # -c requirements/_test.txt # pre-commit # watchdog ruff==0.4.3 - # via -r requirements/../../../requirements/devenv.txt setuptools==69.2.0 # via - # -c requirements/_base.txt - # -c requirements/_test.txt # nodeenv # pip-tools tomli==2.0.1 # via - # -c requirements/_test.txt # black # build # pip-tools @@ -98,13 +69,10 @@ tomlkit==0.12.4 # via pylint typing-extensions==4.10.0 # via - # -c requirements/_base.txt - # -c requirements/_test.txt # astroid # black virtualenv==20.26.1 # via pre-commit watchdog==4.0.0 - # via -r requirements/_tools.in wheel==0.43.0 # via pip-tools diff --git a/services/api-server/src/simcore_service_api_server/exceptions/backend_errors.py b/services/api-server/src/simcore_service_api_server/exceptions/backend_errors.py index ca5d0711434..30b0d79b7f1 100644 --- a/services/api-server/src/simcore_service_api_server/exceptions/backend_errors.py +++ b/services/api-server/src/simcore_service_api_server/exceptions/backend_errors.py @@ -1,4 +1,5 @@ from fastapi import status +from parse import compile as parse_compile from ._base import ApiServerBaseError @@ -9,6 +10,10 @@ class BaseBackEndError(ApiServerBaseError): status_code = status.HTTP_502_BAD_GATEWAY + @classmethod + def named_fields(cls) -> set[str]: + return set(parse_compile(cls.msg_template).named_fields) + class ListSolversOrStudiesError(BaseBackEndError): msg_template = "Cannot list solvers/studies" @@ -46,7 +51,7 @@ class LogFileNotFoundError(BaseBackEndError): class SolverOutputNotFoundError(BaseBackEndError): - msg_template = "Solver output of project {project_uuid} not found" + msg_template = "Solver output of project {project_id} not found" status_code = status.HTTP_404_NOT_FOUND diff --git a/services/api-server/src/simcore_service_api_server/exceptions/service_errors_utils.py b/services/api-server/src/simcore_service_api_server/exceptions/service_errors_utils.py index 3f521332ccf..114e3678ced 100644 --- a/services/api-server/src/simcore_service_api_server/exceptions/service_errors_utils.py +++ b/services/api-server/src/simcore_service_api_server/exceptions/service_errors_utils.py @@ -2,6 +2,7 @@ from collections.abc import Callable, Mapping from contextlib import contextmanager from functools import wraps +from inspect import signature from typing import Any, NamedTuple, TypeAlias, TypeVar import httpx @@ -126,6 +127,8 @@ def service_exception_mapper( http_status_map: HttpStatusMap, ): def _decorator(func): + _assert_correct_kwargs(func=func, status_map=http_status_map) + @wraps(func) async def _wrapper(*args, **kwargs): with service_exception_handler(service_name, http_status_map, **kwargs): @@ -134,3 +137,16 @@ async def _wrapper(*args, **kwargs): return _wrapper return _decorator + + +def _assert_correct_kwargs(func: Callable, status_map: HttpStatusMap): + _required_kwargs = { + name + for name, param in signature(func).parameters.items() + if param.kind == param.KEYWORD_ONLY + } + for _, exc_type in status_map.items(): + _exception_inputs = exc_type.named_fields() + assert _exception_inputs.issubset( + _required_kwargs + ), f"{_exception_inputs - _required_kwargs} are inputs to `{exc_type.__name__}.msg_template` but not a kwarg in the decorated coroutine `{func.__module__}.{func.__name__}`" # nosec diff --git a/services/api-server/tests/unit/test_exceptions.py b/services/api-server/tests/unit/test_exceptions.py index d9d8b771293..48d75a38928 100644 --- a/services/api-server/tests/unit/test_exceptions.py +++ b/services/api-server/tests/unit/test_exceptions.py @@ -4,15 +4,20 @@ from http import HTTPStatus +from uuid import UUID import httpx import pytest from fastapi import FastAPI, HTTPException, status from httpx import HTTPStatusError, Request, Response from simcore_service_api_server.exceptions import setup_exception_handlers -from simcore_service_api_server.exceptions.backend_errors import ProfileNotFoundError +from simcore_service_api_server.exceptions.backend_errors import ( + BaseBackEndError, + ProfileNotFoundError, +) from simcore_service_api_server.exceptions.custom_errors import MissingWalletError from simcore_service_api_server.exceptions.service_errors_utils import ( + _assert_correct_kwargs, service_exception_mapper, ) from simcore_service_api_server.models.schemas.errors import ErrorGet @@ -84,3 +89,40 @@ async def test_custom_error_handlers(client: httpx.AsyncClient): got = ErrorGet.parse_raw(response.text) assert got.errors == [f"{MissingWalletError(job_id=123)}"] + + +async def test_service_exception_mapper(): + class _ProjectMissingError(BaseBackEndError): + msg_template = "The project {project_id} is missing" + + assert _ProjectMissingError.named_fields() == {"project_id"} + + status_map = {404: _ProjectMissingError} + + async def coro1(project_id): + pass + + with pytest.raises(AssertionError): + _assert_correct_kwargs(func=coro1, status_map=status_map) + + async def coro2(project_id=UUID("9c201eb7-ba04-4d9b-abe6-f16b406ca86d")): + pass + + with pytest.raises(AssertionError) as exc: + _assert_correct_kwargs(func=coro2, status_map=status_map) + + async def coro3(*, project_id): + pass + + _assert_correct_kwargs(func=coro3, status_map=status_map) + + async def coro4(*, project_id=UUID("ce56af2e-e9e5-46a4-8067-662077de5528")): + pass + + _assert_correct_kwargs(func=coro4, status_map=status_map) + + async def coro5(*, project_uuid): + pass + + with pytest.raises(AssertionError): + _assert_correct_kwargs(func=coro5, status_map=status_map)