afpy.org/Makefile

35 lines
734 B
Makefile
Raw Normal View History

2017-09-21 14:34:26 +00:00
VENV = $(PWD)/.env
PIP = $(VENV)/bin/pip
PYTHON = $(VENV)/bin/python
FLASK = $(VENV)/bin/flask
ISORT = $(VENV)/bin/isort
BLACK = $(VENV)/bin/black
2017-09-21 14:34:26 +00:00
all: install serve
install:
2018-10-04 08:18:48 +00:00
test -d $(VENV) || python3 -m venv $(VENV)
2017-09-22 09:30:21 +00:00
$(PIP) install --upgrade --no-cache pip setuptools -e .[test]
2017-09-21 14:34:26 +00:00
clean:
rm -fr dist
rm -fr $(VENV)
rm -fr *.egg-info
check-outdated:
$(PIP) list --outdated --format=columns
2017-09-22 09:30:21 +00:00
test:
$(PYTHON) -m pytest tests.py afpy.py --flake8 --isort --cov=afpy --cov=tests --cov-report=term-missing
2017-09-22 09:30:21 +00:00
2017-09-21 14:34:26 +00:00
serve:
env FLASK_APP=afpy.py FLASK_ENV=development $(FLASK) run
2018-10-04 08:36:46 +00:00
isort:
$(ISORT) -rc .isort.cfg afpy.py tests.py
black:
$(VENV)/bin/black afpy.py tests.py
2019-12-17 23:10:27 +00:00
.PHONY: all install clean check-outdated test serve isort black