diff --git a/rendercv/cli/commands.py b/rendercv/cli/commands.py index 4ae5798e..3862a4b9 100644 --- a/rendercv/cli/commands.py +++ b/rendercv/cli/commands.py @@ -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 ) diff --git a/rendercv/data/models/rendercv_data_model.py b/rendercv/data/models/rendercv_data_model.py index 5226dc84..ae673cad 100644 --- a/rendercv/data/models/rendercv_data_model.py +++ b/rendercv/data/models/rendercv_data_model.py @@ -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.", ) diff --git a/rendercv/data/models/rendercv_settings.py b/rendercv/data/models/rendercv_settings.py index 632f5f91..69c8145f 100644 --- a/rendercv/data/models/rendercv_settings.py +++ b/rendercv/data/models/rendercv_settings.py @@ -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." diff --git a/tests/test_cli.py b/tests/test_cli.py index 1bc76cd7..19d88fae 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -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