Update the Makefile

This commit is contained in:
Andreas Zweili 2022-08-29 18:19:26 +02:00
parent cd268dcb39
commit b98b860078
1 changed files with 6 additions and 21 deletions

View File

@ -1,16 +1,14 @@
SHELL=/bin/bash
SHELL=/usr/bin/env bash
.PHONY: run
run: venv/production
run: venv
( \
source venv/bin/activate; \
./run.sh; \
)
test: venv/development
test: venv
( \
source venv/bin/activate; \
export DJANGO_SETTINGS_MODULE=sensors.settings.production; \
pytest --nomigrations --cov=. --cov-report=html sensors/; \
)
@ -21,23 +19,10 @@ migrations:
./manage.py makemigrations collector; \
)
venv/development:
test -d venv || python3 -m venv venv --system-site-packages
( \
source venv/bin/activate; \
pip3 install -r requirements/development.txt; \
)
touch venv/development
venv/production:
test -d venv || python3 -m venv venv --system-site-packages
( \
source venv/bin/activate; \
pip3 install -Ur requirements/production.txt; \
touch venv/bin/activate: \
)
venv:
nix build .#venv -o venv
clean:
rm -rf venv/
rm venv
find . \( -name __pycache__ -o -name "*.pyc" \) -delete
rm -rf htmlcov/