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.pycreates FreeOTP backups for the testsdocs/: 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:
Versioning¶
The project uses semantic versioning. The version is kept in two places, which the tests check to be in sync:
versioninpyproject.toml__version__infreeotp_export_reader.py
Releases¶
- Bump the version in both places.
- Add the release to
CHANGELOG.md, using a## [X.Y.Z] - YYYY-MM-DDheader. -
Commit, then tag the commit and push the tag:
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/.