From 196b926da3f169c6471b85c5f13aefcc35e2b7be Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 20 Sep 2020 14:01:27 +0200 Subject: [PATCH] Assure that setuptools <45 is installed In some circumstances pip pulls setuptools 45.0.0, which is not compatible with Python 2. To assure the correct version is installed, add the "--no-setuptools" flag to virtualenv and install the correct setuptools version manually afterwards. Workaround for: https://github.com/mozilla-services/syncserver/issues/239 Additionally this removes the obsolete pip upgrade. "make build" only runs once and is blocked afterwards by a flag file. Even when removing this flag file manually, "virtualenv" always reinstalls pip, which includes an upgrade to the latest version. A latest supported pip version is hence assured on every build. Signed-off-by: MichaIng --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c77fe9a..f5654cd 100644 --- a/Makefile +++ b/Makefile @@ -24,8 +24,10 @@ all: build .PHONY: build build: | $(ENV)/COMPLETE $(ENV)/COMPLETE: requirements.txt - $(VIRTUALENV) $(ENV) - $(INSTALL) -i https://pypi.python.org/simple -U pip + # Install the latest Python 2 compatible setuptools manually: + # https://github.com/mozilla-services/syncserver/issues/239 + $(VIRTUALENV) $(ENV) --no-setuptools + $(INSTALL) -U "setuptools<45" $(INSTALL) -r requirements.txt $(ENV)/bin/python ./setup.py develop touch $(ENV)/COMPLETE @@ -36,7 +38,7 @@ test: | $(TOOLS) $(ENV)/bin/nosetests -s syncstorage.tests # Tokenserver tests currently broken due to incorrect file paths # $(ENV)/bin/nosetests -s tokenserver.tests - + # Test against a running server. $(ENV)/bin/gunicorn --paste syncserver/tests.ini 2> /dev/null & SERVER_PID=$$!; \ sleep 2; \