One last redux for setup.py requirement parsing.
Working around some limitations of setuptools/distribute/distutils in order to get the right versions of everything installed. Splits requirements out between core requirements and testing requirements. Change-Id: I2157527a91041a6297efe689b2a709f47fc605d8
This commit is contained in:
parent
c16ba74d9f
commit
f5a8fd4404
31
setup.py
31
setup.py
@ -29,20 +29,24 @@ PIP_REQUIRES = os.path.join(ROOT, "tools", "pip-requires")
|
|||||||
TEST_REQUIRES = os.path.join(ROOT, "tools", "test-requires")
|
TEST_REQUIRES = os.path.join(ROOT, "tools", "test-requires")
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
We generate our install_requires and dependency_links from the
|
|
||||||
files listed in pip-requires and test-requires so that we don't have
|
|
||||||
to maintain the dependency definitions in two places.
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
def parse_requirements(*filenames):
|
def parse_requirements(*filenames):
|
||||||
|
"""
|
||||||
|
We generate our install_requires from the pip-requires and test-requires
|
||||||
|
files so that we don't have to maintain the dependency definitions in
|
||||||
|
two places.
|
||||||
|
"""
|
||||||
requirements = []
|
requirements = []
|
||||||
for f in filenames:
|
for f in filenames:
|
||||||
for line in open(f, 'r').read().split('\n'):
|
for line in open(f, 'r').read().split('\n'):
|
||||||
|
# Comment lines. Skip.
|
||||||
if re.match(r'(\s*#)|(\s*$)', line):
|
if re.match(r'(\s*#)|(\s*$)', line):
|
||||||
continue
|
continue
|
||||||
elif re.match(r'\s*-[ef]\s+', line):
|
# Editable matches. Put the egg name into our reqs list.
|
||||||
|
if re.match(r'\s*-e\s+', line):
|
||||||
|
pkg = re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1', line)
|
||||||
|
requirements.append("%s" % pkg)
|
||||||
|
# File-based installs not supported/needed. Skip.
|
||||||
|
elif re.match(r'\s*-f\s+', line):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
requirements.append(line)
|
requirements.append(line)
|
||||||
@ -50,6 +54,10 @@ def parse_requirements(*filenames):
|
|||||||
|
|
||||||
|
|
||||||
def parse_dependency_links(*filenames):
|
def parse_dependency_links(*filenames):
|
||||||
|
"""
|
||||||
|
We generate our dependency_links from the pip-requires and test-requires
|
||||||
|
files for the dependencies pulled from github (prepended with -e).
|
||||||
|
"""
|
||||||
dependency_links = []
|
dependency_links = []
|
||||||
for f in filenames:
|
for f in filenames:
|
||||||
for line in open(f, 'r').read().split('\n'):
|
for line in open(f, 'r').read().split('\n'):
|
||||||
@ -71,12 +79,13 @@ setup(name="horizon",
|
|||||||
license='Apache 2.0',
|
license='Apache 2.0',
|
||||||
description="The OpenStack Dashboard.",
|
description="The OpenStack Dashboard.",
|
||||||
long_description=read('README.rst'),
|
long_description=read('README.rst'),
|
||||||
author='Devin Carlen',
|
author='OpenStack',
|
||||||
author_email='devin.carlen@gmail.com',
|
author_email='horizon@lists.launchpad.net',
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
install_requires=parse_requirements(PIP_REQUIRES, TEST_REQUIRES),
|
install_requires=parse_requirements(PIP_REQUIRES),
|
||||||
|
tests_require=parse_requirements(TEST_REQUIRES),
|
||||||
dependency_links=parse_dependency_links(PIP_REQUIRES, TEST_REQUIRES),
|
dependency_links=parse_dependency_links(PIP_REQUIRES, TEST_REQUIRES),
|
||||||
classifiers=['Development Status :: 4 - Beta',
|
classifiers=['Development Status :: 4 - Beta',
|
||||||
'Framework :: Django',
|
'Framework :: Django',
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
Django>=1.3
|
Django>=1.3
|
||||||
python-cloudfiles
|
python-cloudfiles
|
||||||
python-dateutil
|
python-dateutil
|
||||||
|
django-nose
|
||||||
|
|
||||||
# Glance Requirements
|
# Glance Requirements
|
||||||
PasteDeploy
|
PasteDeploy
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
# Testing Requirements
|
# Testing Requirements
|
||||||
CherryPy
|
CherryPy
|
||||||
coverage
|
coverage
|
||||||
django-nose
|
|
||||||
django-nose-selenium
|
django-nose-selenium
|
||||||
mox
|
mox
|
||||||
nose
|
nose
|
||||||
|
Loading…
Reference in New Issue
Block a user