Makes setup.py actually list it's dependencies for pip/easy_install.

Change-Id: I9b774f5d64662f67d2a4dd2d1dd4dc59be0f45df
This commit is contained in:
Gabriel Hurley 2012-02-29 17:31:12 -08:00
parent a67402595b
commit 2042b89649
4 changed files with 50 additions and 11 deletions

2
.gitignore vendored
View File

@ -13,3 +13,5 @@ openstack_dashboard/local/local_settings.py
docs/build/
docs/source/sourcecode
.venv
build
dist

View File

@ -19,12 +19,52 @@
# under the License.
import os
from setuptools import setup, find_packages, findall
import re
from setuptools import setup, find_packages
from horizon import version
ROOT = os.path.dirname(__file__)
PIP_REQUIRES = os.path.join(ROOT, "tools", "pip-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):
requirements = []
for f in filenames:
for line in open(f, 'r').read().split('\n'):
if re.match(r'(\s*#)|(\s*$)', line):
continue
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(*filenames):
dependency_links = []
for f in filenames:
for line in open(f, 'r').read().split('\n'):
if re.match(r'\s*-[ef]\s+', line):
line = re.sub(r'\s*-[ef]\s+', '', line)
line = re.sub(r'\s*git\+https', 'http', line)
line = re.sub(r'\.git#', '/tarball/master#', line)
dependency_links.append(line)
return dependency_links
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
return open(os.path.join(ROOT, fname)).read()
setup(name="horizon",
@ -36,12 +76,9 @@ setup(name="horizon",
author='Devin Carlen',
author_email='devin.carlen@gmail.com',
packages=find_packages(),
package_data={'horizon': [s[len('horizon/'):] for s in
findall('horizon/templates') \
+ findall('horizon/dashboards/nova/templates') \
+ findall('horizon/dashboards/syspanel/templates') \
+ findall('horizon/dashboards/settings/templates')]},
install_requires=[],
zip_safe=False,
install_requires=parse_requirements(PIP_REQUIRES, TEST_REQUIRES),
dependency_links=parse_dependency_links(PIP_REQUIRES, TEST_REQUIRES),
classifiers=['Development Status :: 4 - Beta',
'Framework :: Django',
'Intended Audience :: Developers',

View File

@ -19,5 +19,5 @@ iso8601
# Horizon Non-pip Requirements
-e git+https://github.com/openstack/python-novaclient.git#egg=python-novaclient
-e git+https://github.com/openstack/python-keystoneclient.git#egg=python-keystoneclient
-e git+https://github.com/openstack/python-quantumclient.git#egg=python-quantumclient-dev
-e git+https://github.com/openstack/python-quantumclient.git#egg=python-quantumclient
-e git+https://github.com/openstack/glance.git#egg=glance

View File

@ -1,10 +1,10 @@
# Testing Requirements
CherryPy
coverage
django-nose==0.1.2
django-nose
django-nose-selenium
mox
nose==1.0.0
nose
pep8
pylint