From b98b86007808e179d84bd7f7d6dd10586787cbb1 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 29 Aug 2022 18:19:26 +0200 Subject: [PATCH] Update the Makefile --- Makefile | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) 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/