Skip to content

Development

The project uses uv and just (installed into the venv as rust-just).

uv sync              # set up the venv
uv run just test     # run the tests
uv run just lint     # run the pre-commit hooks on all files
uv run just docs     # build the documentation into site/
uv run just --list   # show all tasks

Project layout

  • freeotp_export_reader.py: the whole tool, a single self-contained script with inline dependency metadata (PEP 723)
  • tests/: the test suite; tests/backup_builder.py creates FreeOTP backups for the tests
  • docs/: this documentation, built with Zensical
  • .github/workflows/: tests, documentation and release builds

The script must not depend on any other project file. The tests check this by copying it to an empty directory and running it there.

Pre-commit hooks

The hooks run with prek and include ruff for linting and formatting. To run them on every commit:

uv run prek install

Versioning

The project uses semantic versioning. The version is kept in two places, which the tests check to be in sync:

  • version in pyproject.toml
  • __version__ in freeotp_export_reader.py

Releases

  1. Bump the version in both places.
  2. Add the release to CHANGELOG.md, using a ## [X.Y.Z] - YYYY-MM-DD header.
  3. Commit, then tag the commit and push the tag:

    git tag vX.Y.Z
    git push origin vX.Y.Z
    

The release workflow then runs the tests and creates a GitHub release with:

  • the wheel and source distribution
  • the single script as freeotp_export_reader-X.Y.Z.py
  • standalone executables for Windows (x64), Linux (x64) and macOS (Apple Silicon), built with PyInstaller
  • the changelog entries of the release as description

uv run just dist builds the wheel, source distribution and an executable for the local platform into dist/.