Contributing to Model Ledger

May 20, 2026 ยท View on GitHub

Development Environment

Model Ledger uses uv for packaging and dependency management. To start developing with Model Ledger, install uv using the recommended method.

Once uv is installed, install the dependencies with the following command:

uv sync

It will create a .venv in the root of the project.

If you want to have a shell in the virtual environment you can activate it with (for Linux/MacOS):

. .venv/bin/activate

The package is linked in editable mode so you will not need to reinstall the package when changing something.

Alternatively you can run things in the virtual environment by using a uv run prefix for commands, e.g.:

uv run pytest

The following section commands assume you are in the virtual environment by either activating or prefixing commands with uv run!

Pre-Commit-Hooks

Pre commit hooks can be setup with:

pre-commit install

Tests

Run tests with the following command:

pytest --cov-report term-missing --cov=modl -vv

New code should ideally have tests and not break existing tests.

Type Checking

Model Ledger uses type annotations throughout, and ty to do the checking. Run the following to type check Model Ledger:

ty check

Code Formatting

Model Ledger uses ruff for code formatting. Since it is very fast it makes sense to setup your editor to format on save.

Use ruff format to format all files in the current directory

Versioning

  • This tool is using semantic versioning. CHANGELOG.md should be updated on every source code change.
  • A new version can be bumped with the support of bump-my-version, which is a dev dependency:
    # major,minor,patch
    bump-my-version bump minor