Skip to content

Commit

Permalink
Add Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
mstuttgart committed Nov 20, 2024
1 parent e0bf703 commit 51ad88c
Showing 1 changed file with 70 additions and 7 deletions.
77 changes: 70 additions & 7 deletions Makefile
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

0 comments on commit 51ad88c

Please sign in to comment.