forked from sanic-org/sanic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
97 lines (81 loc) · 2.09 KB
/
Makefile
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
RUFF_FORMATTED_FOLDERS = sanic examples scripts tests guide docs
.DEFAULT: help
.PHONY: help
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo "install"
@echo " Install Sanic"
@echo "docker-test"
@echo " Run Sanic Unit Tests using Docker"
@echo "fix"
@echo " Analyze and fix linting issues using ruff"
@echo "format"
@echo " Analyze and format using ruff"
@echo "pretty"
@echo " Analyze and fix linting and format using ruff"
@echo ""
@echo "docs"
@echo " Generate Sanic documentation"
@echo ""
@echo "clean-docs"
@echo " Clean Sanic documentation"
@echo ""
@echo "docs-test"
@echo " Test Sanic Documentation for errors"
@echo ""
@echo "changelog"
@echo " Generate changelog for Sanic to prepare for new release"
@echo ""
@echo "release"
@echo " Prepare Sanic for a new changes by version bump and changelog"
@echo ""
.PHONY: clean
clean:
find . ! -path "./.eggs/*" -name "*.pyc" -exec rm {} \;
find . ! -path "./.eggs/*" -name "*.pyo" -exec rm {} \;
find . ! -path "./.eggs/*" -name ".coverage" -exec rm {} \;
rm -rf build/* > /dev/null 2>&1
rm -rf dist/* > /dev/null 2>&1
.PHONY: view-coverage
view-coverage:
sanic ./coverage --simple
.PHONY: install
install:
python -m pip install .
.PHONY: docker-test
docker-test: clean
docker build -t sanic/test-image -f docker/Dockerfile .
docker run -t sanic/test-image tox
.PHONY: fix
fix:
ruff check ${RUFF_FORMATTED_FOLDERS} --fix
.PHONY: format
format:
ruff format ${RUFF_FORMATTED_FOLDERS}
.PHONY: pretty
pretty: format fix
.PHONY: docs-clean
docs-clean:
cd docs && make clean
.PHONY: docs
docs: docs-clean
cd docs && make html
.PHONY: docs-test
docs-test: docs-clean
cd docs && make dummy
.PHONY: docs-serve
docs-serve:
sphinx-autobuild docs docs/_build/html --port 9999 --watch ./
.PHONY: changelog
changelog:
python scripts/changelog.py
.PHONY: guide-serve
guide-serve:
cd guide && sanic server:app -r -R ./content -R ./style
.PHONY: release
release:
ifdef version
python scripts/release.py --release-version ${version} --generate-changelog
else
python scripts/release.py --generate-changelog
endif