Spaces:
Paused
Paused
.PHONY: help venv install run test lint format clean setup-secrets check-creds deploy-k8s deploy-helm cleanup-k8s cleanup-helm | |
# Colors and formatting | |
BOLD := \033[1m | |
RED := \033[31m | |
GREEN := \033[32m | |
YELLOW := \033[33m | |
BLUE := \033[34m | |
MAGENTA := \033[35m | |
CYAN := \033[36m | |
RESET := \033[0m | |
PYTHON := python | |
PIP := pip | |
VENV := .venv | |
ACTIVATE := . $(VENV)/bin/activate | |
help: | |
"$(BOLD)π Yuga Planner$(RESET)\n" | |
"$(CYAN)ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ$(RESET)\n" | |
"\n" | |
"$(BOLD)π¦ Development Commands:$(RESET)\n" | |
" $(GREEN)venv$(RESET) π Create Python virtual environment\n" | |
" $(GREEN)install$(RESET) π Install all dependencies\n" | |
" $(GREEN)run$(RESET) π Run the Gradio app locally\n" | |
" $(GREEN)test$(RESET) π§ͺ Run tests with pytest\n" | |
"\n" | |
"$(BOLD)π§ Code Quality:$(RESET)\n" | |
" $(BLUE)lint$(RESET) β¨ Run pre-commit hooks (black, yaml, gitleaks)\n" | |
" $(BLUE)format$(RESET) π¨ Format code with black\n" | |
"\n" | |
"$(BOLD)π Credentials:$(RESET)\n" | |
" $(YELLOW)setup-secrets$(RESET) π Setup credential template\n" | |
" $(YELLOW)check-creds$(RESET) π Validate all credentials\n" | |
"\n" | |
"$(BOLD)βΈοΈ Deployment:$(RESET)\n" | |
" $(MAGENTA)deploy-k8s$(RESET) π Deploy to Kubernetes\n" | |
" $(MAGENTA)deploy-helm$(RESET) β Deploy using Helm\n" | |
"\n" | |
"$(BOLD)π§Ή Cleanup:$(RESET)\n" | |
" $(RED)cleanup-k8s$(RESET) ποΈ Remove Kubernetes deployment\n" | |
" $(RED)cleanup-helm$(RESET) ποΈ Remove Helm deployment\n" | |
" $(RED)clean$(RESET) π§½ Remove cache and virtual environment\n" | |
"\n" | |
"$(CYAN)ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ$(RESET)\n" | |
venv: | |
"$(GREEN)π Creating virtual environment...$(RESET)\n" | |
@$(PYTHON) -m venv $(VENV) | |
"$(GREEN)β Virtual environment created$(RESET)\n" | |
install: venv | |
"$(BLUE)π¦ Installing dependencies...$(RESET)\n" | |
@$(ACTIVATE); $(PIP) install --upgrade pip | |
@$(ACTIVATE); $(PIP) install -r requirements.txt | |
@$(ACTIVATE); $(PIP) install pre-commit black | |
"$(GREEN)β Dependencies installed$(RESET)\n" | |
run: | |
"$(CYAN)π Starting Yuga Planner...$(RESET)\n" | |
@$(ACTIVATE); $(PYTHON) src/app.py | |
test: | |
"$(YELLOW)π§ͺ Running tests...$(RESET)\n" | |
@$(ACTIVATE); pytest -v -s | |
lint: | |
"$(BLUE)β¨ Running code quality checks...$(RESET)\n" | |
@$(ACTIVATE); pre-commit run --all-files | |
format: | |
"$(MAGENTA)π¨ Formatting code...$(RESET)\n" | |
@$(ACTIVATE); black src tests | |
"$(GREEN)β Code formatted$(RESET)\n" | |
setup-secrets: | |
"$(YELLOW)π Setting up credential template...$(RESET)\n" | |
true | -n tests/secrets/nebius_secrets.py.template tests/secrets/cred.py |||
"$(GREEN)β Template created$(RESET)\n" | |
"$(CYAN)π‘ Edit tests/secrets/cred.py to add your API credentials$(RESET)\n" | |
check-creds: | |
"$(CYAN)π Validating credentials...$(RESET)\n" | |
@./scripts/load-credentials.sh | |
deploy-k8s: | |
@./scripts/deploy-k8s.sh | |
deploy-helm: | |
@./scripts/deploy-helm.sh | |
cleanup-k8s: | |
@./scripts/cleanup-k8s.sh | |
cleanup-helm: | |
@./scripts/cleanup-helm.sh | |
clean: | |
"$(RED)π§½ Cleaning up...$(RESET)\n" | |
-rf $(VENV) __pycache__ */__pycache__ .pytest_cache .mypy_cache .coverage .hypothesis | |
. -type f -name '*.pyc' -delete | |
2>/dev/null || true | . -type d -name '__pycache__' -exec rm -rf {} +|
"$(GREEN)β Cleanup complete$(RESET)\n" | |