summaryrefslogtreecommitdiff
path: root/requirements
diff options
context:
space:
mode:
authorChandan Singh <csingh43@bloomberg.net>2019-01-03 22:30:42 +0000
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2019-01-04 15:21:35 +0000
commitbb7128869d0b44caeb3d49f913a0af9e1369e287 (patch)
treed3ce5fe6721d88bfaaf29506d0908fd664ce387c /requirements
parentebd965fe2453a5a752f782759544e7aca586b661 (diff)
downloadbuildstream-bb7128869d0b44caeb3d49f913a0af9e1369e287.tar.gz
Add Makefile to update requirements files
Diffstat (limited to 'requirements')
-rw-r--r--requirements/Makefile21
1 files changed, 21 insertions, 0 deletions
diff --git a/requirements/Makefile b/requirements/Makefile
new file mode 100644
index 000000000..4f966254f
--- /dev/null
+++ b/requirements/Makefile
@@ -0,0 +1,21 @@
+# Makefile for updating BuildStream's requirements files.
+#
+
+REQUIREMENTS_IN := $(wildcard *.in)
+REQUIREMENTS_TXT := $(REQUIREMENTS_IN:.in=.txt)
+PYTHON := python3
+VENV := $(PYTHON) -m venv
+
+VENV_PIP = $(VENVDIR)/bin/pip
+
+
+.PHONY: all
+
+all: $(REQUIREMENTS_TXT)
+
+%.txt: %.in
+ $(eval VENVDIR := $(shell mktemp -d $$TMPDIR/bst-venv.XXXXXX))
+ $(VENV) $(VENVDIR)
+ $(VENV_PIP) install -r $^
+ $(VENV_PIP) freeze -r $^ > $@
+ rm -rf $(VENVDIR)