Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand All @@ -33,7 +33,7 @@ jobs:
pre-commit install

- name: Cache pre-commit
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
Expand All @@ -49,7 +49,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand All @@ -74,7 +74,7 @@ jobs:
fetch-depth: 0 # Full history for git diff

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand All @@ -38,7 +38,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:
rev: v1.18.2
hooks:
- id: mypy
additional_dependencies: [types-markdown, types-pyyaml, flask, oyaml, weasyprint]
additional_dependencies: [types-markdown, types-pyyaml, flask, oyaml, weasyprint, "pydyf>=0.10.0,<0.12.0"]
args: [--strict, --config-file=pyproject.toml]
files: ^src/

Expand Down
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@

This file documents all notable project changes. Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.2.4] - 2026-02-15

### Fixed

- Pin `pydyf>=0.10.0,<0.12.0` to prevent WeasyPrint PDF rendering failures caused by incompatible pydyf releases
- `_infer_data_dir_and_name` now returns the grandparent directory when a YAML file resides inside an `input/` subdirectory, matching the expected `data_dir` layout (fixes #84)

### Changed

- Bump `actions/setup-python` from v4 to v5 across all CI workflows
- Bump `actions/cache` from v3 to v4 in pre-commit workflow
- Add `pydyf` version constraint to mypy additional dependencies in `.pre-commit-config.yaml`

## [0.2.3] - 2026-02-14

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ The workflow builds the package, generates a changelog from commit history, and

- `TemplateNotFound`: confirm installation includes packaged assets (bundled in wheels/editable installs); custom templates require `--templates-dir`.
- PDF on Linux: install system libs `cairo`, `pango`, `gdk-pixbuf` (WeasyPrint requirement).
- PDF rendering errors with WeasyPrint: `simple-resume` pins `pydyf>=0.10.0,<0.12.0` to avoid incompatible releases. If you override this constraint, PDF output may silently fail.

## Contributing

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ markers = [

[project]
name = "simple-resume"
version = "0.2.3"
version = "0.2.4"
description = "Generate PDF resumes from YAML data using HTML templates"
authors = [
{name = "Alex Thola", email = "alexthola@gmail.com"}
Expand All @@ -46,6 +46,7 @@ dependencies = [
"markdown>=3.7,<4.0",
"oyaml>=1.0,<2.0",
"weasyprint>=62.1,<63.0",
"pydyf>=0.10.0,<0.12.0",
"palettable>=3.3.3,<4.0",
"jinja2>=3.0,<4.0",
"scikit-learn>=1.5,<2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/simple_resume/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
)

# Version
__version__ = "0.2.3"
__version__ = "0.2.4"

# Public API exports - organized by functionality
__all__ = [
Expand Down
34 changes: 32 additions & 2 deletions src/simple_resume/shell/generate/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from __future__ import annotations

import time
import warnings
from collections.abc import Iterable, Sequence
from dataclasses import dataclass
from pathlib import Path
Expand Down Expand Up @@ -526,11 +527,37 @@ def _infer_data_dir_and_name(
source: str | Path,
data_dir: str | Path | None,
) -> tuple[Path, str | None]:
"""Infer a data directory and optional resume name from user-friendly inputs."""
"""Infer a data directory and optional resume name from user-friendly inputs.

When *data_dir* is ``None``, the directory is inferred from *source*:
- Directory source → the directory itself (name is ``None``).
- YAML file inside an ``input/`` directory → the **grandparent** directory,
because downstream path resolution appends ``/input`` automatically.
- YAML file elsewhere → the parent directory.

When *data_dir* is provided explicitly, it is used as-is (with a warning if
its basename is ``"input"``). Directory sources still return themselves.

Returns:
A ``(data_dir, resume_name)`` tuple. *resume_name* is ``None`` for
directory sources.

Raises:
ValueError: If *source* does not exist on disk and no *data_dir* is given.

"""
source_path = Path(source)

if data_dir is not None:
base_dir = Path(data_dir)
if base_dir.name == "input":
warnings.warn(
f"data_dir '{base_dir}' ends in 'input/'. Downstream path "
"resolution appends '/input' automatically, which may cause "
"path doubling. Consider passing the parent directory instead.",
UserWarning,
stacklevel=2,
)
if source_path.exists() and source_path.is_dir():
return source_path, None
if source_path.suffix.lower() in _YAML_SUFFIXES:
Expand All @@ -541,7 +568,10 @@ def _infer_data_dir_and_name(
if source_path.is_dir():
return source_path, None
if source_path.suffix.lower() in _YAML_SUFFIXES:
return source_path.parent, source_path.stem
parent = source_path.parent
if parent.name == "input":
return parent.parent, source_path.stem
return parent, source_path.stem

raise ValueError(
"Unable to infer data_dir from source. Provide a YAML path, directory, "
Expand Down
Loading
Loading