From c2271412db19d1d4f2e0dc68951df73f099793c7 Mon Sep 17 00:00:00 2001 From: Haim Gelfenbeyn Date: Mon, 3 Jul 2017 14:38:13 -0400 Subject: [PATCH 1/2] Debian 9 introduced patch into pip, which auto-adds "--user" parameter to pip, which cannot work with "--target". Therefore, "make" fails on current Debian stable (Stretch, 9). Just adding "--system" before "-t" fixes that. Yes, it's stupid, but it works. For more info, see: https://github.com/pypa/pip/issues/3826 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4f989da..3d3c54e 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ BUILD_DIR=build haaska.zip: haaska.py config/* mkdir -p $(BUILD_DIR) cp $^ $(BUILD_DIR) - pip install -t $(BUILD_DIR) requests + pip install --system -t $(BUILD_DIR) requests cd $(BUILD_DIR); zip ../$@ -r * .PHONY: deploy From 0523c2cbd29077575cb69ccb93a8d42434d1f9a5 Mon Sep 17 00:00:00 2001 From: Haim Gelfenbeyn Date: Mon, 24 Jul 2017 09:11:46 -0400 Subject: [PATCH 2/2] Made pip option "--system" conditional on whether such option actually exists for the currently installed pip. --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3d3c54e..5e751a7 100644 --- a/Makefile +++ b/Makefile @@ -5,11 +5,12 @@ SHELL := /bin/bash FUNCTION_NAME=haaska BUILD_DIR=build +PIP_SYSTEM:=$(shell pip install --help | grep -q -- --system && echo --system) haaska.zip: haaska.py config/* mkdir -p $(BUILD_DIR) cp $^ $(BUILD_DIR) - pip install --system -t $(BUILD_DIR) requests + pip install $(PIP_SYSTEM) -t $(BUILD_DIR) requests cd $(BUILD_DIR); zip ../$@ -r * .PHONY: deploy