aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2017-03-29 00:03:25 +0200
committerGitHub <noreply@github.com>2017-03-29 00:03:25 +0200
commit1b94f6738a1cfc117e2af78afdafdfeff84aecd0 (patch)
tree2d11831527231ee06eb6b4b3be168d6fdba203aa /Makefile
parentacbe2c10d8fb86ef04af60fc257ce4d51ffee45c (diff)
parentaaf9f9f23754dd97af0dc9daa5215d42f8017d68 (diff)
downloadihatemoney-mirror-1b94f6738a1cfc117e2af78afdafdfeff84aecd0.zip
ihatemoney-mirror-1b94f6738a1cfc117e2af78afdafdfeff84aecd0.tar.gz
ihatemoney-mirror-1b94f6738a1cfc117e2af78afdafdfeff84aecd0.tar.bz2
Merge pull request #186 from spiral-project/tox
Tox support
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1ac7e19
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,39 @@
+VIRTUALENV = virtualenv --python=python3
+SPHINX_BUILDDIR = docs/_build
+VENV := $(shell echo $${VIRTUAL_ENV-.venv})
+PYTHON = $(VENV)/bin/python3
+DEV_STAMP = $(VENV)/.dev_env_installed.stamp
+DOC_STAMP = $(VENV)/.doc_env_installed.stamp
+INSTALL_STAMP = $(VENV)/.install.stamp
+TEMPDIR := $(shell mktemp -d)
+
+all: install
+install: $(INSTALL_STAMP)
+$(INSTALL_STAMP):
+ $(VENV)/bin/pip install -U pip
+ $(VENV)/bin/pip install -r requirements.txt
+ touch $(INSTALL_STAMP)
+
+virtualenv: $(PYTHON)
+$(PYTHON):
+ $(VIRTUALENV) $(VENV)
+
+install-dev: $(INSTALL_STAMP) $(DEV_STAMP)
+$(DEV_STAMP): $(PYTHON) dev-requirements.txt
+ $(VENV)/bin/pip install -Ur dev-requirements.txt
+ touch $(DEV_STAMP)
+
+serve: $(INSTALL_STAMP)
+ cd budget; ../$(PYTHON) run.py
+
+test: $(DEV_STAMP)
+ $(VENV)/bin/tox
+
+release: $(DEV_STAMP)
+ $(VENV)/bin/fullrelease
+
+build-requirements:
+ $(VIRTUALENV) $(TEMPDIR)
+ $(TEMPDIR)/bin/pip install -U pip
+ $(TEMPDIR)/bin/pip install -Ue "."
+ $(TEMPDIR)/bin/pip freeze | grep -v -- '-e' > requirements.txt