A simple Python package template with standard structure and best practices.
- Python 3.13+
- Standard src-layout package structure
- CLI interface with entry point
- uv for dependency management and builds
- Type checking with mypy
- Linting and formatting with Ruff
- Testing with pytest
uv sync --all-groupsThis installs the package in editable mode along with dev dependencies.
# Basic usage
mypackage 1 2
# Or as a module
python -m mypackage 1 2
# JSON output
mypackage 1 2 --format json
# With custom log level
mypackage 1 2 --log-level DEBUGTo update dependencies with a newer uv and verify everything still works:
# Refresh lockfile to latest compatible versions
uv lock --refresh
# Sync environment (include dev dependencies)
uv sync --all-groups --refresh
# Run quality checks
uv run pytest -q
uv run ruff format --check .
uv run ruff check .
uv run mypy src
uv run ty check srcIf uv.lock changes, commit it:
git add uv.lock
git commit -m "chore: refresh uv.lock with uv $(uv --version)"