Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / setup.py @ 17ab1a48

History | View | Annotate | Download (7.7 kB)

1 365f883f Vangelis Koukis
# Copyright 2011 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 9a32d894 Kostas Papadimitriou
try:
47 9a32d894 Kostas Papadimitriou
    # try to update the version file
48 9a32d894 Kostas Papadimitriou
    from synnefo.util.version import update_version
49 9a32d894 Kostas Papadimitriou
    update_version('synnefo.versions', 'app', HERE)
50 9a32d894 Kostas Papadimitriou
except ImportError:
51 9a32d894 Kostas Papadimitriou
    pass
52 9a32d894 Kostas Papadimitriou
53 07d104d8 Kostas Papadimitriou
from synnefo.versions.app import __version__
54 966cbac2 Kostas Papadimitriou
55 966cbac2 Kostas Papadimitriou
# Package info
56 07d104d8 Kostas Papadimitriou
VERSION = __version__
57 7376c0f9 Kostas Papadimitriou
README = open(os.path.join(HERE, 'README')).read()
58 7376c0f9 Kostas Papadimitriou
CHANGES = open(os.path.join(HERE, 'Changelog')).read()
59 7376c0f9 Kostas Papadimitriou
SHORT_DESCRIPTION = 'Package short description'
60 7376c0f9 Kostas Papadimitriou
61 7376c0f9 Kostas Papadimitriou
PACKAGES_ROOT = '.'
62 07d104d8 Kostas Papadimitriou
PACKAGES = find_packages(PACKAGES_ROOT)
63 966cbac2 Kostas Papadimitriou
64 966cbac2 Kostas Papadimitriou
# Package meta
65 966cbac2 Kostas Papadimitriou
CLASSIFIERS = []
66 966cbac2 Kostas Papadimitriou
67 966cbac2 Kostas Papadimitriou
# Package requirements
68 966cbac2 Kostas Papadimitriou
INSTALL_REQUIRES = [
69 eeda4702 Kostas Papadimitriou
    'Django >=1.2, <1.3',
70 7e4f3f3f Kostas Papadimitriou
    'simplejson>=2.1.1',
71 64e48fd1 Vangelis Koukis
    'pycurl>=7.19.0',
72 64e48fd1 Vangelis Koukis
    'python-dateutil>=1.4.1',
73 ef0744db Kostas Papadimitriou
    'IPy>=0.70',
74 ef0744db Kostas Papadimitriou
    'South>=0.7',
75 64e48fd1 Vangelis Koukis
    'pycrypto>=2.1.0',
76 ee11759d Kostas Papadimitriou
    'puka',
77 d76f1814 Kostas Papadimitriou
    'python-daemon>=1.5.5, <1.6',
78 ee11759d Kostas Papadimitriou
    'snf-common>0.9.14',
79 4acc516f Kostas Papadimitriou
    'vncauthproxy>=1.2',
80 900af240 Vangelis Koukis
    'south>=0.7, <=0.7.3',
81 0d316750 Giorgos Verigakis
    'snf-pithos-backend>=0.9.1',
82 07a74632 Kostas Papadimitriou
    'lockfile>=0.8, <0.9'
83 966cbac2 Kostas Papadimitriou
]
84 966cbac2 Kostas Papadimitriou
85 966cbac2 Kostas Papadimitriou
EXTRAS_REQUIRES = {
86 ee11759d Kostas Papadimitriou
        'DISPATCHER': ['puka', 'python-daemon==1.5.5', 'lockfile==0.8'],
87 966cbac2 Kostas Papadimitriou
        'SSH_KEYS': ['pycrypto==2.1.0'],
88 966cbac2 Kostas Papadimitriou
}
89 966cbac2 Kostas Papadimitriou
90 966cbac2 Kostas Papadimitriou
TESTS_REQUIRES = [
91 966cbac2 Kostas Papadimitriou
]
92 966cbac2 Kostas Papadimitriou
93 7376c0f9 Kostas Papadimitriou
94 b064bda7 Kostas Papadimitriou
# Provided as an attribute, so you can append to these instead
95 b064bda7 Kostas Papadimitriou
# of replicating them:
96 b064bda7 Kostas Papadimitriou
standard_exclude = ["*.py", "*.pyc", "*$py.class", "*~", ".*", "*.bak"]
97 b064bda7 Kostas Papadimitriou
standard_exclude_directories = [
98 b064bda7 Kostas Papadimitriou
    ".*", "CVS", "_darcs", "./build", "./dist", "EGG-INFO", "*.egg-info", "snf-0.7"
99 b064bda7 Kostas Papadimitriou
]
100 b064bda7 Kostas Papadimitriou
101 b064bda7 Kostas Papadimitriou
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
102 b064bda7 Kostas Papadimitriou
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
103 b064bda7 Kostas Papadimitriou
# Note: you may want to copy this into your setup.py file verbatim, as
104 b064bda7 Kostas Papadimitriou
# you can't import this from another package, when you don't know if
105 b064bda7 Kostas Papadimitriou
# that package is installed yet.
106 b064bda7 Kostas Papadimitriou
def find_package_data(
107 b064bda7 Kostas Papadimitriou
    where=".",
108 b064bda7 Kostas Papadimitriou
    package="",
109 b064bda7 Kostas Papadimitriou
    exclude=standard_exclude,
110 b064bda7 Kostas Papadimitriou
    exclude_directories=standard_exclude_directories,
111 b064bda7 Kostas Papadimitriou
    only_in_packages=True,
112 b064bda7 Kostas Papadimitriou
    show_ignored=False):
113 b064bda7 Kostas Papadimitriou
    """
114 b064bda7 Kostas Papadimitriou
    Return a dictionary suitable for use in ``package_data``
115 b064bda7 Kostas Papadimitriou
    in a distutils ``setup.py`` file.
116 b064bda7 Kostas Papadimitriou

117 b064bda7 Kostas Papadimitriou
    The dictionary looks like::
118 b064bda7 Kostas Papadimitriou

119 b064bda7 Kostas Papadimitriou
        {"package": [files]}
120 b064bda7 Kostas Papadimitriou

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

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

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

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

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