Skip to content

pull changes#1

Open
tomh4 wants to merge 244 commits intoHMT-Engineering:mainfrom
rendercv:main
Open

pull changes#1
tomh4 wants to merge 244 commits intoHMT-Engineering:mainfrom
rendercv:main

Conversation

@tomh4
Copy link
Copy Markdown

@tomh4 tomh4 commented Dec 4, 2025

No description provided.

theobori and others added 30 commits October 22, 2025 23:38
Co-authored-by: Jakob Stender Guldberg <jakob1379gmail.com>
Co-authored-by: Jakob Stender Guldberg <jakob1379gmail.com>
Bumps [phonenumbers](https://github.com/daviddrysdale/python-phonenumbers) from 9.0.13 to 9.0.16.
- [Commits](daviddrysdale/python-phonenumbers@v9.0.13...v9.0.16)

---
updated-dependencies:
- dependency-name: phonenumbers
  dependency-version: 9.0.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [pydantic-extra-types](https://github.com/pydantic/pydantic-extra-types) from 2.10.2 to 2.10.6.
- [Release notes](https://github.com/pydantic/pydantic-extra-types/releases)
- [Changelog](https://github.com/pydantic/pydantic-extra-types/blob/main/HISTORY.md)
- [Commits](pydantic/pydantic-extra-types@v2.10.2...v2.10.6)

---
updated-dependencies:
- dependency-name: pydantic-extra-types
  dependency-version: 2.10.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [email-validator](https://github.com/JoshData/python-email-validator) from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/JoshData/python-email-validator/releases)
- [Changelog](https://github.com/JoshData/python-email-validator/blob/main/CHANGELOG.md)
- [Commits](JoshData/python-email-validator@v2.2.0...v2.3.0)

---
updated-dependencies:
- dependency-name: email-validator
  dependency-version: 2.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sina Atalay <79940989+sinaatalay@users.noreply.github.com>
Bumps [packaging](https://github.com/pypa/packaging) from 24.2 to 25.0.
- [Release notes](https://github.com/pypa/packaging/releases)
- [Changelog](https://github.com/pypa/packaging/blob/main/CHANGELOG.rst)
- [Commits](pypa/packaging@24.2...25.0)

---
updated-dependencies:
- dependency-name: packaging
  dependency-version: '25.0'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Add IMDB social network to CV model

* Add IMDB to schema.json with other social networks

* Add tests for IMDB social Network
Co-authored-by: Sina Atalay <79940989+sinaatalay@users.noreply.github.com>
* fix test case test_main_file

* Enhance Typst source preprocessing to eliminate unwanted spacing caused by inline formatting

* make changes to pass hatch run default:format

* remove most warnings from pytest

* fix the all warnings

* fix ruff

* remove noqa comments

* remove duplicate line of code

* run ruff format

* add read_a_yaml_file_with_coordinates function to read YAML files with location info

* refactor: add type annotations to field_info variables for clarity

* run ruff format

* update schema
Co-authored-by: Sina Atalay <79940989+sinaatalay@users.noreply.github.com>
* Fix sorting stability and add tie-break tests

* update schema

* formatting

* fix error with import

* fix failing test case
* use YAML key order to determine header order

* update schema

* fix mistake with merge
* add grade field to education entry

* remove optional and use "| None"

* remove optional and use "| None"

* update schema
* Update pyproject.toml

* Create justfile

* Move `rendercv` to `src/rendercv`

* Polish pyproject.toml

* Update workflows

* Remove issue templates (no need)

* Fix mistakes in workflows

* Improve workflows

* Remove devcontainer

* Use uv

* Minor update

* Use .yaml instead of .yml

* Update test.yaml triggers

* Use --all-groups in uv sync

* Make theme options compatible with pydantic 3.12.*

* Fix coverage issue
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 6 to 7.
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](astral-sh/setup-uv@v6...v7)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v5...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jakob Stender Guldberg <jakob1379gmail.com>
* ci: did a roleback and reimplemented changes

* chore: added coverage for debugging

* disable xdist

* minor fix

* degging with tolerance

* updated test data

* reverted test

* chore: lint

* test cli in seriel

* we never dispatched xdist as loadgroup

* forced groups and extras

* ci: more typo fixing

* run grouped by file

* test: added pytest-rerunfailures for flaky tests

* test: removed mark as the we use file based distribution

---------

Co-authored-by: Jakob Guldberg Aaes <jakob1379@gmali.com>
The field receives raw YAML data from commented_map.get() which can
be anything the user provides, not just Date | str | None. The
get_current_date function already handles arbitrary input defensively
with isinstance checks and falls back to Date.today().
Only built when WhatsApp validation actually runs, avoiding
module-level initialization overhead for all other social networks.
Replace the file handle pattern with pathlib's read_text and
tomllib.loads for cleaner TOML parsing.
dict[str, str | str] was redundant since str | str simplifies to str.
Dead code that was commented out. Can be restored from git history
if needed in the future.
- json_schema_generator: generate() now has CoreSchema, JsonSchemaMode,
  and JsonSchemaValue annotations
- yaml_reader: fetch_alias() now returns None
- sample_generator: str_representer() now has Representer and ScalarNode
  annotations
The same regex-based YAML line processing appeared in both
create_sample_yaml_input_file and create_sample_yaml_file.
Extracted into expand_nested_bullets() to eliminate duplication.
The YAML string manipulation that comments out design and locale
sub-fields was inline and duplicated. Extracted into a named helper
with clear docstring explaining the splitting/commenting/reassembling
strategy. Uses str.partition() instead of str.split() for safer
two-way splitting.
urlretrieve is semi-deprecated. Use urlopen with explicit write,
matching the pattern already used in app.py. Also narrows the
except clause from bare Exception to (URLError, OSError).
Set yaml.Scanner on the YAML instance instead of overwriting
ruamel.yaml.scanner.RoundTripScanner globally. This avoids
affecting other code that imports ruamel.yaml and is resilient
to library version changes.
The underscore-prefixed name violated the project convention of no
private API syntax. Renamed to override_hint which better describes
its purpose (showing override syntax in --help output).
Replace except Exception with specific exception types: OSError
(covers URLError and network issues), json.JSONDecodeError,
KeyError, and ValueError. The function still returns None on
any expected failure, but won't silently swallow programming
errors like TypeError or AttributeError.
Extract three modules from classic_theme.py (845 lines) to improve
navigability:

- templates.py: entry template option models and Templates class
- typography.py: Typography, FontFamily config, FontSize, SmallCaps, Bold
- header.py: Header, Connections, Links, PhoneNumberFormatType

classic_theme.py retains Page, Colors, Sections, Entries, and
ClassicTheme. All imports use absolute paths so the custom theme
generator (which copies classic_theme.py as text) continues to work.

Template entry option classes renamed from e.g. OneLineEntry to
OneLineEntryTemplate to avoid name collision with CV entry models.
Property-based tests verify invariants across random inputs, catching
edge cases that hand-picked parametrized tests miss. Covers 6 modules:

- string_processor: keyword bolding, placeholder substitution, URL cleaning
- markdown_parser: Typst escaping robustness, formatting preservation
- date: date parsing, placeholder generation, time span arithmetic
- override_dictionary: immutability, path traversal, error conditions
- path_resolver: name variant generation, OUTPUT_FOLDER resolution
- Pydantic validators: Typst dimensions, social network usernames

Bugs surfaced during development:
- clean_url only strips one trailing slash (double slash passes through)
- get_date_object crashes on year < 10 (single digit isoformat)
- YEAR_IN_TWO_DIGITS is 1 char for years < 10
1. clean_url: use rstrip("/") instead of single-slash strip. URLs
   with multiple trailing slashes (e.g., "example.com//") now clean
   fully. Also restores idempotency (clean(clean(x)) == clean(x)).

2. get_date_object: use Date(year, 1, 1) instead of
   Date.fromisoformat(f"{date}-01-01"). The fromisoformat call
   crashed on years < 1000 because it requires 4-digit year strings.

3. build_date_placeholders: use f"{year % 100:02d}" for
   YEAR_IN_TWO_DIGITS instead of str(year)[-2:]. The slice produced
   1-char output for single-digit years (e.g., year 9 gave "9"
   instead of "09").

Test ranges widened back to full datetime.date range now that the
source code handles all values correctly.
Move all 55 property-based tests from tests/test_hypothesis.py into
the existing test files for each module they test:

- test_string_processor.py: keyword bolding, placeholder, URL, pattern
- test_markdown_parser.py: Typst escaping, markdown-to-typst
- test_date.py: date parsing, placeholders, time spans
- test_override_dictionary.py: immutability, path traversal
- test_path_resolver.py: name variants, OUTPUT_FOLDER resolution
- test_classic_theme.py: Typst dimension validation
- test_social_network.py: username format validation

Reusable Hypothesis strategies live in tests/strategies.py. Added
pythonpath=["."] to pyproject.toml so tests can import the strategies
module.
Merge property-based tests into existing test classes per the project
testing rules: multiple tests for the same function belong in a
TestFunctionName class.

- TestEscapeTypstCharactersProperties merged into TestEscapeTypstCharacters
- TestMarkdownToTypstProperties merged into TestMarkdownToTypst
- TestBuildDatePlaceholdersProperties merged into TestBuildDatePlaceholders
- TestComputeTimeSpanStringProperties merged into TestComputeTimeSpanString
- TestGetDateObjectProperties renamed to TestGetDateObject
- TestApplyOverridesProperties merged into TestApplyOverridesToDictionary
- TestUpdateValueByLocationProperties merged into TestUpdateValueByLocation
- TestResolveOutputFolderPlaceholderProperties merged into TestResolveOutputFolderPlaceholder
- TestBuildNameVariantsProperties renamed to TestBuildNameVariants
- TestTypstDimensionProperties renamed to TestTypstDimension
- TestSocialNetworkUsernameProperties merged into TestSocialNetwork
…railing_parts

- process_highlights: bullet count matches input length, output starts with "- "
- process_authors: comma count is n-1, all authors appear in output
- clean_trailing_parts: allowed trailing chars preserved, never crashes
…ogic

- date_only_clears_start_and_end: providing date nullifies start/end
- start_only_implies_present: start without end defaults to "present"
- end_only_becomes_date: end without start treated as single date
- snake_case keys always replace underscores with spaces
- keys with spaces returned unchanged
- keys with uppercase letters returned unchanged
They were in the wrong file (test_classic_theme.py). Now they live
alongside the existing parametrized dimension tests.
Test that random valid DOI strings always produce the correct
https://doi.org/ URL. Removed the useless test_doi_clears_url that
was just re-verifying a static validator with random irrelevant input.
Removed tests that were running 100 random inputs through string
operations that can never fail regardless of input:
- process_highlights: fuzzing "- " + string prepend
- process_authors: fuzzing ", ".join()
- PublicationEntry DOI URL: fuzzing f"https://doi.org/{doi}"

These tests add execution time without any chance of finding bugs.
The \b word boundary anchor requires a word character (\w) on one side
and a non-word character on the other. Keywords ending with ":" or
starting with "+" have no word boundary at those positions, so \b
fails to match.

Fix: only add \b on the side of a keyword where the character is a
word character. For "Tech stack:", \b is added before "T" but not
after ":". For "C++", \b is added before "C" but not after "+".

Added a Hypothesis property test that catches this entire class of
bugs: any keyword surrounded by spaces in the input text must appear
bolded in the output.
… names

The regex in remove_not_provided_placeholders used a bare alternation
without word boundaries, so removing placeholder "AA" would also
destroy "AAA" in the same template. Fix: add \b word boundaries and
sort longest-first.

Also add Hypothesis tests for:
- remove_not_provided_placeholders: provided keys survive removal
- remove_connectors_of_missing_placeholders: connectors removed/preserved
- validate_arbitrary_date: pass-through for valid dates and custom text
- Mastodon URL: domain and username appear in generated URL
- Update hypothesis to latest version (>=6.151.9)
- Remove pythonpath pytest config (was only needed for tests.strategies)
- Consolidate classic_theme.py into single file with all design models
- Move Hypothesis strategies from strategies.py into their test files
- Add noqa: ARG001 to unused yaml_field_override CLI parameter
- Fix lint and type errors across the codebase
Some Unicode uppercase letters (e.g., mathematical bold 𝐀) have no
distinct lowercase form, so keyword.lower() == keyword. Filter these
out since the test requires a genuine case difference.
Python 3.14 changed ValueError messages for invalid dates.
Use broader match patterns that work across all versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.