From 59ad7f5636b700921b2a168d4afe79197a7484a3 Mon Sep 17 00:00:00 2001 From: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com> Date: Fri, 19 Jan 2024 14:25:47 +0100 Subject: [PATCH] Ignore mypy error See https://github.com/python/mypy/issues/1362 and https://docs.pydantic.dev/2.0/usage/computed_fields/ --- app/core/config.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/core/config.py b/app/core/config.py index dab6191484..9db8eaee8f 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -160,19 +160,19 @@ class Settings(BaseSettings): # The combination of `@property` and `@lru_cache` should be replaced by `@cached_property` # See https://docs.python.org/3.8/library/functools.html?highlight=#functools.cached_property - @computed_field + @computed_field # type: ignore[misc] # Current issue with mypy, see https://docs.pydantic.dev/2.0/usage/computed_fields/ and https://github.com/python/mypy/issues/1362 @cached_property def RSA_PRIVATE_KEY(cls) -> Any: return jwk.construct(cls.RSA_PRIVATE_PEM_STRING, algorithm="RS256") - @computed_field + @computed_field # type: ignore[misc] @cached_property def RSA_PUBLIC_KEY(cls) -> Any: return cls.RSA_PRIVATE_KEY.public_key() - @computed_field + @computed_field # type: ignore[misc] @cached_property - def RSA_PUBLIC_JWK(cls) -> dict[str, dict[str, str]]: + def RSA_PUBLIC_JWK(cls) -> dict[str, list[dict[str, str]]]: JWK = cls.RSA_PUBLIC_KEY.to_dict() JWK.update( { @@ -188,7 +188,7 @@ def RSA_PUBLIC_JWK(cls) -> dict[str, dict[str, str]]: # This property parse AUTH_CLIENTS to create a dictionary of auth clients: # {"client_id": AuthClientClassInstance} - @computed_field + @computed_field # type: ignore[misc] @cached_property def KNOWN_AUTH_CLIENTS(cls) -> dict[str, providers.BaseAuthClient]: clients = {}