Spaces:
Paused
Paused
File size: 4,028 Bytes
ae122c6 3b9a6b5 186edf4 3b9a6b5 186edf4 3b9a6b5 186edf4 3b9a6b5 186edf4 3b9a6b5 186edf4 3b9a6b5 186edf4 3b9a6b5 186edf4 3b9a6b5 186edf4 3b9a6b5 186edf4 3b9a6b5 ae122c6 186edf4 ae122c6 f870b34 186edf4 f870b34 ae122c6 186edf4 ae122c6 186edf4 ae122c6 186edf4 ae122c6 3b9a6b5 186edf4 |
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 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
.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:
@printf "$(BOLD)π Yuga Planner$(RESET)\n"
@printf "$(CYAN)ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ$(RESET)\n"
@printf "\n"
@printf "$(BOLD)π¦ Development Commands:$(RESET)\n"
@printf " $(GREEN)venv$(RESET) π Create Python virtual environment\n"
@printf " $(GREEN)install$(RESET) π Install all dependencies\n"
@printf " $(GREEN)run$(RESET) π Run the Gradio app locally\n"
@printf " $(GREEN)test$(RESET) π§ͺ Run tests with pytest\n"
@printf "\n"
@printf "$(BOLD)π§ Code Quality:$(RESET)\n"
@printf " $(BLUE)lint$(RESET) β¨ Run pre-commit hooks (black, yaml, gitleaks)\n"
@printf " $(BLUE)format$(RESET) π¨ Format code with black\n"
@printf "\n"
@printf "$(BOLD)π Credentials:$(RESET)\n"
@printf " $(YELLOW)setup-secrets$(RESET) π Setup credential template\n"
@printf " $(YELLOW)check-creds$(RESET) π Validate all credentials\n"
@printf "\n"
@printf "$(BOLD)βΈοΈ Deployment:$(RESET)\n"
@printf " $(MAGENTA)deploy-k8s$(RESET) π Deploy to Kubernetes\n"
@printf " $(MAGENTA)deploy-helm$(RESET) β Deploy using Helm\n"
@printf "\n"
@printf "$(BOLD)π§Ή Cleanup:$(RESET)\n"
@printf " $(RED)cleanup-k8s$(RESET) ποΈ Remove Kubernetes deployment\n"
@printf " $(RED)cleanup-helm$(RESET) ποΈ Remove Helm deployment\n"
@printf " $(RED)clean$(RESET) π§½ Remove cache and virtual environment\n"
@printf "\n"
@printf "$(CYAN)ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ$(RESET)\n"
venv:
@printf "$(GREEN)π Creating virtual environment...$(RESET)\n"
@$(PYTHON) -m venv $(VENV)
@printf "$(GREEN)β
Virtual environment created$(RESET)\n"
install: venv
@printf "$(BLUE)π¦ Installing dependencies...$(RESET)\n"
@$(ACTIVATE); $(PIP) install --upgrade pip
@$(ACTIVATE); $(PIP) install -r requirements.txt
@$(ACTIVATE); $(PIP) install pre-commit black
@printf "$(GREEN)β
Dependencies installed$(RESET)\n"
run:
@printf "$(CYAN)π Starting Yuga Planner...$(RESET)\n"
@$(ACTIVATE); $(PYTHON) src/app.py
test:
@printf "$(YELLOW)π§ͺ Running tests...$(RESET)\n"
@$(ACTIVATE); pytest -v -s
lint:
@printf "$(BLUE)β¨ Running code quality checks...$(RESET)\n"
@$(ACTIVATE); pre-commit run --all-files
format:
@printf "$(MAGENTA)π¨ Formatting code...$(RESET)\n"
@$(ACTIVATE); black src tests
@printf "$(GREEN)β
Code formatted$(RESET)\n"
setup-secrets:
@printf "$(YELLOW)π Setting up credential template...$(RESET)\n"
@cp -n tests/secrets/nebius_secrets.py.template tests/secrets/cred.py || true
@printf "$(GREEN)β
Template created$(RESET)\n"
@printf "$(CYAN)π‘ Edit tests/secrets/cred.py to add your API credentials$(RESET)\n"
check-creds:
@printf "$(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:
@printf "$(RED)π§½ Cleaning up...$(RESET)\n"
@rm -rf $(VENV) __pycache__ */__pycache__ .pytest_cache .mypy_cache .coverage .hypothesis
@find . -type f -name '*.pyc' -delete
@find . -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null || true
@printf "$(GREEN)β
Cleanup complete$(RESET)\n"
|