-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
93 lines (76 loc) · 2.3 KB
/
Makefile
File metadata and controls
93 lines (76 loc) · 2.3 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
.PHONY: help install dev lint format test test-cov test-fast clean build publish run
# Default target
help:
@echo "Available commands:"
@echo " make install - Install dependencies"
@echo " make dev - Install development dependencies"
@echo " make lint - Run linter (ruff check)"
@echo " make format - Format code (ruff format)"
@echo " make test - Run all tests with coverage"
@echo " make test-fast - Run tests without coverage"
@echo " make test-cov - Run tests and open coverage report"
@echo " make clean - Remove build artifacts and cache"
@echo " make build - Build package"
@echo " make publish - Publish to PyPI (requires credentials)"
@echo " make run - Run the CLI (pass ARGS for arguments)"
# Install dependencies
install:
uv sync
# Install with dev dependencies
dev:
uv sync --all-extras
# Run linter
lint:
uv run ruff check src/ tests/
# Format code
format:
uv run ruff format src/ tests/
uv run ruff check --fix src/ tests/
# Run tests with coverage
test:
uv run pytest tests/ -v --tb=short
# Run tests without coverage (faster)
test-fast:
uv run pytest tests/ -v --tb=short --no-cov
# Run tests and open coverage report
test-cov:
uv run pytest tests/ -v --tb=short
@echo "Opening coverage report..."
@xdg-open htmlcov/index.html 2>/dev/null || open htmlcov/index.html 2>/dev/null || echo "Coverage report available at htmlcov/index.html"
# Clean build artifacts and cache
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info/
rm -rf src/*.egg-info/
rm -rf .pytest_cache/
rm -rf .ruff_cache/
rm -rf htmlcov/
rm -rf .coverage
rm -rf workdir/
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
# Build package
build: clean
uv build
# Publish to PyPI
publish: build
uv publish
# Run the CLI (use: make run ARGS="path/to/image.jpg")
run:
uv run lupin $(ARGS)
# Run CLI in quick mode
run-quick:
uv run lupin --quick $(ARGS)
# Type checking (if mypy is added)
typecheck:
uv run mypy src/
# Watch tests (requires pytest-watch)
watch:
uv run ptw tests/ -- -v --tb=short
# Generate requirements.txt from pyproject.toml
requirements:
uv pip compile pyproject.toml -o requirements.txt
# Check for outdated dependencies
outdated:
uv pip list --outdated