mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-24 20:47:54 +00:00
Add tox configuration
Tox manages test environments for all supported Python versions, as well as linting and formatting tools. On GitHub, the test and lint steps are kept as close as possible to the Makefile equivalents.
This commit is contained in:
26
Makefile
26
Makefile
@@ -1,27 +1,27 @@
|
||||
checkfiles = fastapi_cache/ examples/ tests/
|
||||
py_warn = PYTHONDEVMODE=1
|
||||
|
||||
up:
|
||||
@poetry update
|
||||
|
||||
deps:
|
||||
@poetry install --no-root --with=linting -E all
|
||||
@poetry install --no-root --with=linting --all-extras
|
||||
|
||||
style: deps
|
||||
@isort -src $(checkfiles)
|
||||
@black $(checkfiles)
|
||||
format: deps
|
||||
@poetry run tox run -e format
|
||||
|
||||
check: deps
|
||||
@black $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
|
||||
@flake8 $(checkfiles)
|
||||
@mypy ${checkfiles}
|
||||
@pyright ${checkfiles}
|
||||
lint: deps
|
||||
@poetry run tox run -e lint
|
||||
|
||||
test: deps
|
||||
$(py_warn) pytest
|
||||
@poetry run tox
|
||||
|
||||
test-parallel: deps
|
||||
@poetry run tox run-parallel
|
||||
|
||||
build: clean deps
|
||||
@poetry build
|
||||
|
||||
clean:
|
||||
@rm -rf ./dist
|
||||
|
||||
# aliases
|
||||
check: lint
|
||||
style: format
|
||||
|
||||
Reference in New Issue
Block a user