Browse Source

fix(make): ensure latest pip before pip installing (#15023)

josh 5 years ago
parent
commit
2e4ff788ad
2 changed files with 17 additions and 14 deletions
  1. 2 1
      .travis.yml
  2. 15 13
      Makefile

+ 2 - 1
.travis.yml

@@ -26,7 +26,8 @@ env:
   global:
     - NODE_ENV=development
     # PIP_VERSION causes issues because: https://github.com/pypa/pip/issues/4528
-    - PYTHON_PIP_VERSION=19.1.1
+    # Note: this has to be synced with the pip version in the Makefile.
+    - PYTHON_PIP_VERSION=19.2.3
     - PIP_USE_PEP517=off
     - PIP_DISABLE_PIP_VERSION_CHECK=on
     - PIP_QUIET=1

+ 15 - 13
Makefile

@@ -7,16 +7,18 @@ ifneq "$(wildcard /usr/local/opt/openssl/lib)" ""
 	LDFLAGS += -L/usr/local/opt/openssl/lib
 endif
 
-PIP = LDFLAGS="$(LDFLAGS)" pip
-PIP_OPTS = --no-use-pep517 --disable-pip-version-check
-WEBPACK = NODE_ENV=production ./bin/yarn webpack
-YARN = ./bin/yarn
+PIP := LDFLAGS="$(LDFLAGS)" python -m pip
+# Note: this has to be synced with the pip version in .travis.yml.
+PIP_VERSION := 19.2.3
+PIP_OPTS := --no-use-pep517 --disable-pip-version-check
+WEBPACK := NODE_ENV=production ./bin/yarn webpack
+YARN := ./bin/yarn
 
 bootstrap: install-system-pkgs develop init-config run-dependent-services create-db apply-migrations
 
-develop: setup-git ensure-venv ensure-latest-pip develop-only
+develop: ensure-venv setup-git develop-only
 
-develop-only: update-submodules install-yarn-pkgs install-sentry-dev
+develop-only: ensure-venv update-submodules install-yarn-pkgs install-sentry-dev
 
 init-config:
 	sentry init --dev
@@ -26,12 +28,6 @@ run-dependent-services:
 
 test: develop lint test-js test-python test-cli
 
-ensure-venv:
-	@./scripts/ensure-venv.sh
-
-ensure-latest-pip:
-	python -m pip install -U pip
-
 build: locale
 
 drop-db:
@@ -61,7 +57,13 @@ clean:
 	rm -rf build/ dist/ src/sentry/assets.json
 	@echo ""
 
-setup-git:
+ensure-venv:
+	@./scripts/ensure-venv.sh
+
+ensure-latest-pip:
+	$(PIP) install "pip==$(PIP_VERSION)"
+
+setup-git: ensure-latest-pip
 	@echo "--> Installing git hooks"
 	git config branch.autosetuprebase always
 	git config core.ignorecase false