Update the Makefile
This commit is contained in:
parent
cd268dcb39
commit
b98b860078
27
Makefile
27
Makefile
|
@ -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/
|
||||
|
|
Loading…
Reference in New Issue