-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (41 loc) · 1.48 KB
/
Copy pathMakefile
File metadata and controls
53 lines (41 loc) · 1.48 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
52
53
# Development helper — Linux / macOS only.
# Windows: run the individual commands in the venv manually.
VENV := .venv
BIN := $(VENV)/bin
SRC := src
TESTS := tests
.PHONY: install lint format format-check type-check security test check clean help
help:
@echo "Available targets:"
@echo " install Create venv and install all dev dependencies"
@echo " lint Run ruff + flake8"
@echo " format Auto-format with black"
@echo " format-check Check formatting without modifying files"
@echo " type-check Run mypy"
@echo " security Run bandit + pip-audit"
@echo " test Run pytest with coverage"
@echo " check Run all of the above (lint, format-check, type-check, security, test)"
@echo " clean Remove venv, build artefacts, and caches"
install:
python -m venv $(VENV)
$(BIN)/pip install --upgrade pip
$(BIN)/pip install -e ".[gui,dev]"
lint:
$(BIN)/ruff check $(SRC)/ $(TESTS)/
$(BIN)/flake8 $(SRC) $(TESTS)
format:
$(BIN)/black $(SRC) $(TESTS)
format-check:
$(BIN)/black --check $(SRC) $(TESTS)
type-check:
$(BIN)/mypy $(SRC)
security:
$(BIN)/bandit -r $(SRC)/ -ll -x $(SRC)/encrypt_bin/gui/resources
$(BIN)/pip-audit --skip-editable
test:
QT_QPA_PLATFORM=offscreen $(BIN)/pytest
check: lint format-check type-check security test
@echo "All checks passed."
clean:
rm -rf $(VENV) dist build __pycache__ .pytest_cache .mypy_cache .ruff_cache *.spec
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true