mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-28 17:32:38 +02:00
Fix makefile: Python lookup and virtualenv setup (#201)
* Fix Python lookup in the Makefile * Improve the Makefile To make sure calling for "make serve" works straight away, the dependencies are automatically prepared. A "make clean" has been added, to test this feature.
This commit is contained in:
parent
4ea5158a70
commit
41ede04a59
1 changed files with 7 additions and 4 deletions
11
Makefile
11
Makefile
|
@ -1,6 +1,6 @@
|
||||||
VIRTUALENV = virtualenv --python=python3
|
VIRTUALENV = virtualenv --python=python3
|
||||||
SPHINX_BUILDDIR = docs/_build
|
SPHINX_BUILDDIR = docs/_build
|
||||||
VENV := $(shell echo $${VIRTUAL_ENV-.venv})
|
VENV := $(shell realpath $${VIRTUAL_ENV-.venv})
|
||||||
PYTHON = $(VENV)/bin/python3
|
PYTHON = $(VENV)/bin/python3
|
||||||
DEV_STAMP = $(VENV)/.dev_env_installed.stamp
|
DEV_STAMP = $(VENV)/.dev_env_installed.stamp
|
||||||
DOC_STAMP = $(VENV)/.doc_env_installed.stamp
|
DOC_STAMP = $(VENV)/.doc_env_installed.stamp
|
||||||
|
@ -8,7 +8,7 @@ INSTALL_STAMP = $(VENV)/.install.stamp
|
||||||
TEMPDIR := $(shell mktemp -d)
|
TEMPDIR := $(shell mktemp -d)
|
||||||
|
|
||||||
all: install
|
all: install
|
||||||
install: $(INSTALL_STAMP)
|
install: virtualenv $(INSTALL_STAMP)
|
||||||
$(INSTALL_STAMP):
|
$(INSTALL_STAMP):
|
||||||
$(VENV)/bin/pip install -U pip
|
$(VENV)/bin/pip install -U pip
|
||||||
$(VENV)/bin/pip install -r requirements.txt
|
$(VENV)/bin/pip install -r requirements.txt
|
||||||
|
@ -23,8 +23,8 @@ $(DEV_STAMP): $(PYTHON) dev-requirements.txt
|
||||||
$(VENV)/bin/pip install -Ur dev-requirements.txt
|
$(VENV)/bin/pip install -Ur dev-requirements.txt
|
||||||
touch $(DEV_STAMP)
|
touch $(DEV_STAMP)
|
||||||
|
|
||||||
serve: $(INSTALL_STAMP)
|
serve: install
|
||||||
cd budget; ../$(PYTHON) run.py
|
cd budget; $(PYTHON) run.py
|
||||||
|
|
||||||
test: $(DEV_STAMP)
|
test: $(DEV_STAMP)
|
||||||
$(VENV)/bin/tox
|
$(VENV)/bin/tox
|
||||||
|
@ -37,3 +37,6 @@ build-requirements:
|
||||||
$(TEMPDIR)/bin/pip install -U pip
|
$(TEMPDIR)/bin/pip install -U pip
|
||||||
$(TEMPDIR)/bin/pip install -Ue "."
|
$(TEMPDIR)/bin/pip install -Ue "."
|
||||||
$(TEMPDIR)/bin/pip freeze | grep -v -- '-e' > requirements.txt
|
$(TEMPDIR)/bin/pip freeze | grep -v -- '-e' > requirements.txt
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf .venv
|
||||||
|
|
Loading…
Reference in a new issue