Skip to content

Commit

Permalink
sort imports and format code
Browse files Browse the repository at this point in the history
  • Loading branch information
sinaatalay committed Jul 5, 2024
1 parent 81eb810 commit 1fc7b3a
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/update_entry_figures.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def generate_entry_figures():
)

# Convert pdf to an image
png_file_path = renderer.render_a_markdown_file(output_pdf_file_path)[0]
png_file_path = renderer.render_pngs_from_pdf(output_pdf_file_path)[0]
desired_png_file_path = output_pdf_file_path.with_suffix(".png")

# If the image exists, remove it
Expand Down
2 changes: 1 addition & 1 deletion rendercv/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def cli_command_render(
input_file_name: Annotated[
str, typer.Argument(help="Name of the YAML input file.")
],
extra_data_model_override_argumets: typer.Context,
use_local_latex_command: Annotated[
Optional[str],
typer.Option(
Expand Down Expand Up @@ -133,6 +132,7 @@ def cli_command_render(
' [cyan bold]--cv.phone "123-456-7890"[/cyan bold].',
),
] = None,
extra_data_model_override_argumets: typer.Context = None, # type: ignore
):
"""Render a CV from a YAML input file."""
printer.welcome()
Expand Down
8 changes: 4 additions & 4 deletions rendercv/cli/printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
import pydantic
import rich
import rich.live
import rich.panel
import rich.progress
import rich.table
import rich.text
import ruamel.yaml
import ruamel.yaml.parser
import typer
from rich import print
import rich.table
import rich.progress
import rich.text
import rich.panel

from .. import __version__
from . import utilities
Expand Down
4 changes: 2 additions & 2 deletions rendercv/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
OneLineEntry,
PublicationEntry,
RenderCVDataModel,
SectionContents,
SocialNetwork,
available_entry_type_names,
available_social_networks,
available_theme_options,
available_themes,
format_date,
SectionContents,
available_entry_type_names,
)
from .reader import read_input_file

Expand Down
2 changes: 1 addition & 1 deletion rendercv/data/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
from .computers import format_date
from .curriculum_vitae import (
CurriculumVitae,
SectionContents,
SocialNetwork,
available_social_networks,
SectionContents,
)
from .design import available_theme_options, available_themes
from .entry_types import (
Expand Down
1 change: 1 addition & 0 deletions rendercv/data/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import pydantic


class RenderCVBaseModel(pydantic.BaseModel):
"""This class is the parent class of all the data models in RenderCV. It has only
one difference from the default `pydantic.BaseModel`: It raises an error if an
Expand Down
2 changes: 1 addition & 1 deletion rendercv/data/models/curriculum_vitae.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def get_entry_type_name_and_section_validator(
entry_type_name = entry.__class__.__name__
section_type = create_a_section_validator(entry.__class__)

return entry_type_name, section_type # type: ignore
return entry_type_name, section_type # type: ignore


def validate_a_section(
Expand Down
6 changes: 3 additions & 3 deletions rendercv/data/models/entry_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def validate_start_and_end_date_fields(

elif date != "present":
# Validate the date:
computers.get_date_object(date)
computers.get_date_object(date)

return date

Expand Down Expand Up @@ -243,7 +243,7 @@ class PublicationEntryBase(RenderCVBaseModel):
description="The journal or conference name.",
)

@pydantic.model_validator(mode="after") # type: ignore
@pydantic.model_validator(mode="after") # type: ignore
def ignore_url_if_doi_is_given(self) -> "PublicationEntryBase":
"""Check if DOI is provided and ignore the URL if it is provided."""
doi_is_provided = self.doi is not None
Expand Down Expand Up @@ -273,7 +273,7 @@ def clean_url(self) -> str:
url_is_provided = self.url is not None

if url_is_provided:
return computers.make_a_url_clean(self.url) # type: ignore
return computers.make_a_url_clean(self.url) # type: ignore
else:
return ""

Expand Down
1 change: 0 additions & 1 deletion rendercv/data/models/rendercv_data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import pydantic

from ...themes.classic import ClassicThemeOptions

from .base import RenderCVBaseModel
from .curriculum_vitae import CurriculumVitae
from .design import RenderCVDesign
Expand Down
2 changes: 1 addition & 1 deletion rendercv/renderer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
render_a_latex_file,
render_a_latex_file_and_copy_theme_files,
render_a_markdown_file,
render_an_html_from_markdown,
render_a_pdf_from_latex,
render_an_html_from_markdown,
render_pngs_from_pdf,
)

Expand Down
1 change: 1 addition & 0 deletions rendercv/renderer/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from typing import Optional

import fitz

import markdown

from .. import data
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import pypdf
import pytest

from rendercv.renderer import templater
from rendercv import data
from rendercv.renderer import templater

# RenderCV is being tested by comparing the output to reference files. Therefore,
# reference files should be updated when RenderCV is updated in a way that changes
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
import re
import shutil
import subprocess
import sys
import re
from datetime import date as Date

import pydantic
Expand Down
10 changes: 6 additions & 4 deletions tests/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

from rendercv import data as data
from rendercv.data import generator
from rendercv.data.models import computers
from rendercv.data.models import locale_catalog
from rendercv.data.models import curriculum_vitae
from rendercv.data.models import entry_types
from rendercv.data.models import (
computers,
curriculum_vitae,
entry_types,
locale_catalog,
)

from .conftest import update_testdata

Expand Down
3 changes: 1 addition & 2 deletions tests/test_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
import pytest
import time_machine

from rendercv import data
from rendercv import renderer
from rendercv import data, renderer
from rendercv.renderer import templater

folder_name_dictionary = {
Expand Down

0 comments on commit 1fc7b3a

Please sign in to comment.