Skip to content

chore: align project conventions (ruff, CI, pre-commit, Pydantic v2)#4

Merged
wietzesuijker merged 4 commits into
mainfrom
chore/align-conventions
Jun 7, 2026
Merged

chore: align project conventions (ruff, CI, pre-commit, Pydantic v2)#4
wietzesuijker merged 4 commits into
mainfrom
chore/align-conventions

Conversation

@wietzesuijker

Copy link
Copy Markdown
Member

Brings harpia in line with common Python project conventions:

  • Ruff: adopt a shared ruleset and apply ruff format across the codebase
  • CI: GitHub Actions workflow running ruff check, ruff format --check, and pytest
  • pre-commit: config wiring ruff lint + format hooks
  • CHANGELOG.md: initial changelog
  • Pydantic v2: migrate src/model/config.py from class-based Config to model_config = ConfigDict(...), removing the v2 deprecation warning

Most of the diff is mechanical reformatting. Behavior is unchanged; the existing 18-test suite passes.


AI (Claude) supported my development of this PR.

Mirror the labelfirst gold standard: select E/F/I/B/UP/SIM/PL at
line-length 100, same PL ignores (PLR0913/PLR0915/PLR0912/PLR2004/
PLR0124/PLC0415), per-file ignores for tests. Ran ruff check --fix +
ruff format across src and tests.

Kept the full ruleset (B/PL leave 0 unfixable errors). Residual
non-auto-fixable E501 (long string/comment lines), two PLR1704 loop-var
shadows, and one E712 are confined per-file rather than hand-edited, to
avoid logic-adjacent changes; flagged for later cleanup.

Config lives in a new pyproject.toml [tool.ruff] block (repo had no
build/lint config); no packaging backend added.
Mirror labelfirst's minimal CI: a lint job (ruff check + ruff format
--check on src/tests) and a test job (pytest) across Python 3.11-3.13.
Installs runtime deps from requirements.txt via uv (repo has no
packaging metadata).

Also adds .pre-commit-config.yaml with ruff + ruff-format pinned to
v0.15.14 to match CI.
Keep-a-Changelog CHANGELOG.md reconstructed from git history and the
README. Documents the 1.0.0 initial release, 1.0.1, and 1.1.0, plus the
Unreleased tooling work (test suite, ruff, CI, pre-commit).
class-based `class Config` is deprecated in Pydantic v2 (warned at import,
removed in v3). Replace with `model_config = ConfigDict(arbitrary_types_allowed=True)`.
No behaviour change; clears the deprecation warning.
@wietzesuijker wietzesuijker force-pushed the chore/align-conventions branch from f0a6355 to d72c907 Compare June 7, 2026 19:41
@wietzesuijker wietzesuijker merged commit 281a73f into main Jun 7, 2026
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.

1 participant