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