-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (59 loc) · 1.56 KB
/
Copy pathMakefile
File metadata and controls
72 lines (59 loc) · 1.56 KB
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
.PHONY: install dev test lint format clean run-server run-web docker-build docker-up
# 安装依赖
install:
pip install -r requirements.txt
cd web && npm install
# 开发模式运行
dev:
make -j 2 run-server run-web
# 运行服务端
run-server:
python -m uvicorn gustobot.main:application --reload --host 0.0.0.0 --port 8000
# 运行Web端
run-web:
cd web && npm run dev
# 运行测试
test:
pytest tests/ -v
# 代码检查
lint:
flake8 gustobot --max-line-length=100
black --check gustobot
mypy gustobot
# 代码格式化
format:
black gustobot
cd web && npm run lint
# 清理
clean:
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
find . -type d -name ".pytest_cache" -exec rm -rf {} +
find . -type d -name ".mypy_cache" -exec rm -rf {} +
rm -rf dist/ build/ *.egg-info
# 初始化数据目录
init-data:
mkdir -p data/chroma
# Docker构建
docker-build:
docker-compose build
# Docker启动
docker-up:
docker-compose up -d
# Docker停止
docker-down:
docker-compose down
# 帮助
help:
@echo "GustoBot - 开发命令"
@echo ""
@echo "make install - 安装所有依赖"
@echo "make dev - 开发模式(同时运行服务端和Web端)"
@echo "make run-server - 运行服务端"
@echo "make run-web - 运行Web端"
@echo "make test - 运行测试"
@echo "make lint - 代码检查"
@echo "make format - 代码格式化"
@echo "make clean - 清理临时文件"
@echo "make docker-build - Docker构建"
@echo "make docker-up - Docker启动"