From 7cd2bdecef5f35f4d88f285c2fc8e1d975fb34e6 Mon Sep 17 00:00:00 2001 From: Josh Friend Date: Thu, 30 Oct 2014 10:47:56 -0400 Subject: [PATCH 1/3] Let pip use a local download cache --- Makefile | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b728803..9322980 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,10 @@ NOSE := $(BIN)/nosetests PYTEST := $(BIN)/py.test COVERAGE := $(BIN)/coverage +# Remove if you don't want pip to cache downloads +PIP_CACHE_DIR := .cache +PIP_CACHE := --download-cache $(PIP_CACHE_DIR) + # Flags for PHONY targets DEPENDS_CI := $(ENV)/.depends-ci DEPENDS_DEV := $(ENV)/.depends-dev @@ -90,13 +94,13 @@ depends: .depends-ci .depends-dev .PHONY: .depends-ci .depends-ci: env Makefile $(DEPENDS_CI) $(DEPENDS_CI): Makefile - $(PIP) install --upgrade pep8 pep257 $(TEST_RUNNER) coverage + $(PIP) install $(PIP_CACHE) --upgrade pep8 pep257 $(TEST_RUNNER) coverage touch $(DEPENDS_CI) # flag to indicate dependencies are installed .PHONY: .depends-dev .depends-dev: env Makefile $(DEPENDS_DEV) $(DEPENDS_DEV): Makefile - $(PIP) install --upgrade pygments docutils pdoc pylint wheel + $(PIP) install $(PIP_CACHE) --upgrade pygments docutils pdoc pylint wheel touch $(DEPENDS_DEV) # flag to indicate dependencies are installed # Documentation ############################################################## @@ -186,12 +190,16 @@ clean: .clean-dist .clean-test .clean-doc .clean-build rm -rf $(ALL) .PHONY: clean-all -clean-all: clean .clean-env +clean-all: clean clean-env .clean-cache -.PHONY: .clean-env -.clean-env: +.PHONY: clean-env +clean-env: rm -rf $(ENV) +.PHONY: .clean-cache +.clean-cache: + rm -rf .cache + .PHONY: .clean-build .clean-build: find . -name '*.pyc' -delete From 1f843745c307775bc66da697d8f5a791bd172b01 Mon Sep 17 00:00:00 2001 From: Jace Browning Date: Thu, 30 Oct 2014 15:25:16 -0400 Subject: [PATCH 2/3] Add workspace cleaning to clean-all --- Makefile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 9322980..7ba549b 100644 --- a/Makefile +++ b/Makefile @@ -189,16 +189,12 @@ tests-pytest: .depends-ci clean: .clean-dist .clean-test .clean-doc .clean-build rm -rf $(ALL) -.PHONY: clean-all -clean-all: clean clean-env .clean-cache - .PHONY: clean-env -clean-env: +clean-env: clean rm -rf $(ENV) -.PHONY: .clean-cache -.clean-cache: - rm -rf .cache +.PHONY: clean-all +clean-all: clean clean-env .clean-workspace .clean-cache .PHONY: .clean-build .clean-build: @@ -218,6 +214,14 @@ clean-env: .clean-dist: rm -rf dist build +.PHONY: .clean-cache +.clean-cache: + rm -rf .cache + +.PHONY: .clean-workspace +.clean-workspace: + rm -rf *.sublime-workspace + # Release #################################################################### .PHONY: .git-no-changes From 25a184f9678a3fa9e1aa1a65c22fe9c91d9e25eb Mon Sep 17 00:00:00 2001 From: Jace Browning Date: Thu, 30 Oct 2014 16:01:36 -0400 Subject: [PATCH 3/3] Use PIP_CACHE_DIR variable --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7ba549b..054a28b 100644 --- a/Makefile +++ b/Makefile @@ -216,7 +216,7 @@ clean-all: clean clean-env .clean-workspace .clean-cache .PHONY: .clean-cache .clean-cache: - rm -rf .cache + rm -rf $(PIP_CACHE_DIR) .PHONY: .clean-workspace .clean-workspace: