- create a
Makefile
in the project
autoformat:
isort --atomic -rc myproject/ tests/
black myproject/ tests/
docformatter --in-place --recursive myproject tests
lint:
isort -c -rc myproject/ tests/
black myproject/ tests/ --check
flake8 myproject/ tests/
test:
pytest
test-cov:
pytest --cov=./ --cov-report=xml
docs:
sphinx-build -b html docs/source/ docs/build/html/
docs-check:
sphinx-build -b html docs/source/ docs/build/html/ -W
livedocs:
sphinx-autobuild -b html docs/source/ docs/build/html/
dev:
pip install black isort flake8 docformatter pytest-cov sphinx-rtd-theme nbsphinx recommonmark pre-commit
all: autoformat lint docs test
- use the
Makefile
# install dev requirements
make dev
# lint against PEP8 using isort, black and flake8
make lint
# autoformat code against PEP8 using isort, black and docformatter
make autoformat
# generate docs using sphinx
make docs
# generate live docs
make livedocs
# run unittests using pytest
make test