Browse Source

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
Gabriel Hurley 6 years ago
parent
commit
df106572cc
2 changed files with 56 additions and 11 deletions
  1. 1
    1
      MANIFEST.in
  2. 55
    10
      setup.py

+ 1
- 1
MANIFEST.in View File

@@ -1,7 +1,7 @@
1 1
 recursive-include bin *.js
2 2
 recursive-include doc *.py *.rst *.css *.js *.html *.conf *.jpg *.gif *.png *.css_t
3 3
 recursive-include horizon *.html *.css *.js *.csv *.template *.tmpl *.mo *.po
4
-recursive-include openstack_dashboard *.html *.js *.css *.less *.csv *.template *.mo *.po *.example *.eot *.svg *.ttf *.woff *.png *.gif *.ico *.wsgi
4
+recursive-include openstack_dashboard *.html *.js *.less *.mo *.po *.example *.eot *.svg *.ttf *.woff *.png *.ico *.wsgi
5 5
 recursive-include tools *.py *.sh
6 6
 
7 7
 include AUTHORS

+ 55
- 10
setup.py View File

@@ -20,23 +20,67 @@
20 20
 #    under the License.
21 21
 
22 22
 import os
23
-import re
24
-import setuptools
23
+
24
+from distutils.core import setup
25
+from distutils.command.install import INSTALL_SCHEMES
26
+
25 27
 from horizon import version
28
+from horizon.openstack.common import setup as os_common_setup
26 29
 
27
-from horizon.openstack.common import setup
28 30
 
29
-requires = setup.parse_requirements()
30
-depend_links = setup.parse_dependency_links()
31
-tests_require = setup.parse_requirements(['tools/test-requires'])
31
+requires = os_common_setup.parse_requirements()
32
+depend_links = os_common_setup.parse_dependency_links()
33
+tests_require = os_common_setup.parse_requirements(['tools/test-requires'])
32 34
 
33 35
 ROOT = os.path.dirname(__file__)
36
+target_dirs = ['horizon', 'openstack_dashboard', 'bin']
37
+
34 38
 
35 39
 def read(fname):
36 40
     return open(os.path.join(ROOT, fname)).read()
37 41
 
38 42
 
39
-setuptools.setup(name="horizon",
43
+def split(path, result=None):
44
+    """
45
+    Split a path into components in a platform-neutral way.
46
+    """
47
+    if result is None:
48
+        result = []
49
+    head, tail = os.path.split(path)
50
+    if head == '':
51
+        return [tail] + result
52
+    if head == path:
53
+        return result
54
+    return split(head, [tail] + result)
55
+
56
+
57
+# Tell distutils not to put the data_files in platform-specific installation
58
+# locations. See here for an explanation:
59
+# https://groups.google.com/forum/#!topic/comp.lang.python/Nex7L-026uw
60
+for scheme in INSTALL_SCHEMES.values():
61
+    scheme['data'] = scheme['purelib']
62
+
63
+# Compile the list of packages available, because distutils doesn't have
64
+# an easy way to do this.
65
+packages, data_files = [], []
66
+root_dir = os.path.dirname(__file__)
67
+if root_dir != '':
68
+    os.chdir(root_dir)
69
+
70
+for target_dir in target_dirs:
71
+    for dirpath, dirnames, filenames in os.walk(target_dir):
72
+        # Ignore dirnames that start with '.'
73
+        for i, dirname in enumerate(dirnames):
74
+            if dirname.startswith('.'):
75
+                del dirnames[i]
76
+        if '__init__.py' in filenames:
77
+            packages.append('.'.join(split(dirpath)))
78
+        elif filenames:
79
+            data_files.append([dirpath, [os.path.join(dirpath, f)
80
+                               for f in filenames]])
81
+
82
+
83
+setup(name="horizon",
40 84
       version=version.canonical_version_string(),
41 85
       url='https://github.com/openstack/horizon/',
42 86
       license='Apache 2.0',
@@ -44,14 +88,15 @@ setuptools.setup(name="horizon",
44 88
       long_description=read('README.rst'),
45 89
       author='OpenStack',
46 90
       author_email='horizon@lists.launchpad.net',
47
-      packages=setuptools.find_packages(),
48
-      cmdclass=setup.get_cmdclass(),
91
+      packages=packages,
92
+      data_files=data_files,
93
+      cmdclass=os_common_setup.get_cmdclass(),
49 94
       include_package_data=True,
50 95
       install_requires=requires,
51 96
       tests_require=tests_require,
52 97
       dependency_links=depend_links,
53 98
       zip_safe=False,
54
-      classifiers=['Development Status :: 4 - Beta',
99
+      classifiers=['Development Status :: 5 - Production/Stable',
55 100
                    'Framework :: Django',
56 101
                    'Intended Audience :: Developers',
57 102
                    'License :: OSI Approved :: Apache Software License',

Loading…
Cancel
Save