Skip to content

Development Setup

Prerequisites

  • Python 3.10+
  • Git
  • Nix (optional but recommended)

Setup with Nix

git clone https://github.com/kartoza/healthsites-api-client.git
cd healthsites-api-client
nix develop

Setup with pip

git clone https://github.com/kartoza/healthsites-api-client.git
cd healthsites-api-client
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev,docs]"

Running Tests

# With Nix
nix run .#test

# With pytest
pytest tests/ -v

Linting and Formatting

# Format code
nix run .#format
# or
black healthsites/ tests/
ruff check --fix healthsites/ tests/

# Run linters
nix run .#lint
# or
ruff check healthsites/ tests/
mypy healthsites/

Building Documentation

# Build
nix run .#docs
# or
mkdocs build

# Serve locally
nix run .#docs-serve
# or
mkdocs serve

Pre-commit Hooks

pre-commit install
pre-commit run --all-files

Made with love by Kartoza | Donate! | GitHub