forked from jeroenterheerdt/HAsmartirrigation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (65 loc) · 2.08 KB
/
Makefile
File metadata and controls
76 lines (65 loc) · 2.08 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
# Smart Irrigation Development Makefile
.PHONY: help setup test lint format clean install-dev test-knmi
# Default target
help:
@echo "Smart Irrigation Development Commands:"
@echo ""
@echo "Setup:"
@echo " setup - Create virtual environment and install dependencies"
@echo " install-dev - Install development dependencies (assumes venv exists)"
@echo ""
@echo "Testing:"
@echo " test - Run all tests"
@echo " test-knmi - Run KNMI integration test"
@echo ""
@echo "Code Quality:"
@echo " lint - Run linting (flake8)"
@echo " format - Format code (black + isort)"
@echo " type-check - Run type checking (mypy)"
@echo ""
@echo "Utilities:"
@echo " clean - Remove virtual environment and cache files"
# Setup virtual environment
setup:
python3 -m venv venv
./venv/bin/pip install --upgrade pip
./venv/bin/pip install -r requirements-dev.txt
@echo ""
@echo "✅ Setup complete! Activate with: source venv/bin/activate"
# Install development dependencies (assumes venv exists)
install-dev:
./venv/bin/pip install --upgrade pip
./venv/bin/pip install -r requirements-dev.txt
# Run all tests (exclude integration tests which have fixtures)
test:
./venv/bin/python -m pytest tests/ -v --ignore=tests/integration/
# Run KNMI integration test
test-knmi:
@if [ ! -f .env ]; then \
echo "❌ .env file not found. Copy .env.example to .env and add your API key"; \
exit 1; \
fi
./venv/bin/python tests/integration/test_knmi_integration.py
# Code formatting
format:
./venv/bin/black .
./venv/bin/isort .
@echo "✅ Code formatted"
# Linting
lint:
./venv/bin/flake8 custom_components/smart_irrigation/
@echo "✅ Linting complete"
# Type checking
type-check:
./venv/bin/mypy custom_components/smart_irrigation/ --ignore-missing-imports
@echo "✅ Type checking complete"
# Clean up
clean:
rm -rf venv/
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type d -name "*.egg-info" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
@echo "✅ Cleaned up"
# Run all quality checks
check: lint type-check
@echo "✅ All checks passed"