root / snf-cyclades-app / setup.py @ 998f872c
History | View | Annotate | Download (7.6 kB)
1 |
# Copyright 2011 GRNET S.A. All rights reserved.
|
---|---|
2 |
#
|
3 |
# Redistribution and use in source and binary forms, with or
|
4 |
# without modification, are permitted provided that the following
|
5 |
# conditions are met:
|
6 |
#
|
7 |
# 1. Redistributions of source code must retain the above
|
8 |
# copyright notice, this list of conditions and the following
|
9 |
# disclaimer.
|
10 |
#
|
11 |
# 2. Redistributions in binary form must reproduce the above
|
12 |
# copyright notice, this list of conditions and the following
|
13 |
# disclaimer in the documentation and/or other materials
|
14 |
# provided with the distribution.
|
15 |
#
|
16 |
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
|
17 |
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
18 |
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
19 |
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
|
20 |
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21 |
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22 |
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
23 |
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
24 |
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
25 |
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
26 |
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
27 |
# POSSIBILITY OF SUCH DAMAGE.
|
28 |
#
|
29 |
# The views and conclusions contained in the software and
|
30 |
# documentation are those of the authors and should not be
|
31 |
# interpreted as representing official policies, either expressed
|
32 |
# or implied, of GRNET S.A.
|
33 |
#
|
34 |
|
35 |
import distribute_setup |
36 |
distribute_setup.use_setuptools() |
37 |
|
38 |
import os |
39 |
|
40 |
from distutils.util import convert_path |
41 |
from fnmatch import fnmatchcase |
42 |
from setuptools import setup, find_packages |
43 |
|
44 |
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__))) |
45 |
|
46 |
from synnefo.versions.app import __version__ |
47 |
|
48 |
# Package info
|
49 |
VERSION = __version__ |
50 |
README = open(os.path.join(HERE, 'README')).read() |
51 |
CHANGES = open(os.path.join(HERE, 'Changelog')).read() |
52 |
SHORT_DESCRIPTION = 'Package short description'
|
53 |
|
54 |
PACKAGES_ROOT = '.'
|
55 |
PACKAGES = find_packages(PACKAGES_ROOT) |
56 |
|
57 |
# Package meta
|
58 |
CLASSIFIERS = [] |
59 |
|
60 |
# Package requirements
|
61 |
INSTALL_REQUIRES = [ |
62 |
'Django >=1.2, <1.3',
|
63 |
'simplejson>=2.1.1',
|
64 |
'pycurl>=7.19.0',
|
65 |
'python-dateutil>=1.4.1',
|
66 |
'IPy>=0.70',
|
67 |
'South>=0.7',
|
68 |
'pycrypto>=2.1.0',
|
69 |
'puka',
|
70 |
'python-daemon>=1.5.5, <1.6',
|
71 |
'snf-common',
|
72 |
'vncauthproxy>=1.2',
|
73 |
'south>=0.7, <=0.7.3',
|
74 |
'snf-pithos-backend',
|
75 |
'lockfile>=0.8, <0.9',
|
76 |
'ipaddr',
|
77 |
'setproctitle>=1.0.1',
|
78 |
'bitarray>=0.8'
|
79 |
] |
80 |
|
81 |
EXTRAS_REQUIRES = { |
82 |
'DISPATCHER': ['puka', 'python-daemon==1.5.5', 'lockfile==0.8', |
83 |
'setproctitle>=1.0.1'],
|
84 |
'SSH_KEYS': ['pycrypto==2.1.0'], |
85 |
} |
86 |
|
87 |
TESTS_REQUIRES = [ |
88 |
'factory_boy'
|
89 |
] |
90 |
|
91 |
|
92 |
# Provided as an attribute, so you can append to these instead
|
93 |
# of replicating them:
|
94 |
standard_exclude = ["*.py", "*.pyc", "*$py.class", "*~", ".*", "*.bak"] |
95 |
standard_exclude_directories = [ |
96 |
".*", "CVS", "_darcs", "./build", "./dist", "EGG-INFO", "*.egg-info", "snf-0.7" |
97 |
] |
98 |
|
99 |
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
|
100 |
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
|
101 |
# Note: you may want to copy this into your setup.py file verbatim, as
|
102 |
# you can't import this from another package, when you don't know if
|
103 |
# that package is installed yet.
|
104 |
def find_package_data( |
105 |
where=".",
|
106 |
package="",
|
107 |
exclude=standard_exclude, |
108 |
exclude_directories=standard_exclude_directories, |
109 |
only_in_packages=True,
|
110 |
show_ignored=False):
|
111 |
"""
|
112 |
Return a dictionary suitable for use in ``package_data``
|
113 |
in a distutils ``setup.py`` file.
|
114 |
|
115 |
The dictionary looks like::
|
116 |
|
117 |
{"package": [files]}
|
118 |
|
119 |
Where ``files`` is a list of all the files in that package that
|
120 |
don"t match anything in ``exclude``.
|
121 |
|
122 |
If ``only_in_packages`` is true, then top-level directories that
|
123 |
are not packages won"t be included (but directories under packages
|
124 |
will).
|
125 |
|
126 |
Directories matching any pattern in ``exclude_directories`` will
|
127 |
be ignored; by default directories with leading ``.``, ``CVS``,
|
128 |
and ``_darcs`` will be ignored.
|
129 |
|
130 |
If ``show_ignored`` is true, then all the files that aren"t
|
131 |
included in package data are shown on stderr (for debugging
|
132 |
purposes).
|
133 |
|
134 |
Note patterns use wildcards, or can be exact paths (including
|
135 |
leading ``./``), and all searching is case-insensitive.
|
136 |
"""
|
137 |
out = {} |
138 |
stack = [(convert_path(where), "", package, only_in_packages)]
|
139 |
while stack:
|
140 |
where, prefix, package, only_in_packages = stack.pop(0)
|
141 |
for name in os.listdir(where): |
142 |
fn = os.path.join(where, name) |
143 |
if os.path.isdir(fn):
|
144 |
bad_name = False
|
145 |
for pattern in exclude_directories: |
146 |
if (fnmatchcase(name, pattern)
|
147 |
or fn.lower() == pattern.lower()):
|
148 |
bad_name = True
|
149 |
if show_ignored:
|
150 |
print >> sys.stderr, (
|
151 |
"Directory %s ignored by pattern %s"
|
152 |
% (fn, pattern)) |
153 |
break
|
154 |
if bad_name:
|
155 |
continue
|
156 |
if (os.path.isfile(os.path.join(fn, "__init__.py")) |
157 |
and not prefix): |
158 |
if not package: |
159 |
new_package = name |
160 |
else:
|
161 |
new_package = package + "." + name
|
162 |
stack.append((fn, "", new_package, False)) |
163 |
else:
|
164 |
stack.append((fn, prefix + name + "/", package, only_in_packages))
|
165 |
elif package or not only_in_packages: |
166 |
# is a file
|
167 |
bad_name = False
|
168 |
for pattern in exclude: |
169 |
if (fnmatchcase(name, pattern)
|
170 |
or fn.lower() == pattern.lower()):
|
171 |
bad_name = True
|
172 |
if show_ignored:
|
173 |
print >> sys.stderr, (
|
174 |
"File %s ignored by pattern %s"
|
175 |
% (fn, pattern)) |
176 |
break
|
177 |
if bad_name:
|
178 |
continue
|
179 |
out.setdefault(package, []).append(prefix+name) |
180 |
return out
|
181 |
|
182 |
setup( |
183 |
name = 'snf-cyclades-app',
|
184 |
version = VERSION, |
185 |
license = 'BSD',
|
186 |
url = 'http://www.synnefo.org/',
|
187 |
description = SHORT_DESCRIPTION, |
188 |
long_description=README + '\n\n' + CHANGES,
|
189 |
classifiers = CLASSIFIERS, |
190 |
|
191 |
author='Synnefo development team',
|
192 |
author_email='synnefo-devel@googlegroups.com',
|
193 |
maintainer='Synnefo development team',
|
194 |
maintainer_email='synnefo-devel@googlegroups.com',
|
195 |
|
196 |
namespace_packages = ['synnefo', 'synnefo.versions'], |
197 |
packages = PACKAGES, |
198 |
package_dir= {'': PACKAGES_ROOT},
|
199 |
include_package_data = True,
|
200 |
package_data = find_package_data('.'),
|
201 |
zip_safe = False,
|
202 |
|
203 |
install_requires = INSTALL_REQUIRES, |
204 |
extras_require = EXTRAS_REQUIRES, |
205 |
tests_require = TESTS_REQUIRES, |
206 |
|
207 |
dependency_links = ['http://docs.dev.grnet.gr/pypi'],
|
208 |
|
209 |
entry_points = { |
210 |
'console_scripts': [
|
211 |
'snf-dispatcher = synnefo.logic.dispatcher:main',
|
212 |
], |
213 |
'synnefo': [
|
214 |
'default_settings = synnefo.app_settings.default',
|
215 |
'web_apps = synnefo.app_settings:synnefo_web_apps',
|
216 |
'web_middleware = synnefo.app_settings:synnefo_web_middleware',
|
217 |
'web_context_processors = synnefo.app_settings:synnefo_web_context_processors',
|
218 |
'urls = synnefo.app_settings.urls:urlpatterns',
|
219 |
'web_static = synnefo.app_settings:synnefo_static_files',
|
220 |
] |
221 |
}, |
222 |
) |