Makes setup.py actually list it's dependencies for pip/easy_install.
Change-Id: I9b774f5d64662f67d2a4dd2d1dd4dc59be0f45df
This commit is contained in:
parent
a67402595b
commit
2042b89649
2
.gitignore
vendored
2
.gitignore
vendored
@ -13,3 +13,5 @@ openstack_dashboard/local/local_settings.py
|
|||||||
docs/build/
|
docs/build/
|
||||||
docs/source/sourcecode
|
docs/source/sourcecode
|
||||||
.venv
|
.venv
|
||||||
|
build
|
||||||
|
dist
|
||||||
|
53
setup.py
53
setup.py
@ -19,12 +19,52 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from setuptools import setup, find_packages, findall
|
import re
|
||||||
|
from setuptools import setup, find_packages
|
||||||
from horizon import version
|
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):
|
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",
|
setup(name="horizon",
|
||||||
@ -36,12 +76,9 @@ setup(name="horizon",
|
|||||||
author='Devin Carlen',
|
author='Devin Carlen',
|
||||||
author_email='devin.carlen@gmail.com',
|
author_email='devin.carlen@gmail.com',
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
package_data={'horizon': [s[len('horizon/'):] for s in
|
zip_safe=False,
|
||||||
findall('horizon/templates') \
|
install_requires=parse_requirements(PIP_REQUIRES, TEST_REQUIRES),
|
||||||
+ findall('horizon/dashboards/nova/templates') \
|
dependency_links=parse_dependency_links(PIP_REQUIRES, TEST_REQUIRES),
|
||||||
+ findall('horizon/dashboards/syspanel/templates') \
|
|
||||||
+ findall('horizon/dashboards/settings/templates')]},
|
|
||||||
install_requires=[],
|
|
||||||
classifiers=['Development Status :: 4 - Beta',
|
classifiers=['Development Status :: 4 - Beta',
|
||||||
'Framework :: Django',
|
'Framework :: Django',
|
||||||
'Intended Audience :: Developers',
|
'Intended Audience :: Developers',
|
||||||
|
@ -19,5 +19,5 @@ iso8601
|
|||||||
# Horizon Non-pip Requirements
|
# Horizon Non-pip Requirements
|
||||||
-e git+https://github.com/openstack/python-novaclient.git#egg=python-novaclient
|
-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-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
|
-e git+https://github.com/openstack/glance.git#egg=glance
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# Testing Requirements
|
# Testing Requirements
|
||||||
CherryPy
|
CherryPy
|
||||||
coverage
|
coverage
|
||||||
django-nose==0.1.2
|
django-nose
|
||||||
django-nose-selenium
|
django-nose-selenium
|
||||||
mox
|
mox
|
||||||
nose==1.0.0
|
nose
|
||||||
pep8
|
pep8
|
||||||
pylint
|
pylint
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user