Bundle Font Awesome 6 fonts (#314)

* Bundle Font Awesome 6 fonts

* hope to skip less tests with font awesome fix

* update schema

* format

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

for more information, see https://pre-commit.ci

* fix

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

for more information, see https://pre-commit.ci

* fix

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Sina Atalay
2025-01-19 23:51:14 -05:00
committed by GitHub
parent 3ae30ba30d
commit 438ff8d13b
7 changed files with 34 additions and 68 deletions

View File

@@ -6,8 +6,3 @@ repos:
- id: ruff
# Run the formatter.
- id: ruff-format
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
hooks:
- id: black
language_version: python3.13

View File

@@ -59,7 +59,7 @@ dependencies = [
'Jinja2==3.1.5', # to generate Typst and Markdown files
'phonenumbers==8.13.52', # to validate phone numbers
'email-validator==2.2.0', # to validate email addresses
'pydantic==2.10.5', # to validate and parse the input file
'pydantic==2.10.5', # to validate and parse the input file
'pycountry==24.6.1', # for ISO 639-3 validation
'pydantic-extra-types==2.10.1', # to validate some extra types
]
@@ -84,7 +84,7 @@ full = [
"markdown==3.7", # to convert Markdown to HTML
"watchdog==6.0.0", # to poll files for updates
"typst==0.12.2", # to render PDF from Typst source files
"rendercv-fonts==0.2.0", # some font files for RenderCV
"rendercv-fonts==0.3.0", # some font files for RenderCV
"packaging==24.2", # to validate the version number
]
@@ -138,7 +138,7 @@ features = ["full"] # to install full optional dependencies
# Hatch allows us to define scripts that can be run in the activated virtual environment
# with `hatch run ENV_NAME:SCRIPT_NAME`.
# Format all the code in the `rendercv` package with `black`:
format = "ruff check --fix && ruff format && black rendercv docs tests" # hatch run format
format = "ruff check --fix && black rendercv docs tests && ruff format" # hatch run format
# Lint the code in the `rendercv` package with `ruff`:
lint = "ruff check" # hatch run lint
# Check types in the `rendercv` package with `pyright`:

View File

@@ -311,7 +311,7 @@ def cli_command_create_theme(
if based_on not in data.available_themes:
printer.error(
f'The theme "{based_on}" is not in the list of available themes:'
f' {", ".join(data.available_themes)}'
f" {', '.join(data.available_themes)}"
)
theme_folder = utilities.copy_templates(

View File

@@ -23,9 +23,6 @@
"const": "classic",
"default": "classic",
"description": "The theme of the CV. It just changes the default values.",
"enum": [
"classic"
],
"title": "Theme",
"type": "string"
},
@@ -316,9 +313,6 @@
"const": "engineeringclassic",
"default": "engineeringresumes",
"description": "The theme of the CV. It just changes the default values.",
"enum": [
"engineeringclassic"
],
"title": "Theme",
"type": "string"
},
@@ -466,9 +460,6 @@
"const": "engineeringresumes",
"default": "engineeringresumes",
"description": "The theme of the CV. It just changes the default values.",
"enum": [
"engineeringresumes"
],
"title": "Theme",
"type": "string"
},
@@ -785,9 +776,6 @@
"const": "moderncv",
"default": "moderncv",
"description": "The theme of the CV. It just changes the default values.",
"enum": [
"moderncv"
],
"title": "Theme",
"type": "string"
},
@@ -933,7 +921,7 @@
"description": "This class is the data model of the RenderCV settings.",
"properties": {
"date": {
"default": "2025-01-07",
"default": "2025-01-19",
"description": "The date that will be used everywhere (e.g., in the output file names, last updated date, computation of time spans for the events that are currently happening, etc.). The default value is the current date.",
"format": "date",
"title": "Date",
@@ -972,6 +960,7 @@
"title": "`design` Field's YAML File",
"oneOf": [
{
"format": "path",
"type": "string"
}
]
@@ -982,6 +971,7 @@
"title": "`rendercv_settings` Field's YAML File",
"oneOf": [
{
"format": "path",
"type": "string"
}
]
@@ -992,6 +982,7 @@
"title": "`locale` Field's YAML File",
"oneOf": [
{
"format": "path",
"type": "string"
}
]
@@ -1092,9 +1083,6 @@
"const": "sb2nov",
"default": "sb2nov",
"description": "The theme of the CV. It just changes the default values.",
"enum": [
"sb2nov"
],
"title": "Theme",
"type": "string"
},
@@ -1359,9 +1347,6 @@
"oneOf": [
{
"const": "present",
"enum": [
"present"
],
"type": "string"
},
{
@@ -1483,9 +1468,6 @@
"oneOf": [
{
"const": "present",
"enum": [
"present"
],
"type": "string"
},
{
@@ -1602,9 +1584,6 @@
"oneOf": [
{
"const": "present",
"enum": [
"present"
],
"type": "string"
},
{
@@ -4540,7 +4519,7 @@
"rendercv_settings": {
"$ref": "#/$defs/RenderCVSettings",
"default": {
"date": "2025-01-07",
"date": "2025-01-19",
"render_command": null,
"bold_keywords": []
},

View File

@@ -48,8 +48,8 @@ experience_entry_dictionary = {
"end_date": "2021-08-12",
"highlights": [
(
"Developed an [IOS application](https://example.com) that has received"
" more than **100,000 downloads**."
"Developed an [IOS application](https://example.com) that has received more"
" than **100,000 downloads**."
),
"Managed a team of **5** engineers.",
],
@@ -172,14 +172,14 @@ def return_a_value_for_a_field_type(
"end_date": "2020-06",
"date": "2021-09",
"summary": (
"Did *this* and this is a **bold** [link](https://example.com). But I"
" must explain to you how all this mistaken idea of denouncing pleasure"
" and praising pain was born and I will give you a complete account of"
" the system, and expound the actual teachings of the great explorer of"
" the truth, the master-builder of human happiness. No one rejects,"
" dislikes, or avoids pleasure itself, because it is pleasure, but"
" because those who do not know how to pursue pleasure rationally"
" encounter consequences that are extremely painful."
"Did *this* and this is a **bold** [link](https://example.com). But I must"
" explain to you how all this mistaken idea of denouncing pleasure and"
" praising pain was born and I will give you a complete account of the"
" system, and expound the actual teachings of the great explorer of the"
" truth, the master-builder of human happiness. No one rejects, dislikes,"
" or avoids pleasure itself, because it is pleasure, but because those who"
" do not know how to pursue pleasure rationally encounter consequences that"
" are extremely painful."
),
"highlights": [
(
@@ -229,14 +229,14 @@ def return_a_value_for_a_field_type(
pydantic.HttpUrl: "https://example.com",
pydantic_phone_numbers.PhoneNumber: "+905419999999",
str: (
"Did *this* and this is a **bold** [link](https://example.com). But I"
" must explain to you how all this mistaken idea of denouncing pleasure"
" and praising pain was born and I will give you a complete account of"
" the system, and expound the actual teachings of the great explorer of"
" the truth, the master-builder of human happiness. No one rejects,"
" dislikes, or avoids pleasure itself, because it is pleasure, but"
" because those who do not know how to pursue pleasure rationally"
" encounter consequences that are extremely painful."
"Did *this* and this is a **bold** [link](https://example.com). But I must"
" explain to you how all this mistaken idea of denouncing pleasure and"
" praising pain was born and I will give you a complete account of the"
" system, and expound the actual teachings of the great explorer of the"
" truth, the master-builder of human happiness. No one rejects, dislikes,"
" or avoids pleasure itself, because it is pleasure, but because those who"
" do not know how to pursue pleasure rationally encounter consequences that"
" are extremely painful."
),
list[str]: ["A string", "Another string"],
int: 1,
@@ -433,11 +433,6 @@ def are_these_two_files_the_same(file1: pathlib.Path, file2: pathlib.Path) -> bo
break
return result
if extension1 == ".png":
# fail if the relative difference is greater than 1%
return (
file1.stat().st_size - file2.stat().st_size
) / file1.stat().st_size < 0.01
return filecmp.cmp(file1, file2)

View File

@@ -135,11 +135,16 @@ def test_generate_json_schema_file(tmp_path):
assert isinstance(schema, dict)
@pytest.mark.skip(reason="This tests doesn't work on GitHub Actions!")
def test_if_the_schema_is_the_latest(root_directory_path):
original_schema_file_path = root_directory_path / "schema.json"
original_schema_text = original_schema_file_path.read_text()
original_schema = json.loads(original_schema_text)
original_schema["$defs"]["RenderCVSettings"]["properties"]["date"]["default"] = (
Date.today().isoformat()
)
original_schema["properties"]["rendercv_settings"]["default"]["date"] = (
Date.today().isoformat()
)
new_schema = data.generate_json_schema()

View File

@@ -2,7 +2,6 @@ import copy
import os
import pathlib
import shutil
import sys
import jinja2
import pytest
@@ -426,10 +425,7 @@ def test_create_a_typst_file_and_copy_theme_files(
"curriculum_vitae_data_model",
[
"rendercv_empty_curriculum_vitae_data_model",
pytest.param(
"rendercv_filled_curriculum_vitae_data_model",
marks=pytest.mark.skip(reason="This test doesn't work on GitHub Actions!"),
),
"rendercv_filled_curriculum_vitae_data_model",
],
)
def test_render_a_pdf_from_typst(
@@ -532,10 +528,6 @@ def test_render_html_from_markdown_nonexistent_markdown_file():
renderer.render_an_html_from_markdown(file_path)
@pytest.mark.skipif(
sys.platform == "darwin",
reason="This test doesn't work on GitHub Actions MacOS!",
)
def test_render_pngs_from_typst(
run_a_function_and_check_if_output_is_the_same_as_reference,
):