diff options
| author | David Pursehouse <david.pursehouse@sonymobile.com> | 2013-08-07 16:03:48 +0900 |
|---|---|---|
| committer | David Pursehouse <david.pursehouse@sonymobile.com> | 2013-08-07 16:15:54 +0900 |
| commit | 9ac7d9b7991044867a15459afe6d40b3cd64cd34 (patch) | |
| tree | 5a73732c861bd1b0be8d2f7e241a026c499b7f37 /Makefile | |
| parent | 4dd516877f113ba05c98d5b38afb16af702a5bd4 (diff) | |
| download | pygerrit-9ac7d9b7991044867a15459afe6d40b3cd64cd34.tar.gz | |
Add make target and rules to ensure environment setup tools are OK
To set up the environment properly, the host system needs to have the
virtualenv and pip packages already installed. Add top level rules to
make sure the necessary executables exist.
When building the `sdist` target there is a check to make sure that the
git workspace does not have any untracked or modified files. This can
cause the build to fail if the environment was set up with an old
version of virtualennv which does not include bundled versions of the
`distribute` and `setuptools` packages, and downloads them into the
working directory.
Add a new target `valid-virtualenv` which will fail the build if the
version of virtualenv is older than expected. Add this target as a
dependency of the `sdist` target to force source distribution builds
to be done with an explicitly versioned virtualenv.
Change-Id: I1a78e8859512696005ab9d6dd790cfc5256dc2e3
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -24,13 +24,27 @@ PWD := $(shell pwd) TAG := $(shell git tag -l --contains HEAD) STATUS := $(shell git status --porcelain) +VIRTUALENV := $(shell which virtualenv) +ifeq ($(wildcard $(VIRTUALENV)),) + $(error virtualenv must be available) +endif + +PIP := $(shell which pip) +ifeq ($(wildcard $(PIP)),) + $(error pip must be available) +endif + +REQUIRED_VIRTUALENV ?= 1.10 +VIRTUALENV_OK := $(shell expr `virtualenv --version | \ + cut -f2 -d' '` \>= $(REQUIRED_VIRTUALENV)) + all: test test: clean unittests pyflakes pep8 pep257 pylint docs: html -sdist: test valid-env +sdist: valid-virtualenv test valid-env bash -c "\ source ./pygerritenv/bin/activate && \ python setup.py sdist" @@ -43,6 +57,11 @@ ddist: sdist docs valid-env: valid-version valid-git-status +valid-virtualenv: +ifeq ($(VIRTUALENV_OK),0) + $(error virtualenv version $(REQUIRED_VIRTUALENV) or higher is needed) +endif + valid-version: valid-tag @python version.py $(TAG) |
