[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot]
2024-12-09 04:34:32 +00:00
committed by Sina Atalay
parent d28864aad5
commit 0ff58cefcf
4 changed files with 14 additions and 14 deletions

View File

@@ -163,7 +163,6 @@ def cli_command_render(
input_file_path: pathlib.Path = pathlib.Path(input_file_name).absolute()
original_working_directory = pathlib.Path.cwd()
input_file_as_a_dict = data.read_a_yaml_file(input_file_path)
@@ -197,7 +196,9 @@ def cli_command_render(
}
if rendercv_settings_path:
settings_file_path: pathlib.Path = pathlib.Path(rendercv_settings_path).absolute()
settings_file_path: pathlib.Path = pathlib.Path(
rendercv_settings_path
).absolute()
settings_file_as_a_dict = data.read_a_yaml_file(settings_file_path)
input_file_as_a_dict.update(settings_file_as_a_dict)
@@ -206,7 +207,6 @@ def cli_command_render(
design_file_as_a_dict = data.read_a_yaml_file(design_file_path)
input_file_as_a_dict.update(design_file_as_a_dict)
input_file_as_a_dict = utilities.update_render_command_settings_of_the_input_file(
input_file_as_a_dict, cli_render_arguments
)

View File

@@ -18,16 +18,16 @@ from .rendercv_settings import RenderCVSettings
class RenderCVDataModel(RenderCVBaseModelWithoutExtraKeys):
"""This class binds both the CV and the design information together."""
# Note: Unfortunately making this optional is required in order to build
# Note: Unfortunately making this optional is required in order to build
# a json schema that handles seperating configurtion from cv content.
# If pydantic allowed for schema generation with
# `{"anyOf":[
# {"required":["cv"]},
# {"required":["design"]},
# {"required":["rendercv_settings"]}]}`
# {"required":["rendercv_settings"]}]}`
# syntax it would be more elegant.
cv: Optional[CurriculumVitae] = pydantic.Field(
default = None,
default=None,
title="Curriculum Vitae",
description="The data of the CV.",
)

View File

@@ -38,7 +38,7 @@ class RenderCommandSettings(RenderCVBaseModelWithoutExtraKeys):
"""This class is the data model of the `render` command's settings."""
design_path: Optional[str] = pydantic.Field(
default = None,
default=None,
title="Design File Path",
description=(
"The file path to the yaml file containing the design."
@@ -47,7 +47,7 @@ class RenderCommandSettings(RenderCVBaseModelWithoutExtraKeys):
)
rendercv_settings_path: Optional[str] = pydantic.Field(
default = None,
default=None,
title="RenderCV Settings Path",
description=(
"The file path to the yaml file containing the rendercv_settings."

View File

@@ -957,10 +957,10 @@ def test_empty_input_file_with_render_command(tmp_path, input_file_path):
assert "The input file is empty!" in result.stdout
def test_seperation_of_settings(
tmp_path, input_file_path, design_settings_file_path, rendercv_settings_file_path
):
# change the current working directory to the temporary directory:
os.chdir(tmp_path)
@@ -977,8 +977,10 @@ def test_seperation_of_settings(
[
"render",
str(new_input_file_path.relative_to(tmp_path)),
'--design-path', design_settings_file_path,
'--rendercv-settings-path', rendercv_settings_file_path
"--design-path",
design_settings_file_path,
"--rendercv-settings-path",
rendercv_settings_file_path,
],
)
@@ -995,6 +997,4 @@ def test_seperation_of_settings(
with open(tex_file, "r") as f:
contents = f.read()
assert 'theme - sb2nov' in contents
assert "theme - sb2nov" in contents