-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (35 loc) · 1.66 KB
/
Copy pathMakefile
File metadata and controls
49 lines (35 loc) · 1.66 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
.PHONY: install dev test test-cov lint lint-fix run clean
VENV := .venv
PYTHON := $(VENV)/bin/python
PIP := $(VENV)/bin/pip
# ── setup ────────────────────────────────────────────────────────────
$(VENV):
python3 -m venv $(VENV)
$(PIP) install --upgrade pip --quiet
dev: $(VENV)
$(PIP) install -e ".[dev]" --quiet
@echo ""
@echo " Dev install done."
@echo " To use the 'snip' command directly:"
@echo " source $(VENV)/bin/activate"
@echo ""
@echo " Or just run without activating:"
@echo " make run"
install: $(VENV)
$(PIP) install . --quiet
# ── run ──────────────────────────────────────────────────────────────
run: $(VENV)
$(PYTHON) -m snip
# ── test ─────────────────────────────────────────────────────────────
test:
$(PYTHON) -m pytest tests/ -v
test-cov:
$(PYTHON) -m pytest tests/ -v --cov=snip --cov-report=term-missing
# ── misc ─────────────────────────────────────────────────────────────
lint:
$(PYTHON) -m ruff check snip/ tests/
lint-fix:
$(PYTHON) -m ruff check --fix snip/ tests/
clean:
rm -rf dist/ build/ *.egg-info .coverage htmlcov/ .pytest_cache/ $(VENV)
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true