Commit 668d2841 authored by Stefane Fermigier's avatar Stefane Fermigier

refact: cleaner Makefile

parent 3ad6b73e
.PHONY: all develop test lint clean doc format
# The package name
PKG=FIXME
.PHONY:
all: test lint
#
# Run
#
.PHONY:
run:
gunicorn --bind localhost:3000 app:app
#
# Setup
#
.PHONY:
develop: install-deps activate-pre-commit configure-git
install-deps:
......@@ -17,68 +26,85 @@ install-deps:
pip install -U pip setuptools wheel
poetry install
.PHONY:
activate-pre-commit:
@echo "--> Activating pre-commit hook"
pre-commit install
.PHONY:
configure-git:
@echo "--> Configuring git"
git config branch.autosetuprebase always
#
# testing & checking
#
.PHONY:
test-all: test
.PHONY:
test:
@echo "--> Running Python tests"
pytest --ff -x -p no:randomly
@echo ""
.PHONY:
test-randomly:
@echo "--> Running Python tests in random order"
pytest
@echo ""
.PHONY:
test-with-coverage:
@echo "--> Running Python tests"
py.test --cov $(PKG)
@echo ""
.PHONY:
test-with-typeguard:
@echo "--> Running Python tests with typeguard"
pytest --typeguard-packages=${PKG}
@echo ""
#
# Various Checkers
#
.PHONY:
lint: lint-py lint-mypy lint-rst lint-doc
.PHONY:
lint-ci: lint
.PHONY:
lint-all: lint lint-bandit
.PHONY:
lint-py:
@echo "--> Linting Python files /w flake8"
flake8 src tests
@echo ""
.PHONY:
lint-mypy:
@echo "--> Typechecking Python files w/ mypy"
mypy src tests
@echo ""
.PHONY:
lint-travis:
@echo "--> Linting .travis.yml files"
travis lint --no-interactive
@echo ""
.PHONY:
lint-rst:
@echo "--> Linting .rst files"
rst-lint *.rst
@echo ""
.PHONY:
lint-doc:
@echo "--> Linting doc"
@echo "TODO"
......@@ -86,31 +112,40 @@ lint-doc:
#sphinx-build -b dummy docs/ docs/_build/
@echo ""
#
# Formatting
#
.PHONY:
format: format-py
.PHONY:
format-py:
docformatter -i -r src tests
black src tests
isort src tests
#
# Everything else
#
.PHONY:
install:
poetry install
.PHONY:
doc: doc-html doc-pdf
.PHONY:
doc-html:
sphinx-build -W -b html docs/ docs/_build/html
.PHONY:
doc-pdf:
sphinx-build -W -b latex docs/ docs/_build/latex
make -C docs/_build/latex all-pdf
.PHONY:
clean:
rm -f **/*.pyc
find . -type d -empty -delete
......@@ -118,23 +153,28 @@ clean:
.pytest_cache .pytest .DS_Store docs/_build docs/cache docs/tmp \
dist build pip-wheel-metadata junit-*.xml htmlcov coverage.xml
.PHONY:
tidy: clean
rm -rf .tox
.PHONY:
update-deps:
pip install -U pip setuptools wheel
poetry update
dephell deps convert --from=pyproject.toml --to=setup.py
black setup.py
.PHONY:
publish: clean
git push --tags
poetry build
twine upload dist/*
.PHONY:
push:
rsync -e ssh -avz ./ pilaf:git/minij-proxy/
.PHONY:
fetch-results:
rsync -e ssh -avz pilaf:git/minij-proxy/results.csv results/
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment