File size: 2,841 Bytes
c7e9899
7500864
c7e9899
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7500864
c7e9899
 
 
7500864
 
 
 
c7e9899
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Makefile for Template Matching Demo
.PHONY: help setup run deploy clean test format lint install status

# Default target
.DEFAULT_GOAL := help

# Colors
BLUE := \033[0;34m
GREEN := \033[0;32m
YELLOW := \033[1;33m
NC := \033[0m

help: ## Show this help message
	@echo "$(BLUE)Template Matching Demo - Available Commands$(NC)"
	@echo ""
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "  $(GREEN)%-15s$(NC) %s\n", $$1, $$2}'
	@echo ""

setup: ## Initial setup - install uv and dependencies
	@echo "$(BLUE)πŸ”§ Running setup...$(NC)"
	@chmod +x setup.sh
	@./setup.sh

install: ## Install/update dependencies using uv
	@echo "$(BLUE)πŸ“¦ Installing dependencies...$(NC)"
	@uv sync --no-build-isolation
	@echo "$(GREEN)βœ… Dependencies installed$(NC)"

run: ## Run the app locally
	@chmod +x run_local.sh
	@./run_local.sh

deploy: ## Deploy to GitHub & HuggingFace Spaces
	@chmod +x deploy.sh
	@./deploy.sh

status: ## Check repository sync status
	@chmod +x check_status.sh
	@./check_status.sh

clean: ## Clean up cache and temporary files
	@echo "$(BLUE)🧹 Cleaning up...$(NC)"
	@find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
	@find . -type f -name "*.pyc" -delete 2>/dev/null || true
	@find . -type f -name "*.pyo" -delete 2>/dev/null || true
	@find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
	@find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
	@echo "$(GREEN)βœ… Cleanup complete$(NC)"

format: ## Format code with black and isort (if installed)
	@echo "$(BLUE)🎨 Formatting code...$(NC)"
	@if command -v black > /dev/null; then \
		uv run black app.py; \
	else \
		echo "$(YELLOW)⚠️  black not installed, skipping$(NC)"; \
	fi

lint: ## Run linting checks
	@echo "$(BLUE)πŸ” Running linting...$(NC)"
	@if command -v ruff > /dev/null; then \
		uv run ruff check app.py; \
	else \
		echo "$(YELLOW)⚠️  ruff not installed, skipping$(NC)"; \
	fi

test: ## Run tests (if any)
	@echo "$(BLUE)πŸ§ͺ Running tests...$(NC)"
	@echo "$(YELLOW)⚠️  No tests configured yet$(NC)"

check: format lint ## Run all checks (format + lint)
	@echo "$(GREEN)βœ… All checks complete$(NC)"

update: ## Update all dependencies
	@echo "$(BLUE)⬆️  Updating dependencies...$(NC)"
	@uv sync --upgrade --no-build-isolation
	@echo "$(GREEN)βœ… Dependencies updated$(NC)"

info: ## Show project information
	@echo "$(BLUE)πŸ“Š Project Information$(NC)"
	@echo ""
	@echo "  Name:        Template Matching Demo"
	@echo "  Python:      $$(python3 --version | awk '{print $$2}')"
	@echo "  UV:          $$(uv --version 2>/dev/null || echo 'not installed')"
	@echo "  Repository:  https://github.com/amithjkamath/template-matching"
	@echo "  HF Space:    https://huggingface.co/spaces/amithjkamath/template-matching"
	@echo ""