Align to jenkins tox patterns.

Split requires in to pip-requires and test-requires.
Updated install_venv to know about test-requires.

Change-Id: I739f42c8676c40e2203cc0bc4aa9763ffac999a9
This commit is contained in:
Monty Taylor 2012-02-25 17:24:39 -08:00
parent 9593687d3d
commit d26f66bce5
4 changed files with 23 additions and 19 deletions

View File

@ -30,6 +30,7 @@ import sys
ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
VENV = os.path.join(ROOT, '.venv')
PIP_REQUIRES = os.path.join(ROOT, 'tools', 'pip-requires')
TEST_REQUIRES = os.path.join(ROOT, 'tools', 'test-requires')
def die(message, *args):
@ -91,14 +92,19 @@ def create_virtualenv(venv=VENV):
print 'done.'
def pip_install(*args):
run_command(['tools/with_venv.sh',
'pip', 'install', '--upgrade'] + list(args),
redirect_output=False)
def install_dependencies(venv=VENV):
print 'Installing dependencies with pip (this can take a while)...'
# Install greenlet by hand - just listing it in the requires file does not
# get it in stalled in the right order
venv_tool = 'tools/with_venv.sh'
run_command([venv_tool, 'pip', 'install', '-E', venv, '-r', PIP_REQUIRES],
redirect_output=False)
pip_install('pip')
pip_install('-r', PIP_REQUIRES)
pip_install('-r', TEST_REQUIRES)
# Tell the virtual env how to "import glance"
py_ver = _detect_python_version(venv)

View File

@ -10,9 +10,7 @@ PasteDeploy
routes
webob==1.0.8
wsgiref
sphinx
argparse
mox
boto==2.1.1
swift
sqlalchemy-migrate>=0.7
@ -41,11 +39,3 @@ lxml
Paste
passlib
# Needed for testing
nose
nose-exclude
nosexcover
openstack.nose_plugin
pep8==0.6.1
pylint==0.19

11
tools/test-requires Normal file
View File

@ -0,0 +1,11 @@
# Packages needed for dev testing
distribute>=0.6.24
# Needed for testing
mox
nose
nose-exclude
nosexcover
openstack.nose_plugin
pep8==0.6.1
sphinx>=1.1.2

View File

@ -4,16 +4,13 @@ envlist = py26,py27,pep8
[testenv]
setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/tools/pip-requires
-r{toxinidir}/tools/test-requires
commands = nosetests
[testenv:pep8]
deps = pep8
commands = pep8 --repeat --show-source bin glance setup.py
[testenv:pylint]
deps = pylint
commands = pylint --rcfile=pylintrc --output-format=parseable glance
[testenv:cover]
commands = nosetests --with-coverage --cover-html --cover-erase --cover-package=glance