19
19
# under the License.
22
from setuptools import setup, find_packages, findall
23
from setuptools import setup, find_packages
23
24
from horizon import version
27
ROOT = os.path.dirname(__file__)
28
PIP_REQUIRES = os.path.join(ROOT, "tools", "pip-requires")
29
TEST_REQUIRES = os.path.join(ROOT, "tools", "test-requires")
32
def parse_requirements(*filenames):
34
We generate our install_requires from the pip-requires and test-requires
35
files so that we don't have to maintain the dependency definitions in
40
for line in open(f, 'r').read().split('\n'):
41
# Comment lines. Skip.
42
if re.match(r'(\s*#)|(\s*$)', line):
44
# Editable matches. Put the egg name into our reqs list.
45
if re.match(r'\s*-e\s+', line):
46
pkg = re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1', line)
47
requirements.append("%s" % pkg)
48
# File-based installs not supported/needed. Skip.
49
elif re.match(r'\s*-f\s+', line):
52
requirements.append(line)
56
def parse_dependency_links(*filenames):
58
We generate our dependency_links from the pip-requires and test-requires
59
files for the dependencies pulled from github (prepended with -e).
63
for line in open(f, 'r').read().split('\n'):
64
if re.match(r'\s*-[ef]\s+', line):
65
line = re.sub(r'\s*-[ef]\s+', '', line)
66
line = re.sub(r'\s*git\+https', 'http', line)
67
line = re.sub(r'\.git#', '/tarball/master#', line)
68
dependency_links.append(line)
69
return dependency_links
27
return open(os.path.join(os.path.dirname(__file__), fname)).read()
73
return open(os.path.join(ROOT, fname)).read()
30
76
setup(name="horizon",
33
79
license='Apache 2.0',
34
80
description="The OpenStack Dashboard.",
35
81
long_description=read('README.rst'),
36
author='Devin Carlen',
37
author_email='devin.carlen@gmail.com',
83
author_email='horizon@lists.launchpad.net',
38
84
packages=find_packages(),
39
85
include_package_data=True,
40
package_data={'horizon': [s[len('horizon/'):] for s in
41
findall('horizon/templates') \
42
+ findall('horizon/dashboards/nova/templates') \
43
+ findall('horizon/dashboards/syspanel/templates') \
44
+ findall('horizon/dashboards/settings/templates')]},
87
install_requires=parse_requirements(PIP_REQUIRES),
88
tests_require=parse_requirements(TEST_REQUIRES),
89
dependency_links=parse_dependency_links(PIP_REQUIRES, TEST_REQUIRES),
46
90
classifiers=['Development Status :: 4 - Beta',
47
91
'Framework :: Django',
48
92
'Intended Audience :: Developers',