You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.2 KiB
Makefile

# setup
init:
mkdir -p instance
cp app/config.py instance/config.py
venv:
python3 -m venv venv
venv/bin/pip install --upgrade pip
install:
venv/bin/pip install -r requirements.txt
list_outdated:
venv/bin/pip list --outdated
# shortcuts
bootstrap:
make init
make venv
make install
clean:
rm -rf venv
rm -rf instance
# run server
run:
FLASK_ENV=development venv/bin/flask run
prod:
venv/bin/gunicorn -w 4 -b 127.0.0.1:4000 "manage:app"
# database
refresh-db:
venv/bin/flask database recreate-db
seed-db:
venv/bin/flask database seed-db
# linting
pylint:
venv/bin/pylint app --output-format=colorized
venv/bin/pylint tests --output-format=colorized -d duplicate-code
flake8:
venv/bin/flake8 --exclude=migrations app tests
lint:
# ignores errors: for development only
# ===== FLAKE8 =====
-make flake8
# ===== PYLINT =====
-make pylint
lint-watch:
-make lint
@echo "\n"
while inotifywait -re close_write app tests; do make lint; echo "\n"; done
# testing
test:
FLASK_ENV=testing venv/bin/flask test
cov:
FLASK_ENV=testing venv/bin/flask test-coverage
test-watch:
-make test
while inotifywait -re close_write app tests; do make test; done
cov-watch:
-make cov
while inotifywait -re close_write app tests; do make cov; done