Skip to content

Commit d2478d6

Browse files
committed
chore(dev): add local tooling
Keep setup, formatting, checks, and lockfile management on a small predictable surface.
1 parent 0763bb4 commit d2478d6

5 files changed

Lines changed: 632 additions & 0 deletions

File tree

.gitignore

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*.pyo
5+
*.pyd
6+
*.so
7+
8+
# Virtual environments
9+
.venv/
10+
venv/
11+
12+
# Packaging
13+
build/
14+
dist/
15+
*.egg-info/
16+
17+
# Test and coverage
18+
.pytest_cache/
19+
.coverage
20+
.coverage.*
21+
htmlcov/
22+
23+
# Type checking and lint caches
24+
.pyright/
25+
.ruff_cache/
26+
.mypy_cache/
27+
28+
# Editors and OS
29+
.vscode/
30+
.idea/
31+
.DS_Store
32+
33+
# AI assistant local state
34+
.claude/
35+
.claude.json
36+
.claude.json.backup*
37+
CLAUDE.local.md
38+
.codex/.codex-global-state.json
39+
.codex/.omx/
40+
.codex/archived_sessions/
41+
.codex/history.jsonl
42+
.codex/log/
43+
.codex/logs_*.sqlite
44+
.codex/logs_*.sqlite-*
45+
.codex/session_index.jsonl
46+
.codex/sessions/
47+
.codex/shell_snapshots/
48+
.codex/sqlite/
49+
.codex/state_*.sqlite
50+
.codex/tmp/
51+
52+
# Local env
53+
.env
54+
.env.*
55+
!.env.example
56+
57+
# Project-local automation state
58+
.omx/

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: ruff-format
5+
name: ruff format
6+
entry: uv run ruff format
7+
language: system
8+
types: [python]
9+
- id: ruff-check
10+
name: ruff check
11+
entry: uv run ruff check --fix
12+
language: system
13+
types: [python]

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

Makefile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
PACKAGE ?= python_template
2+
SRC_DIRS := src tests
3+
4+
.PHONY: help setup setup-dev lock update format format-check lint lint-fix typecheck test test-cov check build clean
5+
6+
.DEFAULT_GOAL := help
7+
8+
help: ## Show available tasks
9+
@awk 'BEGIN {FS = ":.*##"; printf "\nAvailable tasks:\n\n"} /^[a-zA-Z0-9_.-]+:.*##/ {printf " %-20s %s\n", $$1, $$2} END {print ""}' $(MAKEFILE_LIST)
10+
11+
setup: ## Install the base project environment
12+
uv sync
13+
14+
setup-dev: ## Install developer dependencies
15+
uv sync --group dev
16+
17+
lock: ## Refresh uv.lock without upgrading pinned packages
18+
uv lock
19+
20+
update: ## Upgrade dependencies and refresh uv.lock
21+
uv lock --upgrade
22+
23+
format: ## Format the codebase with Ruff
24+
uv run ruff format $(SRC_DIRS)
25+
26+
format-check: ## Check formatting without modifying files
27+
uv run ruff format --check $(SRC_DIRS)
28+
29+
lint: ## Run Ruff lint checks
30+
uv run ruff check $(SRC_DIRS)
31+
32+
lint-fix: ## Run Ruff lint checks and apply safe fixes
33+
uv run ruff check --fix $(SRC_DIRS)
34+
35+
typecheck: ## Run Pyright type checking
36+
uv run pyright
37+
38+
test: ## Run tests
39+
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run pytest
40+
41+
test-cov: ## Run tests with coverage
42+
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run pytest --cov=$(PACKAGE) --cov-report=term-missing
43+
44+
check: format-check lint typecheck test ## Run the full local quality gate
45+
46+
build: ## Build wheel and sdist artifacts
47+
uv build
48+
49+
clean: ## Remove local build and tool caches
50+
rm -rf .venv .pytest_cache .pyright .ruff_cache .mypy_cache build dist htmlcov .coverage .coverage.*
51+
find . -type d -name '__pycache__' -prune -exec rm -rf {} +

0 commit comments

Comments
 (0)