Skip to content

Development

Setup

uv sync --dev
pre-commit install

The environment includes Ruff, mypy, pytest with coverage, and MkDocs Material. Do not install DeepFace or TensorFlow separately.

Checks

Run the same checks as CI before pushing:

uv run ruff check .
uv run ruff format --check .
uv run mypy src
uv run pytest -q
uv run doppelsort --help
uv build

Ruff targets Python 3.12 with a 120-character line length. Pytest enforces a minimum of 85% total coverage for doppelsort; the suite is split by concern into test_db.py, test_matching.py, test_scan.py, test_evaluation.py, and test_cli.py, with shared builders in tests/support.py.

Tests may import public helpers from doppelsort.cli, but monkeypatch DeepFace through doppelsort.embeddings so module-level lookups in indexing.py and matching.py see the patch.

Documentation

Preview the site locally:

uv run mkdocs serve

Build it exactly as CI does, treating warnings as errors:

uv run mkdocs build --strict

Documentation sources live in docs/, with navigation and theme settings in mkdocs.yml. Update the relevant page when CLI options, defaults, output, or schema behavior change. Release Please generates CHANGELOG.md from Conventional Commit PR titles, so do not hand-edit release sections.

Publishing docs

The Docs GitHub Actions workflow builds the site and deploys it to GitHub Pages on every push to main. It enables Pages with GitHub Actions as the source on its first run. If organization policy blocks that, set Pages > Build and deployment > Source to GitHub Actions manually. The published site is https://isaiah1112.github.io/DoppelSort/.

Branches and releases

Make changes on short-lived branches and merge into main through pull requests after the GitHub Actions checks pass. Dependency changes should update both pyproject.toml and uv.lock; CI verifies the lockfile is current. Configure a repository ruleset for main to require pull requests and the Test (Python 3.12, Ubuntu) status check, and to block force pushes and branch deletion.

Releases are automated with Release Please. Use Conventional Commit PR titles and squash merges; the Conventional PR title check rejects titles outside the configured types. Dependabot PRs labeled dependencies are exempt from the title check.

The release flow is:

  1. A feat:, fix:, perf:, or deps: change lands on main.
  2. Release Please opens or updates a chore(main): release X.Y.Z PR that bumps pyproject.toml, uv.lock, .release-please-manifest.json, and CHANGELOG.md.
  3. CI runs on the release PR. Merge it once checks pass.
  4. Release Please creates tag vX.Y.Z and the GitHub Release using the changelog sections in release-please-config.json.
  5. The same workflow builds the sdist and wheel, then attaches them to the release.

Below 1.0, bump-minor-pre-major and bump-patch-for-minor-pre-major are enabled: a breaking change bumps the minor version, and a feature bumps the patch version. Do not create release tags or edit the version by hand.

By default Release Please uses GITHUB_TOKEN, so its release PR does not trigger other workflows. To run normal CI on release PRs, create a fine-grained personal access token with Contents and Pull requests write access and store it as the RELEASE_PLEASE_TOKEN repository secret. Without the secret, main still runs CI after the release PR merges.