diff --git a/Makefile b/Makefile index c7d7ccd..f717c88 100644 --- a/Makefile +++ b/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/