-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0bf703
commit 51ad88c
Showing
1 changed file
with
70 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,74 @@ | ||
.PHONY : run-checks | ||
run-checks : | ||
isort --check . | ||
black --check . | ||
ruff check . | ||
CUDA_VISIBLE_DEVICES='' pytest -v --color=yes --doctest-modules tests/ brazilcep/ | ||
.PHONY : help | ||
help: | ||
@echo "Usage: make <target>" | ||
@echo " check run pre-commit and tests" | ||
@echo " coverage identify code not covered with tests" | ||
@echo " lint run lint check on module" | ||
@echo " docs run documentation build process" | ||
@echo " help show summary of available commands" | ||
@echo " build build package distribution" | ||
@echo " pre-commit run pre-commit against all files" | ||
@echo " setup setup development environment" | ||
@echo " test run tests (in parallel)" | ||
@echo " tox run tox (in parallel)" | ||
|
||
.PHONY : check | ||
check: | ||
make pre-commit | ||
# make docs | ||
make test | ||
make build | ||
|
||
.PHONY : clean | ||
clean: | ||
find . -name *.mo -delete | ||
find . -name *.pyc -delete | ||
rm -rf .mypy_cache/* | ||
rm -rf .pytest_cache/* | ||
rm -rf .ruff_cache/* | ||
rm -rf dist/* | ||
rm -rf docs/build/* | ||
rm -rf docs/source/_autosummary/* | ||
rm -rf tox/* | ||
rm -rf .coverage | ||
rm -rf .coverage.xml | ||
|
||
.PHONY : build | ||
build : | ||
rm -rf *.egg-info/ | ||
python -m build | ||
python3 -m build | ||
|
||
.PHONY : coverage | ||
coverage: | ||
pytest --cov=. --cov-config=pyproject.toml --cov-report term-missing --no-cov-on-fail | ||
|
||
.PHONY : lint | ||
lint: | ||
isort --check . | ||
black --check brazilcep tests --exclude .tox | ||
ruff check . | ||
CUDA_VISIBLE_DEVICES='' pytest -v --color=yes --doctest-modules tests/ brazilcep/ | ||
|
||
.PHONY : docs | ||
docs: | ||
sphinx-build -E -T -W -b html -D language=en -j auto -q docs/source docs/build | ||
|
||
pre-commit: | ||
pre-commit run --all-files | ||
|
||
.PHONY : setup | ||
setup: | ||
pip install -e ".[dev]" | ||
pip install -e ".[coverage]" | ||
pip install -e ".[docs]" | ||
pip install -e ".[build]" | ||
pre-commit install --hook-type pre-commit | ||
pre-commit install --hook-type pre-push | ||
|
||
.PHONY : test | ||
test: | ||
pytest | ||
|
||
.PHONY : tox | ||
tox: | ||
tox --parallel auto |