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