Skip to content

Latest commit

 

History

History
76 lines (54 loc) · 1.72 KB

File metadata and controls

76 lines (54 loc) · 1.72 KB

Development Guide

Prerequisites

  • Python 3.13+
  • uv - Fast Python package manager
  • Docker (for integration tests)

Setup

Start by also cloning dqlite-wire and dqlite-client.

# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Create virtual environment and install dependencies
uv venv --python 3.13
uv pip install -e "../python-dqlite-wire" -e "../python-dqlite-client" -e ".[dev]"

Development Tools

Tool Purpose Command
pytest Testing framework pytest
ruff Linter (replaces flake8, isort, etc.) ruff check
ruff format Code formatter (replaces black) ruff format
mypy Static type checker mypy src

Running Tests

# Run unit tests only
.venv/bin/pytest tests/ --ignore=tests/integration

# Run all tests (requires Docker cluster)
cd ../dqlite-test-cluster && docker compose up -d
.venv/bin/pytest tests/

Linting & Formatting

# Lint
.venv/bin/ruff check src tests

# Auto-fix lint issues
.venv/bin/ruff check --fix src tests

# Format
.venv/bin/ruff format src tests

Type Checking

.venv/bin/mypy src

Pre-commit Workflow

.venv/bin/ruff format src tests
.venv/bin/ruff check --fix src tests
.venv/bin/mypy src
.venv/bin/pytest tests/ --ignore=tests/integration

PEP 249 Compliance

This package implements the DB-API 2.0 specification (PEP 249):

  • apilevel = "2.0"
  • threadsafety = 1 (threads may share module, not connections)
  • paramstyle = "qmark" (question mark placeholders)