Contributing to {{ project_name }}

March 20, 2026 ยท View on GitHub

See the Scientific Python Developer Guide for a detailed description of best practices for developing scientific packages.

Prerequisites

Install uv:

curl -LsSf https://astral.sh/uv/install.sh | sh

Setup

git clone {{ url }}
cd {{ project_name }}
uv sync

This installs the package in editable mode along with all dev dependencies, and creates a uv.lock lockfile for reproducible installs.

Pre-commit

Pre-commit runs the following checks on each commit:

  • Code quality checks (trailing whitespace, merge conflicts, large files, etc.)
  • Linting and auto-fixing with ruff
  • Code formatting with ruff format

Install the pre-commit hooks so these run automatically on each commit:

uv run pre-commit install

You can also run them manually:

uv run pre-commit run --all-files

Testing

uv run pytest

With coverage:

uv run pytest --cov={{ python_name }}

Type checking

uv run ty check

Building

To verify the package builds correctly:

uv build

Adding dependencies

  • Runtime: uv add <package>
  • Dev: uv add --group dev <package>
  • Test: uv add --group test <package>
  • Lint: uv add --group lint <package>

About uv.lock

The uv.lock file is committed to the repository to ensure reproducible installs. CI uses uv sync --locked to verify the lockfile is up to date. If you change dependencies, run uv lock to update it.