← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:pip-cache-dir into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:pip-cache-dir into launchpad:master.

Commit message:
Set pip's cache directory even on the first run

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

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

When I originally converted Launchpad's build system from buildout to virtualenv and pip, we were still running on precise, and its old version of pip didn't support the --cache-dir argument.  To cope with this, I did an initial run that only installed an updated pip, and then used --cache-dir=$(WD)/download-cache/ thereafter.

However, the initial run now installs some more packages, and using pip's default cache for those can be confusing.  While we could split this up further into three invocations of pip (one to update pip itself, one to install some further setup requirements, and one to install everything else), that seems unnecessarily complex now that we no longer need to support running with precise's version of pip.  Instead, just pass --cache-dir=$(WD)/download-cache/ every time we invoke pip.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:pip-cache-dir into launchpad:master.
diff --git a/Makefile b/Makefile
index 85911fc..af9b066 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ 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
+PIP := PYTHONPATH= $(PIP_ENV) env/bin/pip --cache-dir=$(WD)/download-cache/
 
 TESTFLAGS=-p $(VERBOSITY)
 TESTOPTS=
@@ -252,7 +252,6 @@ $(PY): download-cache constraints.txt setup.py
 	ln -sfn env/bin bin
 	$(SHHH) $(PIP) install -r setup-requirements.txt
 	$(SHHH) LPCONFIG=$(LPCONFIG) $(PIP) \
-		--cache-dir=$(WD)/download-cache/ \
 		install \
 		-c setup-requirements.txt -c constraints.txt -e . \
 		|| { code=$$?; rm -f $@; exit $$code; }