File size: 2,200 Bytes
719e71f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
.PHONY: help setup install run clean deploy status test

help:
	@echo "🎨 Colorspace Explorer - Available Commands:"
	@echo ""
	@echo "  make setup    - Set up virtual environment and install dependencies"
	@echo "  make install  - Install/update dependencies only"
	@echo "  make run      - Run the Streamlit app locally"
	@echo "  make clean    - Remove virtual environment and cache files"
	@echo "  make deploy   - Deploy to Hugging Face Spaces"
	@echo "  make status   - Check deployment status"
	@echo "  make test     - Run basic tests (if any)"
	@echo ""

setup:
	@echo "πŸ”§ Setting up environment..."
	@if [ ! -d "venv" ]; then \
		echo "Creating virtual environment..."; \
		python3 -m venv venv; \
	fi
	@echo "Installing dependencies..."
	@. venv/bin/activate && pip install --upgrade pip
	@. venv/bin/activate && pip install -r requirements.txt
	@echo "βœ… Setup complete!"
	@echo ""
	@echo "To run the app, use: make run"

install:
	@echo "πŸ“₯ Installing dependencies..."
	@if [ ! -d "venv" ]; then \
		echo "❌ Virtual environment not found. Run 'make setup' first."; \
		exit 1; \
	fi
	@. venv/bin/activate && pip install -r requirements.txt
	@echo "βœ… Dependencies installed"

run:
	@echo "πŸš€ Starting Streamlit app..."
	@if [ ! -d "venv" ]; then \
		echo "❌ Virtual environment not found. Run 'make setup' first."; \
		exit 1; \
	fi
	@. venv/bin/activate && streamlit run app.py

clean:
	@echo "🧹 Cleaning up..."
	@rm -rf venv
	@rm -rf __pycache__
	@rm -rf .streamlit
	@find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
	@find . -type f -name "*.pyc" -delete
	@echo "βœ… Cleanup complete"

deploy:
	@echo "πŸš€ Deploying to Hugging Face Spaces..."
	@if [ ! -f "deploy.sh" ]; then \
		echo "❌ deploy.sh not found. Creating it..."; \
		chmod +x deploy.sh; \
	fi
	@./deploy.sh

status:
	@echo "πŸ“Š Checking deployment status..."
	@if [ ! -f "check_status.sh" ]; then \
		echo "❌ check_status.sh not found."; \
		exit 1; \
	fi
	@./check_status.sh

test:
	@echo "πŸ§ͺ Running tests..."
	@if [ ! -d "venv" ]; then \
		echo "❌ Virtual environment not found. Run 'make setup' first."; \
		exit 1; \
	fi
	@. venv/bin/activate && python test_setup.py