-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (59 loc) · 1.66 KB
/
Copy pathMakefile
File metadata and controls
68 lines (59 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
.PHONY: install install-dev test coverage lint format clean help
help:
@echo "Weather CLI - Development Makefile"
@echo ""
@echo "Available targets:"
@echo " install Install production dependencies"
@echo " install-dev Install development dependencies"
@echo " test Run tests"
@echo " coverage Run tests with coverage report"
@echo " lint Run all linters"
@echo " format Format code with black and isort"
@echo " clean Remove build artifacts and cache files"
@echo " run Run the CLI (usage: make run CITY='London')"
@echo ""
install:
pip install -r requirements.txt
install-dev:
pip install -r requirements-dev.txt
test:
pytest
coverage:
pytest --cov=weather_cli --cov-report=html --cov-report=term
@echo "Coverage report generated in htmlcov/index.html"
lint:
@echo "Running Black..."
black --check weather_cli tests
@echo "Running isort..."
isort --check-only weather_cli tests
@echo "Running flake8..."
flake8 weather_cli tests
@echo "Running mypy..."
mypy weather_cli
@echo "All linters passed!"
format:
@echo "Formatting with Black..."
black weather_cli tests
@echo "Sorting imports with isort..."
isort weather_cli tests
@echo "Code formatted!"
clean:
@echo "Cleaning up..."
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
rm -rf .pytest_cache
rm -rf .coverage
rm -rf htmlcov/
rm -rf .mypy_cache
rm -rf .ruff_cache
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name '*.pyc' -delete
find . -type f -name '*.pyo' -delete
@echo "Clean complete!"
run:
@if [ -z "$(CITY)" ]; then \
echo "Usage: make run CITY='London'"; \
else \
python -m weather_cli.cli $(CITY); \
fi