summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile17
-rwxr-xr-xbootstrap-venv.sh5
-rw-r--r--pre-commit4
3 files changed, 21 insertions, 5 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0f277da
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,17 @@
+test: all
+ ./venv/bin/pytest tests/*
+
+all: venv .git/hooks/pre-commit
+
+clean:
+ rm -rf venv
+
+.git/hooks/pre-commit: pre-commit
+ install -m 755 pre-commit .git/hooks/pre-commit
+
+venv: requirements.txt
+ rm -rf venv
+ python -m venv venv
+ ./venv/bin/pip install -r requirements.txt
+
+.PHONY: all test clean
diff --git a/bootstrap-venv.sh b/bootstrap-venv.sh
deleted file mode 100755
index f3c5580..0000000
--- a/bootstrap-venv.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/zsh
-
-rm -r venv
-python -m venv venv
-./venv/bin/pip install -r requirements.txt
diff --git a/pre-commit b/pre-commit
new file mode 100644
index 0000000..9c577e5
--- /dev/null
+++ b/pre-commit
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+./venv/bin/pytest tests/*
+exit $?