← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:fix-clean-build-harder into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:fix-clean-build-harder into launchpad:master.

Commit message:
Fix clean build without cached wheels (again)

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/378716

(qa)staging still had problems even after my previous fix (https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/378670): it was trying to make outgoing connections because --no-index wasn't passed through to pip processes run by setuptools, and the setuptools-scm wheel failed to build.  I reproduced these by doing "ufw reject out http; ufw reject out https; ufw enable" in a container, and tested these fixes in that environment.

Dependencies MP: https://code.launchpad.net/~cjwatson/lp-source-dependencies/+git/lp-source-dependencies/+merge/378713
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:fix-clean-build-harder into launchpad:master.
diff --git a/Makefile b/Makefile
index 828765b..85911fc 100644
--- a/Makefile
+++ b/Makefile
@@ -9,20 +9,21 @@ PYTHONPATH:=$(WD)/lib:${PYTHONPATH}
 VERBOSITY=-vv
 
 # virtualenv and pip fail if setlocale fails, so force a valid locale.
-VIRTUALENV := LC_ALL=C.UTF-8 virtualenv
-PIP := PYTHONPATH= LC_ALL=C.UTF-8 env/bin/pip
+PIP_ENV := LC_ALL=C.UTF-8
 # Run with "make PIP_NO_INDEX=" if you want pip to find software
 # dependencies *other* than those in our download-cache.  Once you have the
 # desired software, commit it to lp:lp-source-dependencies if it is going to
 # be reviewed/merged/deployed.
+PIP_NO_INDEX := 1
+PIP_ENV += PIP_NO_INDEX=$(PIP_NO_INDEX)
 # Although --ignore-installed is slower, we need it to avoid confusion with
 # system-installed Python packages.  If we ever manage to remove the need
 # for virtualenv --system-site-packages, then we can remove this too.
-PIP_NO_INDEX := --no-index
-PIP_INSTALL_ARGS := \
-	$(PIP_NO_INDEX) \
-	--ignore-installed \
-	--find-links=file://$(WD)/download-cache/dist/ \
+PIP_ENV += PIP_IGNORE_INSTALLED=1
+PIP_ENV += PIP_FIND_LINKS=file://$(WD)/download-cache/dist/
+
+VIRTUALENV := $(PIP_ENV) virtualenv
+PIP := PYTHONPATH= $(PIP_ENV) env/bin/pip
 
 TESTFLAGS=-p $(VERBOSITY)
 TESTOPTS=
@@ -244,19 +245,15 @@ build_eggs: build_wheels
 $(PY): download-cache constraints.txt setup.py
 	rm -rf env
 	mkdir -p env
-	(echo '[easy_install]'; \
-	 echo 'find_links = file://$(WD)/download-cache/dist/') \
-		>env/.pydistutils.cfg
 	$(VIRTUALENV) \
 		--python=$(PYTHON) --system-site-packages --never-download \
 		--extra-search-dir=$(WD)/download-cache/dist/ \
 		env
 	ln -sfn env/bin bin
-	$(SHHH) $(PIP) install $(PIP_INSTALL_ARGS) \
-		-r setup-requirements.txt
+	$(SHHH) $(PIP) install -r setup-requirements.txt
 	$(SHHH) LPCONFIG=$(LPCONFIG) $(PIP) \
 		--cache-dir=$(WD)/download-cache/ \
-		install $(PIP_INSTALL_ARGS) \
+		install \
 		-c setup-requirements.txt -c constraints.txt -e . \
 		|| { code=$$?; rm -f $@; exit $$code; }
 	touch $@
diff --git a/constraints.txt b/constraints.txt
index 33b8872..0d551cf 100644
--- a/constraints.txt
+++ b/constraints.txt
@@ -289,7 +289,7 @@ scandir==1.7
 service-identity==18.1.0
 setproctitle==1.1.7
 setuptools-git==1.2
-setuptools-scm==1.15.7
+setuptools-scm==3.4.3
 simplejson==3.8.2
 SimpleTAL==4.3
 soupmatchers==0.4
diff --git a/utilities/relocate-virtualenv b/utilities/relocate-virtualenv
index 9d4d7bf..d3cf2ab 100755
--- a/utilities/relocate-virtualenv
+++ b/utilities/relocate-virtualenv
@@ -21,5 +21,3 @@ top="$(readlink -f "$(dirname "$0")/..")"
 for path in "$1"/lib/*/site-packages/lp.egg-link; do
     printf '%s/lib\n../' "$top" >"$path"
 done
-sed -i "s#^find_links = .*#find_links = file://$top/download-cache/dist/#" \
-    "$1"/.pydistutils.cfg

References