Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ##############################################################
Expand Down Expand Up @@ -185,13 +189,13 @@ tests-pytest: .depends-ci
clean: .clean-dist .clean-test .clean-doc .clean-build
rm -rf $(ALL)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why no period prefixing .clean-env but one prefixing .clean-cache?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the . prefixed targets are supposed to be "plumbing commands", .clean-cache is probably one of those commands that people won't need to run specifically or know anything about. clean-env should be exposed so there is a way of rebuilding the virtualenv without clearing the download cache by using clean-all (which would make caching pointless).

.PHONY: clean-all
clean-all: clean .clean-env

.PHONY: .clean-env
.clean-env:
.PHONY: clean-env
clean-env: clean
rm -rf $(ENV)

.PHONY: clean-all
clean-all: clean clean-env .clean-workspace .clean-cache

.PHONY: .clean-build
.clean-build:
find . -name '*.pyc' -delete
Expand All @@ -210,6 +214,14 @@ clean-all: clean .clean-env
.clean-dist:
rm -rf dist build

.PHONY: .clean-cache
.clean-cache:
rm -rf $(PIP_CACHE_DIR)

.PHONY: .clean-workspace
.clean-workspace:
rm -rf *.sublime-workspace

# Release ####################################################################

.PHONY: .git-no-changes
Expand Down