diff --git a/MANIFEST.in b/MANIFEST.in index 89b33477..af407d24 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,7 @@ # Non Code related contents include LICENSE include README.rst +include pyproject.toml # Setup include setup.py diff --git a/Makefile b/Makefile index b6b31dca..6e206923 100644 --- a/Makefile +++ b/Makefile @@ -12,11 +12,18 @@ help: @echo " Install Sanic" @echo "docker-test" @echo " Run Sanic Unit Tests using Docker" + @echo "black" + @echo " Analyze and fix linting issues using Black" + @echo "fix-import" + @echo " Analyze and fix import order using isort" + @echo "beautify [sort_imports=1] [include_tests=1]" + @echo " Analyze and fix linting issue using black and optionally fix import sort using isort" @echo "" 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 @@ -32,3 +39,20 @@ install: docker-test: clean docker build -t sanic/test-image -f docker/Dockerfile . docker run -t sanic/test-image tox + +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) + isort -rc sanic +endif +endif + +black: + black --config ./pyproject.toml sanic tests + +fix-import: black + isort -rc sanic \ No newline at end of file