diff options
author | Gabriel Hurley <gabriel@strikeawe.com> | 2012-07-03 20:46:40 -0700 |
---|---|---|
committer | Gabriel Hurley <gabriel@strikeawe.com> | 2012-07-03 20:46:40 -0700 |
commit | df106572ccedb6f1fe578018dddad9cb3f3e1800 (patch) | |
tree | 02a4a6f14488330c27670d9c9c1cbc06a3e67e56 /setup.py | |
parent | 2c0a8f3220e03170a52204e8251f735c50295096 (diff) | |
download | tuskar-ui-df106572ccedb6f1fe578018dddad9cb3f3e1800.tar.gz |
Includes LESS files in bdist packages.
Incidentally cleans up some files that didn't exist in the
MANIFEST.in file.
Fixes bug 1016085 but now needs to be followed by a fix for
bug 1020799 in the future.
Change-Id: I8a53bb17f14afdad61513afa67de7134722c49e9
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 65 |
1 files changed, 55 insertions, 10 deletions
@@ -20,23 +20,67 @@ # under the License. import os -import re -import setuptools + +from distutils.core import setup +from distutils.command.install import INSTALL_SCHEMES + from horizon import version +from horizon.openstack.common import setup as os_common_setup -from horizon.openstack.common import setup -requires = setup.parse_requirements() -depend_links = setup.parse_dependency_links() -tests_require = setup.parse_requirements(['tools/test-requires']) +requires = os_common_setup.parse_requirements() +depend_links = os_common_setup.parse_dependency_links() +tests_require = os_common_setup.parse_requirements(['tools/test-requires']) ROOT = os.path.dirname(__file__) +target_dirs = ['horizon', 'openstack_dashboard', 'bin'] + def read(fname): return open(os.path.join(ROOT, fname)).read() -setuptools.setup(name="horizon", +def split(path, result=None): + """ + Split a path into components in a platform-neutral way. + """ + if result is None: + result = [] + head, tail = os.path.split(path) + if head == '': + return [tail] + result + if head == path: + return result + return split(head, [tail] + result) + + +# Tell distutils not to put the data_files in platform-specific installation +# locations. See here for an explanation: +# https://groups.google.com/forum/#!topic/comp.lang.python/Nex7L-026uw +for scheme in INSTALL_SCHEMES.values(): + scheme['data'] = scheme['purelib'] + +# Compile the list of packages available, because distutils doesn't have +# an easy way to do this. +packages, data_files = [], [] +root_dir = os.path.dirname(__file__) +if root_dir != '': + os.chdir(root_dir) + +for target_dir in target_dirs: + for dirpath, dirnames, filenames in os.walk(target_dir): + # Ignore dirnames that start with '.' + for i, dirname in enumerate(dirnames): + if dirname.startswith('.'): + del dirnames[i] + if '__init__.py' in filenames: + packages.append('.'.join(split(dirpath))) + elif filenames: + data_files.append([dirpath, [os.path.join(dirpath, f) + for f in filenames]]) + + +setup(name="horizon", version=version.canonical_version_string(), url='https://github.com/openstack/horizon/', license='Apache 2.0', @@ -44,14 +88,15 @@ setuptools.setup(name="horizon", long_description=read('README.rst'), author='OpenStack', author_email='horizon@lists.launchpad.net', - packages=setuptools.find_packages(), - cmdclass=setup.get_cmdclass(), + packages=packages, + data_files=data_files, + cmdclass=os_common_setup.get_cmdclass(), include_package_data=True, install_requires=requires, tests_require=tests_require, dependency_links=depend_links, zip_safe=False, - classifiers=['Development Status :: 4 - Beta', + classifiers=['Development Status :: 5 - Production/Stable', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', |