From dcc813d3ad8ab9984e3edfae0eac5cd730ea87a0 Mon Sep 17 00:00:00 2001 From: Alex Povel Date: Mon, 1 Jan 2024 14:24:23 +0100 Subject: [PATCH] fix: Type errors after mypy version bump --- ancv/data/models/resume.py | 2 +- ancv/reflection.py | 2 +- ancv/visualization/templates.py | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ancv/data/models/resume.py b/ancv/data/models/resume.py index 700b9f1..e843883 100644 --- a/ancv/data/models/resume.py +++ b/ancv/data/models/resume.py @@ -389,7 +389,7 @@ class Config: None, description="Specify career projects" ) meta: Meta = Field( - Meta(), + Meta(ancv=None, canonical=None, version=None, lastModified=None), description="The schema version and any other tooling configuration lives here", ) diff --git a/ancv/reflection.py b/ancv/reflection.py index 0fce2eb..de4163b 100644 --- a/ancv/reflection.py +++ b/ancv/reflection.py @@ -76,4 +76,4 @@ def strip_prefix(cls, v: Optional[list[str]]) -> Optional[list[str]]: return [url.split()[-1] for url in v] -METADATA = Metadata(**metadata(PACKAGE).json) +METADATA = Metadata.parse_obj(metadata(PACKAGE).json) diff --git a/ancv/visualization/templates.py b/ancv/visualization/templates.py index d0a7a8f..3b25df7 100644 --- a/ancv/visualization/templates.py +++ b/ancv/visualization/templates.py @@ -216,7 +216,13 @@ def from_model_config(cls, model: ResumeSchema) -> "Template": """ if (config := model.meta.config) is None: - config = TemplateConfig() + config = TemplateConfig( + template=None, + theme=None, + language=None, + ascii_only=None, + dec31_as_year=None, + ) if (theme_name := config.theme) is None: theme_name = "lollipop"