2018-12-24 13:43:45 +00:00
|
|
|
.PHONY: help test test-coverage install docker-test black fix-import beautify
|
2018-12-18 16:42:32 +00:00
|
|
|
|
|
|
|
.DEFAULT: help
|
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "Please use \`make <target>' where <target> is one of"
|
|
|
|
@echo "test"
|
|
|
|
@echo " Run Sanic Unit Tests"
|
|
|
|
@echo "test-coverage"
|
|
|
|
@echo " Run Sanic Unit Tests with Coverage"
|
|
|
|
@echo "install"
|
|
|
|
@echo " Install Sanic"
|
|
|
|
@echo "docker-test"
|
|
|
|
@echo " Run Sanic Unit Tests using Docker"
|
2018-12-24 12:10:49 +00:00
|
|
|
@echo "black"
|
2019-07-24 00:33:04 +01:00
|
|
|
@echo " Analyze and fix linting issues using Black"
|
2018-12-24 12:10:49 +00:00
|
|
|
@echo "fix-import"
|
|
|
|
@echo " Analyze and fix import order using isort"
|
|
|
|
@echo "beautify [sort_imports=1] [include_tests=1]"
|
2019-07-24 00:33:04 +01:00
|
|
|
@echo " Analyze and fix linting issue using black and optionally fix import sort using isort"
|
2018-12-18 16:42:32 +00:00
|
|
|
@echo ""
|
2019-07-13 08:22:41 +01:00
|
|
|
@echo "docs"
|
2019-07-24 00:33:04 +01:00
|
|
|
@echo " Generate Sanic documentation"
|
2019-07-13 08:22:41 +01:00
|
|
|
@echo ""
|
|
|
|
@echo "clean-docs"
|
2019-07-24 00:33:04 +01:00
|
|
|
@echo " Clean Sanic documentation"
|
2019-07-13 08:22:41 +01:00
|
|
|
@echo ""
|
2019-07-13 08:30:37 +01:00
|
|
|
@echo "docs-test"
|
|
|
|
@echo " Test Sanic Documentation for errors"
|
|
|
|
@echo ""
|
2019-07-24 00:33:04 +01:00
|
|
|
@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 ""
|
2019-07-13 08:22:41 +01:00
|
|
|
|
2018-12-18 16:42:32 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
find . ! -path "./.eggs/*" -name "*.pyc" -exec rm {} \;
|
|
|
|
find . ! -path "./.eggs/*" -name "*.pyo" -exec rm {} \;
|
2018-12-24 12:10:49 +00:00
|
|
|
find . ! -path "./.eggs/*" -name ".coverage" -exec rm {} \;
|
2018-12-18 16:42:32 +00:00
|
|
|
rm -rf build/* > /dev/null 2>&1
|
|
|
|
rm -rf dist/* > /dev/null 2>&1
|
|
|
|
|
|
|
|
test: clean
|
|
|
|
python setup.py test
|
|
|
|
|
|
|
|
test-coverage: clean
|
|
|
|
python setup.py test --pytest-args="--cov sanic --cov-report term --cov-append "
|
|
|
|
|
|
|
|
install:
|
|
|
|
python setup.py install
|
|
|
|
|
|
|
|
docker-test: clean
|
2018-01-24 13:16:45 +00:00
|
|
|
docker build -t sanic/test-image -f docker/Dockerfile .
|
2017-03-29 04:33:55 +01:00
|
|
|
docker run -t sanic/test-image tox
|
2018-12-24 12:10:49 +00:00
|
|
|
|
|
|
|
beautify: black
|
|
|
|
ifdef sort_imports
|
|
|
|
ifdef include_tests
|
|
|
|
$(warning It is suggested that you do not run sort import on tests)
|
|
|
|
isort -rc sanic tests
|
|
|
|
else
|
|
|
|
$(info Sorting Imports)
|
2019-04-23 22:44:42 +01:00
|
|
|
isort -rc sanic tests
|
2018-12-24 12:10:49 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
black:
|
2019-04-23 22:44:42 +01:00
|
|
|
black --config ./.black.toml sanic tests
|
2018-12-24 12:10:49 +00:00
|
|
|
|
2021-01-29 14:19:10 +00:00
|
|
|
isort:
|
2020-07-07 14:13:03 +01:00
|
|
|
isort sanic tests
|
2019-07-13 08:22:41 +01:00
|
|
|
|
2021-01-29 14:19:10 +00:00
|
|
|
pretty: black isort
|
2019-07-13 08:22:41 +01:00
|
|
|
|
|
|
|
docs-clean:
|
|
|
|
cd docs && make clean
|
|
|
|
|
|
|
|
docs: docs-clean
|
|
|
|
cd docs && make html
|
2019-07-13 08:30:37 +01:00
|
|
|
|
|
|
|
docs-test: docs-clean
|
|
|
|
cd docs && make dummy
|
2019-07-24 00:33:04 +01:00
|
|
|
|
2021-01-18 11:21:37 +00:00
|
|
|
docs-serve:
|
|
|
|
# python -m http.server --directory=./docs/_build/html 9999
|
|
|
|
sphinx-autobuild docs docs/_build/html --port 9999 --watch ./sanic
|
|
|
|
|
2019-07-24 00:33:04 +01:00
|
|
|
changelog:
|
|
|
|
python scripts/changelog.py
|
|
|
|
|
2019-07-24 00:42:18 +01:00
|
|
|
release:
|
2019-07-24 00:33:04 +01:00
|
|
|
ifdef version
|
2019-07-24 00:42:18 +01:00
|
|
|
python scripts/release.py --release-version ${version} --generate-changelog
|
2019-07-24 00:33:04 +01:00
|
|
|
else
|
2019-07-24 00:42:18 +01:00
|
|
|
python scripts/release.py --generate-changelog
|
2019-07-24 00:33:04 +01:00
|
|
|
endif
|
2019-07-24 00:42:18 +01:00
|
|
|
|