test / Makefile
fongci's picture
Update application
984fc95
raw
history blame contribute delete
880 Bytes
.PHONY: help install dev run clean test deploy
help: ## 顯示可用指令
@echo "可用指令:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-12s\033[0m %s\n", $1, $2}'
install: ## 安裝生產依賴
uv add fastapi
uv add "uvicorn[standard]"
dev: ## 安裝開發依賴
uv add --dev huggingface_hub
setup: install dev ## 完整環境設置
uv export --no-dev > requirements.txt
run: ## 本地運行開發伺服器
uvicorn app:app --reload --host 0.0.0.0 --port 8000
clean: ## 清理快取檔案
find . -type d -name __pycache__ -delete
find . -type f -name "*.pyc" -delete
hf-login: ## 登入 Hugging Face
huggingface-cli login
deploy: ## 部署到 Hugging Face Spaces
git add .
git commit -m "Update application"
git push
req: ## 更新 requirements.txt
uv export --no-dev > requirements.txt