-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (40 loc) · 1.37 KB
/
Copy pathMakefile
File metadata and controls
51 lines (40 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
.PHONY: help venv lock install lint format type test check clean
# Override with `make venv PYTHON=python3.14` if you have multiple
# interpreters installed; defaults to whichever python3 is on PATH.
# Project requires Python >= 3.13 (matches HA Core 2026.5 supported range).
PYTHON ?= python3
PY := .venv/bin/python
PIP := .venv/bin/pip
RUFF := .venv/bin/ruff
MYPY := .venv/bin/mypy
PYTEST := .venv/bin/pytest
help:
@echo "Available targets:"
@echo " venv - Create Python >=3.13 venv in .venv/ (override with PYTHON=...)"
@echo " lock - Re-generate requirements-dev.txt from .in (pip-compile)"
@echo " install - Install pinned, hash-verified dev dependencies"
@echo " lint - Run ruff linter"
@echo " format - Run ruff format"
@echo " type - Run mypy strict"
@echo " test - Run pytest"
@echo " check - lint + type + test"
@echo " clean - Remove .venv and caches"
venv:
$(PYTHON) -m venv .venv
$(PIP) install --upgrade pip pip-tools
lock:
$(PY) -m piptools compile --generate-hashes --output-file=requirements-dev.txt requirements-dev.in
install:
$(PIP) install --require-hashes -r requirements-dev.txt
lint:
$(RUFF) check .
format:
$(RUFF) format .
type:
$(MYPY)
test:
$(PYTEST)
check: lint type test
clean:
rm -rf .venv .pytest_cache .mypy_cache .ruff_cache __pycache__
find . -type d -name __pycache__ -prune -exec rm -rf {} +