Skip to content

chore: adopt bblocks-projects standards + enforce ty/ANN#160

Merged
jm-rivera merged 2 commits into
mainfrom
chore/adopt-bblocks-projects
Jun 15, 2026
Merged

chore: adopt bblocks-projects standards + enforce ty/ANN#160
jm-rivera merged 2 commits into
mainfrom
chore/adopt-bblocks-projects

Conversation

@jm-rivera

Copy link
Copy Markdown
Collaborator

Brings the repo to parity with the bblocks-projects copier template and makes it managed going forward (bblocks-projects update / doctor now work via .copier-answers.yml).

Tooling & config

  • .copier-answers.yml — repo is now a managed package-type project.
  • pre-commit modernized: ruff v0.15.12, hooks v6, added ty, codespell, actionlint, mdformat.
  • pyproject: bumped uv_build; added [tool.ty] config; ruff gained ERA/PERF/ANN + google pydocstyle; migrated pytest.ini[tool.pytest.ini_options]/[tool.coverage.*] (markers preserved).
  • CI: new ci.yml with a lint+type job (previously absent) and a lightweight macOS/Windows smoke job on top of the Linux version matrix. release.yml switched to PyPI OIDC trusted publishing (the pypi environment + publisher are configured).
  • Normalized markdown/JSON via the new formatters (mechanical churn).

Types — ty + ANN fully enforced (blocking)

  • Fixed ~150 src findings (79 ANN + 71 ty); ruff check . and ty check src/oda_data are both clean and now block in pre-commit + CI.
  • Latent bugs fixed along the way:
    • clean_data/channels.py regex \devlopment\bdevelopment (the \d digit-class typo never matched).
    • indicators/indicator.py dataclass default field(default=str) (the str class!) → "".
    • indicators/dac1/oecd.py flow_names[flow]flow_names[int(flow)].

Notes / follow-ups

  • indicators/dac1/oecd.py change and dac1/common.py::dac1_aid_flow_type_mapping() (suspected flow_type vs flowtype_code key bug, not fixed) are on 0%-coverage paths — worth a separate look.
  • Upstream: bblocks-projects' ci.yml.jinja uses codecov-action's old file: input; corrected to files: here.

All 515 tests pass.

Bring the repo to parity with the bblocks-projects copier template and make
it managed going forward.

Tooling/config:
- Add .copier-answers.yml (package type) so `bblocks-projects update`/`doctor` work
- Modernize .pre-commit-config.yaml: ruff v0.15.12, hooks v6, add ty/codespell/
  actionlint/mdformat
- pyproject: bump uv_build, add [tool.ty] config, ruff ERA/PERF/ANN + google
  pydocstyle, migrate pytest.ini -> [tool.pytest.ini_options]/[tool.coverage.*]
- CI: new ci.yml (lint+type+test jobs) + lightweight macOS/Windows smoke job;
  release.yml switched to PyPI OIDC trusted publishing
- Normalize markdown/JSON via new formatters

Types (ty + ANN now blocking, both clean):
- Add annotations and fix ~150 src findings (79 ANN + 71 ty)
- Fix latent bugs found along the way: channels.py regex (\d -> \b),
  indicator.py dataclass default (str -> ""), dac1/oecd.py int key lookup

All 515 tests pass; ruff/ty/pre-commit all green.
oda_data keeps test deps (pytest, pytest-cov, ...) in a separate 'test'
dependency-group, so 'uv sync --frozen' (dev only) left pytest uninstalled.
Add --group test to the test-running jobs.
@jm-rivera jm-rivera merged commit 2d4195d into main Jun 15, 2026
7 checks passed
@jm-rivera jm-rivera deleted the chore/adopt-bblocks-projects branch June 15, 2026 10:36
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