Merge "Updated tox config for multi-python testing."
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -2,7 +2,11 @@
|
||||
*.pyc
|
||||
*.log
|
||||
.coverage
|
||||
requirements.txt
|
||||
.venv
|
||||
.tox
|
||||
cover/
|
||||
openstack.common.egg-info/
|
||||
.openstack-common-venv/
|
||||
skeleton.egg-info/
|
||||
build/
|
||||
|
||||
3
MANIFEST.in
Normal file
3
MANIFEST.in
Normal file
@@ -0,0 +1,3 @@
|
||||
include requirements.txt
|
||||
include tox.ini
|
||||
include tools/*
|
||||
@@ -40,3 +40,48 @@ def str_dict_replace(s, mapping):
|
||||
for s1, s2 in mapping.iteritems():
|
||||
s = s.replace(s1, s2)
|
||||
return s
|
||||
|
||||
|
||||
# Get requirements from the first file that exists
|
||||
def get_reqs_from_files(requirements_files):
|
||||
reqs_in = []
|
||||
for requirements_file in requirements_files:
|
||||
if os.path.exists(requirements_file):
|
||||
return open(requirements_file, 'r').read().split('\n')
|
||||
return []
|
||||
|
||||
|
||||
def parse_requirements(requirements_files=['requirements.txt',
|
||||
'tools/pip-requires']):
|
||||
requirements = []
|
||||
for line in get_reqs_from_files(requirements_files):
|
||||
if re.match(r'\s*-e\s+', line):
|
||||
requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1',
|
||||
line))
|
||||
elif re.match(r'\s*-f\s+', line):
|
||||
pass
|
||||
else:
|
||||
requirements.append(line)
|
||||
|
||||
return requirements
|
||||
|
||||
|
||||
def parse_dependency_links(requirements_files=['requirements.txt',
|
||||
'tools/pip-requires']):
|
||||
dependency_links = []
|
||||
for line in get_reqs_from_files(requirements_files):
|
||||
if re.match(r'(\s*#)|(\s*$)', line):
|
||||
continue
|
||||
if re.match(r'\s*-[ef]\s+', line):
|
||||
dependency_links.append(re.sub(r'\s*-[ef]\s+', '', line))
|
||||
return dependency_links
|
||||
|
||||
|
||||
def write_requirements():
|
||||
venv = os.environ.get('VIRTUAL_ENV', None)
|
||||
if venv is not None:
|
||||
with open("requirements.txt", "w") as req_file:
|
||||
output = subprocess.Popen(["pip", "-E", venv, "freeze", "-l"],
|
||||
stdout=subprocess.PIPE)
|
||||
requirements = output.communicate()[0].strip()
|
||||
req_file.write(requirements)
|
||||
|
||||
11
setup.cfg
11
setup.cfg
@@ -5,17 +5,6 @@
|
||||
# openstack-nose https://github.com/jkoelker/openstack-nose
|
||||
verbosity=2
|
||||
detailed-errors=1
|
||||
with-coverage=1
|
||||
cover-package=openstack.common
|
||||
cover-html=1
|
||||
cover-inclusive=1
|
||||
with-tissue=1
|
||||
tissue-repeat=1
|
||||
tissue-show-pep8=1
|
||||
tissue-show-source=1
|
||||
tissue-inclusive=1
|
||||
tissue-color=1
|
||||
tissue-package=openstack.common
|
||||
with-openstack=1
|
||||
openstack-red=0.05
|
||||
openstack-yellow=0.025
|
||||
|
||||
27
setup.py
27
setup.py
@@ -1,7 +1,18 @@
|
||||
from setuptools import setup, find_packages
|
||||
from openstack.common.setup import parse_requirements
|
||||
from openstack.common.setup import parse_dependency_links
|
||||
from openstack.common.setup import write_requirements
|
||||
|
||||
|
||||
version = '0.1'
|
||||
|
||||
requires = parse_requirements(['requirements.txt', 'tools/pip-requires'])
|
||||
|
||||
depend_links = parse_dependency_links(['requirements.txt',
|
||||
'tools/pip-requires'])
|
||||
|
||||
write_requirements()
|
||||
|
||||
setup(name='openstack.common',
|
||||
version=version,
|
||||
description="Common components for Openstack",
|
||||
@@ -23,20 +34,8 @@ Common components for Openstack including paster templates.
|
||||
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
|
||||
include_package_data=True,
|
||||
zip_safe=True,
|
||||
install_requires=[
|
||||
'greenlet>=0.3.1',
|
||||
'pep8',
|
||||
'pylint',
|
||||
'eventlet',
|
||||
'PasteDeploy',
|
||||
'routes',
|
||||
'webob',
|
||||
'nose',
|
||||
'nose-exclude',
|
||||
'mock',
|
||||
'webtest',
|
||||
'lxml',
|
||||
],
|
||||
install_requires=requires,
|
||||
dependency_links=depend_links,
|
||||
entry_points="""
|
||||
# -*- Entry points: -*-
|
||||
""",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
routes==1.12.3
|
||||
WebOb==1.0.8
|
||||
mox==0.5.3
|
||||
PasteDeploy==1.5.0
|
||||
WebOb==1.0.8
|
||||
eventlet
|
||||
nose
|
||||
coverage
|
||||
tissue
|
||||
openstack.nose_plugin
|
||||
greenlet>=0.3.1
|
||||
lxml
|
||||
mock
|
||||
mox==0.5.3
|
||||
routes==1.12.3
|
||||
webtest
|
||||
|
||||
10
tools/test-requires
Normal file
10
tools/test-requires
Normal file
@@ -0,0 +1,10 @@
|
||||
# Packages needed for dev testing
|
||||
distribute>=0.6.24
|
||||
|
||||
coverage
|
||||
nose
|
||||
nose-exclude
|
||||
nosexcover
|
||||
openstack.nose_plugin
|
||||
pep8==0.6.1
|
||||
pylint
|
||||
31
tox.ini
31
tox.ini
@@ -1,11 +1,38 @@
|
||||
[tox]
|
||||
envlist = py26,py27
|
||||
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 = nosetests --with-tissue
|
||||
commands = pep8 --repeat --show-source openstack setup.py
|
||||
|
||||
[testenv:pylint]
|
||||
deps = pylint
|
||||
commands = pylint --rcfile=pylintrc --output-format=parseable openstack
|
||||
|
||||
[testenv:cover]
|
||||
commands = nosetests --with-coverage --cover-html --cover-erase --cover-package=openstack
|
||||
|
||||
[testenv:sdist]
|
||||
commands = python setup.py sdist {posargs}
|
||||
|
||||
[testenv:hudson]
|
||||
downloadcache = ~/cache/pip
|
||||
|
||||
[testenv:jenkins26]
|
||||
basepython = python2.6
|
||||
deps = file://{toxinidir}/.cache.bundle
|
||||
|
||||
[testenv:jenkins27]
|
||||
basepython = python2.7
|
||||
deps = file://{toxinidir}/.cache.bundle
|
||||
|
||||
[testenv:jenkinscover]
|
||||
deps = file://{toxinidir}/.cache.bundle
|
||||
commands = nosetests --cover-erase --cover-package=openstack --with-xcoverage
|
||||
|
||||
|
||||
Reference in New Issue
Block a user