Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / setup.py @ adc82764

History | View | Annotate | Download (7.6 kB)

1 3eea2bc3 Constantinos Venetsanopoulos
# Copyright 2011, 2012, 2013 GRNET S.A. All rights reserved.
2 365f883f Vangelis Koukis
#
3 365f883f Vangelis Koukis
# Redistribution and use in source and binary forms, with or
4 365f883f Vangelis Koukis
# without modification, are permitted provided that the following
5 365f883f Vangelis Koukis
# conditions are met:
6 365f883f Vangelis Koukis
#
7 365f883f Vangelis Koukis
#   1. Redistributions of source code must retain the above
8 365f883f Vangelis Koukis
#      copyright notice, this list of conditions and the following
9 365f883f Vangelis Koukis
#      disclaimer.
10 365f883f Vangelis Koukis
#
11 365f883f Vangelis Koukis
#   2. Redistributions in binary form must reproduce the above
12 365f883f Vangelis Koukis
#      copyright notice, this list of conditions and the following
13 365f883f Vangelis Koukis
#      disclaimer in the documentation and/or other materials
14 365f883f Vangelis Koukis
#      provided with the distribution.
15 365f883f Vangelis Koukis
#
16 365f883f Vangelis Koukis
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17 365f883f Vangelis Koukis
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 365f883f Vangelis Koukis
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 365f883f Vangelis Koukis
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20 365f883f Vangelis Koukis
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 365f883f Vangelis Koukis
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 365f883f Vangelis Koukis
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 365f883f Vangelis Koukis
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 365f883f Vangelis Koukis
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 365f883f Vangelis Koukis
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26 365f883f Vangelis Koukis
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 365f883f Vangelis Koukis
# POSSIBILITY OF SUCH DAMAGE.
28 365f883f Vangelis Koukis
#
29 365f883f Vangelis Koukis
# The views and conclusions contained in the software and
30 365f883f Vangelis Koukis
# documentation are those of the authors and should not be
31 365f883f Vangelis Koukis
# interpreted as representing official policies, either expressed
32 365f883f Vangelis Koukis
# or implied, of GRNET S.A.
33 365f883f Vangelis Koukis
#
34 365f883f Vangelis Koukis
35 14a1245e Kostas Papadimitriou
import distribute_setup
36 14a1245e Kostas Papadimitriou
distribute_setup.use_setuptools()
37 966cbac2 Kostas Papadimitriou
38 14a1245e Kostas Papadimitriou
import os
39 b064bda7 Kostas Papadimitriou
40 b064bda7 Kostas Papadimitriou
from distutils.util import convert_path
41 b064bda7 Kostas Papadimitriou
from fnmatch import fnmatchcase
42 966cbac2 Kostas Papadimitriou
from setuptools import setup, find_packages
43 966cbac2 Kostas Papadimitriou
44 7376c0f9 Kostas Papadimitriou
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
45 9a32d894 Kostas Papadimitriou
46 07d104d8 Kostas Papadimitriou
from synnefo.versions.app import __version__
47 966cbac2 Kostas Papadimitriou
48 966cbac2 Kostas Papadimitriou
# Package info
49 07d104d8 Kostas Papadimitriou
VERSION = __version__
50 3eea2bc3 Constantinos Venetsanopoulos
SHORT_DESCRIPTION = 'Synnefo Compute, Network and Image component'
51 7376c0f9 Kostas Papadimitriou
52 7376c0f9 Kostas Papadimitriou
PACKAGES_ROOT = '.'
53 07d104d8 Kostas Papadimitriou
PACKAGES = find_packages(PACKAGES_ROOT)
54 966cbac2 Kostas Papadimitriou
55 966cbac2 Kostas Papadimitriou
# Package meta
56 966cbac2 Kostas Papadimitriou
CLASSIFIERS = []
57 966cbac2 Kostas Papadimitriou
58 966cbac2 Kostas Papadimitriou
# Package requirements
59 966cbac2 Kostas Papadimitriou
INSTALL_REQUIRES = [
60 eeda4702 Kostas Papadimitriou
    'Django >=1.2, <1.3',
61 7e4f3f3f Kostas Papadimitriou
    'simplejson>=2.1.1',
62 64e48fd1 Vangelis Koukis
    'pycurl>=7.19.0',
63 64e48fd1 Vangelis Koukis
    'python-dateutil>=1.4.1',
64 ef0744db Kostas Papadimitriou
    'IPy>=0.70',
65 ef0744db Kostas Papadimitriou
    'South>=0.7',
66 64e48fd1 Vangelis Koukis
    'pycrypto>=2.1.0',
67 ee11759d Kostas Papadimitriou
    'puka',
68 d76f1814 Kostas Papadimitriou
    'python-daemon>=1.5.5, <1.6',
69 8f63a115 Christos Stavrakakis
    'snf-common',
70 4acc516f Kostas Papadimitriou
    'vncauthproxy>=1.2',
71 900af240 Vangelis Koukis
    'south>=0.7, <=0.7.3',
72 8f63a115 Christos Stavrakakis
    'snf-pithos-backend',
73 f15a0994 Christos Stavrakakis
    'lockfile>=0.8, <0.9',
74 f15a0994 Christos Stavrakakis
    'ipaddr',
75 2c44b092 Christos Stavrakakis
    'setproctitle>=1.0.1',
76 9d889386 Olga Brani
    'bitarray>=0.8',
77 4b355d71 Christos Stavrakakis
    'objpool>=0.2',
78 468ba00b Ilias Tsitsimpis
    'astakosclient',
79 4d31ebc0 Olga Brani
    'snf-django-lib',
80 4b01493d Georgios D. Tsoukalas
    'snf-branding',
81 d986cb32 Christos Stavrakakis
    'snf-webproject',
82 d986cb32 Christos Stavrakakis
    'multiprocessing',
83 966cbac2 Kostas Papadimitriou
]
84 966cbac2 Kostas Papadimitriou
85 966cbac2 Kostas Papadimitriou
EXTRAS_REQUIRES = {
86 afc9e0ef Christos Stavrakakis
        'DISPATCHER': ['puka', 'python-daemon==1.5.5', 'lockfile==0.8',
87 afc9e0ef Christos Stavrakakis
                       'setproctitle>=1.0.1'],
88 966cbac2 Kostas Papadimitriou
        'SSH_KEYS': ['pycrypto==2.1.0'],
89 966cbac2 Kostas Papadimitriou
}
90 966cbac2 Kostas Papadimitriou
91 966cbac2 Kostas Papadimitriou
TESTS_REQUIRES = [
92 d4325f42 Christos Stavrakakis
    'factory_boy==2.1.0'
93 966cbac2 Kostas Papadimitriou
]
94 966cbac2 Kostas Papadimitriou
95 7376c0f9 Kostas Papadimitriou
96 b064bda7 Kostas Papadimitriou
# Provided as an attribute, so you can append to these instead
97 b064bda7 Kostas Papadimitriou
# of replicating them:
98 b064bda7 Kostas Papadimitriou
standard_exclude = ["*.py", "*.pyc", "*$py.class", "*~", ".*", "*.bak"]
99 b064bda7 Kostas Papadimitriou
standard_exclude_directories = [
100 b064bda7 Kostas Papadimitriou
    ".*", "CVS", "_darcs", "./build", "./dist", "EGG-INFO", "*.egg-info", "snf-0.7"
101 b064bda7 Kostas Papadimitriou
]
102 b064bda7 Kostas Papadimitriou
103 b064bda7 Kostas Papadimitriou
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
104 b064bda7 Kostas Papadimitriou
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
105 b064bda7 Kostas Papadimitriou
# Note: you may want to copy this into your setup.py file verbatim, as
106 b064bda7 Kostas Papadimitriou
# you can't import this from another package, when you don't know if
107 b064bda7 Kostas Papadimitriou
# that package is installed yet.
108 b064bda7 Kostas Papadimitriou
def find_package_data(
109 b064bda7 Kostas Papadimitriou
    where=".",
110 b064bda7 Kostas Papadimitriou
    package="",
111 b064bda7 Kostas Papadimitriou
    exclude=standard_exclude,
112 b064bda7 Kostas Papadimitriou
    exclude_directories=standard_exclude_directories,
113 b064bda7 Kostas Papadimitriou
    only_in_packages=True,
114 b064bda7 Kostas Papadimitriou
    show_ignored=False):
115 b064bda7 Kostas Papadimitriou
    """
116 b064bda7 Kostas Papadimitriou
    Return a dictionary suitable for use in ``package_data``
117 b064bda7 Kostas Papadimitriou
    in a distutils ``setup.py`` file.
118 b064bda7 Kostas Papadimitriou

119 b064bda7 Kostas Papadimitriou
    The dictionary looks like::
120 b064bda7 Kostas Papadimitriou

121 b064bda7 Kostas Papadimitriou
        {"package": [files]}
122 b064bda7 Kostas Papadimitriou

123 b064bda7 Kostas Papadimitriou
    Where ``files`` is a list of all the files in that package that
124 b064bda7 Kostas Papadimitriou
    don"t match anything in ``exclude``.
125 b064bda7 Kostas Papadimitriou

126 b064bda7 Kostas Papadimitriou
    If ``only_in_packages`` is true, then top-level directories that
127 b064bda7 Kostas Papadimitriou
    are not packages won"t be included (but directories under packages
128 b064bda7 Kostas Papadimitriou
    will).
129 b064bda7 Kostas Papadimitriou

130 b064bda7 Kostas Papadimitriou
    Directories matching any pattern in ``exclude_directories`` will
131 b064bda7 Kostas Papadimitriou
    be ignored; by default directories with leading ``.``, ``CVS``,
132 b064bda7 Kostas Papadimitriou
    and ``_darcs`` will be ignored.
133 b064bda7 Kostas Papadimitriou

134 b064bda7 Kostas Papadimitriou
    If ``show_ignored`` is true, then all the files that aren"t
135 b064bda7 Kostas Papadimitriou
    included in package data are shown on stderr (for debugging
136 b064bda7 Kostas Papadimitriou
    purposes).
137 b064bda7 Kostas Papadimitriou

138 b064bda7 Kostas Papadimitriou
    Note patterns use wildcards, or can be exact paths (including
139 b064bda7 Kostas Papadimitriou
    leading ``./``), and all searching is case-insensitive.
140 b064bda7 Kostas Papadimitriou
    """
141 b064bda7 Kostas Papadimitriou
    out = {}
142 b064bda7 Kostas Papadimitriou
    stack = [(convert_path(where), "", package, only_in_packages)]
143 b064bda7 Kostas Papadimitriou
    while stack:
144 b064bda7 Kostas Papadimitriou
        where, prefix, package, only_in_packages = stack.pop(0)
145 b064bda7 Kostas Papadimitriou
        for name in os.listdir(where):
146 b064bda7 Kostas Papadimitriou
            fn = os.path.join(where, name)
147 b064bda7 Kostas Papadimitriou
            if os.path.isdir(fn):
148 b064bda7 Kostas Papadimitriou
                bad_name = False
149 b064bda7 Kostas Papadimitriou
                for pattern in exclude_directories:
150 b064bda7 Kostas Papadimitriou
                    if (fnmatchcase(name, pattern)
151 b064bda7 Kostas Papadimitriou
                        or fn.lower() == pattern.lower()):
152 b064bda7 Kostas Papadimitriou
                        bad_name = True
153 b064bda7 Kostas Papadimitriou
                        if show_ignored:
154 b064bda7 Kostas Papadimitriou
                            print >> sys.stderr, (
155 b064bda7 Kostas Papadimitriou
                                "Directory %s ignored by pattern %s"
156 b064bda7 Kostas Papadimitriou
                                % (fn, pattern))
157 b064bda7 Kostas Papadimitriou
                        break
158 b064bda7 Kostas Papadimitriou
                if bad_name:
159 b064bda7 Kostas Papadimitriou
                    continue
160 b064bda7 Kostas Papadimitriou
                if (os.path.isfile(os.path.join(fn, "__init__.py"))
161 b064bda7 Kostas Papadimitriou
                    and not prefix):
162 b064bda7 Kostas Papadimitriou
                    if not package:
163 b064bda7 Kostas Papadimitriou
                        new_package = name
164 b064bda7 Kostas Papadimitriou
                    else:
165 b064bda7 Kostas Papadimitriou
                        new_package = package + "." + name
166 b064bda7 Kostas Papadimitriou
                    stack.append((fn, "", new_package, False))
167 b064bda7 Kostas Papadimitriou
                else:
168 b064bda7 Kostas Papadimitriou
                    stack.append((fn, prefix + name + "/", package, only_in_packages))
169 b064bda7 Kostas Papadimitriou
            elif package or not only_in_packages:
170 b064bda7 Kostas Papadimitriou
                # is a file
171 b064bda7 Kostas Papadimitriou
                bad_name = False
172 b064bda7 Kostas Papadimitriou
                for pattern in exclude:
173 b064bda7 Kostas Papadimitriou
                    if (fnmatchcase(name, pattern)
174 b064bda7 Kostas Papadimitriou
                        or fn.lower() == pattern.lower()):
175 b064bda7 Kostas Papadimitriou
                        bad_name = True
176 b064bda7 Kostas Papadimitriou
                        if show_ignored:
177 b064bda7 Kostas Papadimitriou
                            print >> sys.stderr, (
178 b064bda7 Kostas Papadimitriou
                                "File %s ignored by pattern %s"
179 b064bda7 Kostas Papadimitriou
                                % (fn, pattern))
180 b064bda7 Kostas Papadimitriou
                        break
181 b064bda7 Kostas Papadimitriou
                if bad_name:
182 b064bda7 Kostas Papadimitriou
                    continue
183 b064bda7 Kostas Papadimitriou
                out.setdefault(package, []).append(prefix+name)
184 b064bda7 Kostas Papadimitriou
    return out
185 966cbac2 Kostas Papadimitriou
186 7376c0f9 Kostas Papadimitriou
setup(
187 9c0ac5af Kostas Papadimitriou
    name = 'snf-cyclades-app',
188 966cbac2 Kostas Papadimitriou
    version = VERSION,
189 7376c0f9 Kostas Papadimitriou
    license = 'BSD',
190 5adcc57e Christos Stavrakakis
    url = 'http://www.synnefo.org/',
191 966cbac2 Kostas Papadimitriou
    description = SHORT_DESCRIPTION,
192 966cbac2 Kostas Papadimitriou
    classifiers = CLASSIFIERS,
193 966cbac2 Kostas Papadimitriou
194 5adcc57e Christos Stavrakakis
    author='Synnefo development team',
195 5adcc57e Christos Stavrakakis
    author_email='synnefo-devel@googlegroups.com',
196 5adcc57e Christos Stavrakakis
    maintainer='Synnefo development team',
197 5adcc57e Christos Stavrakakis
    maintainer_email='synnefo-devel@googlegroups.com',
198 966cbac2 Kostas Papadimitriou
199 07d104d8 Kostas Papadimitriou
    namespace_packages = ['synnefo', 'synnefo.versions'],
200 7376c0f9 Kostas Papadimitriou
    packages = PACKAGES,
201 7376c0f9 Kostas Papadimitriou
    package_dir= {'': PACKAGES_ROOT},
202 966cbac2 Kostas Papadimitriou
    include_package_data = True,
203 b064bda7 Kostas Papadimitriou
    package_data = find_package_data('.'),
204 966cbac2 Kostas Papadimitriou
    zip_safe = False,
205 966cbac2 Kostas Papadimitriou
206 966cbac2 Kostas Papadimitriou
    install_requires = INSTALL_REQUIRES,
207 966cbac2 Kostas Papadimitriou
    extras_require = EXTRAS_REQUIRES,
208 966cbac2 Kostas Papadimitriou
    tests_require = TESTS_REQUIRES,
209 966cbac2 Kostas Papadimitriou
210 3eea2bc3 Constantinos Venetsanopoulos
    dependency_links = ['http://www.synnefo.org/packages/pypi'],
211 9a32d894 Kostas Papadimitriou
212 966cbac2 Kostas Papadimitriou
    entry_points = {
213 966cbac2 Kostas Papadimitriou
     'console_scripts': [
214 3d975c75 Kostas Papadimitriou
         'snf-dispatcher = synnefo.logic.dispatcher:main',
215 966cbac2 Kostas Papadimitriou
         ],
216 7fb619a0 Kostas Papadimitriou
     'synnefo': [
217 2ce0636e Kostas Papadimitriou
         'default_settings = synnefo.app_settings.default',
218 2ce0636e Kostas Papadimitriou
         'web_apps = synnefo.app_settings:synnefo_web_apps',
219 2ce0636e Kostas Papadimitriou
         'web_middleware = synnefo.app_settings:synnefo_web_middleware',
220 0ed12c27 Kostas Papadimitriou
         'web_context_processors = synnefo.app_settings:synnefo_web_context_processors',
221 2ce0636e Kostas Papadimitriou
         'urls = synnefo.app_settings.urls:urlpatterns',
222 7df4ecdc Kostas Papadimitriou
         'web_static = synnefo.app_settings:synnefo_static_files',
223 7fb619a0 Kostas Papadimitriou
         ]
224 966cbac2 Kostas Papadimitriou
      },
225 07d104d8 Kostas Papadimitriou
)