-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (39 loc) · 1.29 KB
/
Makefile
File metadata and controls
53 lines (39 loc) · 1.29 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
HOST="127.0.0.1"
PORT=8000
TEST_PATH=./
.PHONY: server debug default test flake8
default:
@echo "帮助:"
@echo "\tmake server [host] [port] 启动服务器"
@echo "\tmake debug [host] [port] 启动调试服务器"
@echo "\tmake test 运行单元测试"
@echo "\tmake coverage 运行coverage检查"
@echo "\tmake install 用poetry安装环境(注意是安装到虚拟python环境下)"
@echo "\tmake init_db 初始化数据库"
@echo "\tmake doc 启动mkdocs文档服务器"
@echo "\tmake build_doc 编译mkdocs文档"
@echo "\tmake build_image 编译docker image"
@echo "\tmake format_code 用black美化代码"
server:
poetry run uvicorn paperplane.main:app --host=$(HOST) --port=$(PORT) --log-level=info
debug:
poetry run uvicorn paperplane.main:app --host=$(HOST) --port=$(PORT) --reload --debug --log-level=debug
test:
PYTHONPATH=. poetry run pytest tests
coverage:
poetry run pytest --cov=app tests/
install:
poetry update
poetry install
update:
poetry update
init_db:
poetry run sh -c "PYTHONPATH=. python ./scripts/init_db.py"
doc:
poetry run mkdocs serve
build_doc:
poetry run mkdocs build
build_image:
poetry run docker build -t beehive3 .
format_code:
poetry run black .