1 Star 0 Fork 0

newlife / tortoise-orm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Makefile 2.00 KB
一键复制 编辑 原始数据 按行查看 历史
long2ice 提交于 2021-10-06 23:35 . Add black opts in pyproject.toml
checkfiles = tortoise/ examples/ tests/ conftest.py
py_warn = PYTHONDEVMODE=1
help:
@echo "Tortoise ORM development makefile"
@echo
@echo "usage: make <target>"
@echo "Targets:"
@echo " up Updates dev/test dependencies"
@echo " deps Ensure dev/test dependencies are installed"
@echo " check Checks that build is sane"
@echo " test Runs all tests"
@echo " docs Builds the documentation"
@echo " style Auto-formats the code"
up:
@poetry update
deps:
@poetry install -E asyncpg -E aiomysql -E asyncmy
check: deps build
ifneq ($(shell which black),)
black --check $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
endif
flake8 $(checkfiles)
mypy $(checkfiles)
#pylint -d C,W,R $(checkfiles)
bandit -r $(checkfiles)
twine check dist/*
lint: deps build
ifneq ($(shell which black),)
black --check $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
endif
flake8 $(checkfiles)
mypy $(checkfiles)
#pylint $(checkfiles)
bandit -r $(checkfiles)
twine check dist/*
test: deps
$(py_warn) TORTOISE_TEST_DB=sqlite://:memory: pytest
test_sqlite:
$(py_warn) TORTOISE_TEST_DB=sqlite://:memory: pytest --cov-report=
test_postgres:
python -V | grep PyPy || $(py_warn) TORTOISE_TEST_DB="postgres://postgres:$(TORTOISE_POSTGRES_PASS)@127.0.0.1:5432/test_\{\}" pytest --cov-append --cov-report=
test_mysql_myisam:
$(py_warn) TORTOISE_TEST_DB="mysql://root:$(TORTOISE_MYSQL_PASS)@127.0.0.1:3306/test_\{\}?storage_engine=MYISAM" pytest --cov-append --cov-report=
test_mysql:
$(py_warn) TORTOISE_TEST_DB="mysql://root:$(TORTOISE_MYSQL_PASS)@127.0.0.1:3306/test_\{\}" pytest --cov-append --cov-report=
_testall: test_sqlite test_postgres test_mysql_myisam test_mysql
testall: deps _testall
coverage report
ci: check testall
docs: deps
rm -fR ./build
sphinx-build -M html docs build
style: deps
isort -src $(checkfiles)
black $(checkfiles)
build: deps
rm -fR dist/
poetry build
publish: deps build
twine upload dist/*
Python
1
https://gitee.com/newlife/tortoise-orm.git
git@gitee.com:newlife/tortoise-orm.git
newlife
tortoise-orm
tortoise-orm
master

搜索帮助