-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (58 loc) · 1.47 KB
/
Copy pathMakefile
File metadata and controls
70 lines (58 loc) · 1.47 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
.PHONY: test test-entity test-all coverage install dev setup clean
# Python configuration
PYTHON := python3.12
UV := uv
# Project paths
SRC_DIR := src
TEST_DIR := tests
# Default target
.DEFAULT_GOAL := help
# Help command
help:
@echo "Homework Project Makefile"
@echo ""
@echo "Usage:"
@echo " make test Run all tests"
@echo " make coverage Run tests with coverage report"
@echo " make install Install project dependencies"
@echo " make dev Install development dependencies"
@echo " make clean Clean cache files"
@echo " make setup Setup development environment"
# Install project dependencies
install:
$(UV) pip install -e .
# Install development dependencies
dev:
$(UV) pip install -e ".[dev]"
# Setup development environment
setup: clean
$(UV) venv --python $(PYTHON)
make dev
# Run all tests
test:
$(UV) run -m pytest $(TEST_DIR)
# Run tests with coverage report
test-coverage:
$(UV) run -m pytest --cov=src/homework
# Run formatting and type checking
lint:
$(UV) run ruff format .
$(UV) run ruff check . --fix
$(UV) run mypy . --check-untyped-defs
# Clean cache files
clean:
rm -rf .pytest_cache
rm -rf .coverage
rm -rf __pycache__
rm -rf $(SRC_DIR)/__pycache__
rm -rf $(SRC_DIR)/**/__pycache__
rm -rf $(TEST_DIR)/__pycache__
rm -rf $(TEST_DIR)/.pytest_cache
rm -rf $(TEST_DIR)/**/__pycache__
rm -rf .mypy_cache
rm -rf $(SRC_DIR)/homework.egg-info
rm -rf dist
rm -rf .vscode
publish:
$(UV) build
$(UV) publish