##// END OF EJS Templates
Loosen dependency on Mako to include mako 1.0.
Jelmer Vernooij -
r4414:8c2e9664 default
parent child Browse files
Show More
@@ -1,184 +1,184 b''
1 #!/usr/bin/env python2
1 #!/usr/bin/env python2
2 # -*- coding: utf-8 -*-
2 # -*- coding: utf-8 -*-
3 import os
3 import os
4 import sys
4 import sys
5 import platform
5 import platform
6
6
7 if sys.version_info < (2, 5):
7 if sys.version_info < (2, 5):
8 raise Exception('Kallithea requires python 2.5 or later')
8 raise Exception('Kallithea requires python 2.5 or later')
9
9
10
10
11 here = os.path.abspath(os.path.dirname(__file__))
11 here = os.path.abspath(os.path.dirname(__file__))
12
12
13
13
14 def _get_meta_var(name, data, callback_handler=None):
14 def _get_meta_var(name, data, callback_handler=None):
15 import re
15 import re
16 matches = re.compile(r'(?:%s)\s*=\s*(.*)' % name).search(data)
16 matches = re.compile(r'(?:%s)\s*=\s*(.*)' % name).search(data)
17 if matches:
17 if matches:
18 if not callable(callback_handler):
18 if not callable(callback_handler):
19 callback_handler = lambda v: v
19 callback_handler = lambda v: v
20
20
21 return callback_handler(eval(matches.groups()[0]))
21 return callback_handler(eval(matches.groups()[0]))
22
22
23 _meta = open(os.path.join(here, 'kallithea', '__init__.py'), 'rb')
23 _meta = open(os.path.join(here, 'kallithea', '__init__.py'), 'rb')
24 _metadata = _meta.read()
24 _metadata = _meta.read()
25 _meta.close()
25 _meta.close()
26
26
27 callback = lambda V: ('.'.join(map(str, V[:3])) + '.'.join(V[3:]))
27 callback = lambda V: ('.'.join(map(str, V[:3])) + '.'.join(V[3:]))
28 __version__ = _get_meta_var('VERSION', _metadata, callback)
28 __version__ = _get_meta_var('VERSION', _metadata, callback)
29 __license__ = _get_meta_var('__license__', _metadata)
29 __license__ = _get_meta_var('__license__', _metadata)
30 __author__ = _get_meta_var('__author__', _metadata)
30 __author__ = _get_meta_var('__author__', _metadata)
31 __url__ = _get_meta_var('__url__', _metadata)
31 __url__ = _get_meta_var('__url__', _metadata)
32 # defines current platform
32 # defines current platform
33 __platform__ = platform.system()
33 __platform__ = platform.system()
34
34
35 is_windows = __platform__ in ['Windows']
35 is_windows = __platform__ in ['Windows']
36
36
37 requirements = [
37 requirements = [
38 "waitress==0.8.8",
38 "waitress==0.8.8",
39 "webob==1.0.8",
39 "webob==1.0.8",
40 "webtest==1.4.3",
40 "webtest==1.4.3",
41 "Pylons==1.0.0",
41 "Pylons==1.0.0",
42 "Beaker==1.6.4",
42 "Beaker==1.6.4",
43 "WebHelpers==1.3",
43 "WebHelpers==1.3",
44 "formencode==1.2.4",
44 "formencode==1.2.4",
45 "SQLAlchemy==0.7.10",
45 "SQLAlchemy==0.7.10",
46 "Mako==0.9.0",
46 "Mako>=0.9.0,<=1.0.0",
47 "pygments>=1.5",
47 "pygments>=1.5",
48 "whoosh>=2.4.0,<2.5",
48 "whoosh>=2.4.0,<2.5",
49 "celery>=2.2.5,<2.3",
49 "celery>=2.2.5,<2.3",
50 "babel==0.9.6",
50 "babel==0.9.6",
51 "python-dateutil>=1.5.0,<2.0.0",
51 "python-dateutil>=1.5.0,<2.0.0",
52 "dulwich>=0.9.3,<=0.9.7",
52 "dulwich>=0.9.3,<=0.9.7",
53 "markdown==2.2.1",
53 "markdown==2.2.1",
54 "docutils>=0.8.1,<=0.11",
54 "docutils>=0.8.1,<=0.11",
55 "simplejson==2.5.2",
55 "simplejson==2.5.2",
56 "mock",
56 "mock",
57 "pycrypto>=2.6.0,<=2.6.1",
57 "pycrypto>=2.6.0,<=2.6.1",
58 "URLObject==2.3.4",
58 "URLObject==2.3.4",
59 "Routes==1.13",
59 "Routes==1.13",
60 ]
60 ]
61
61
62 if sys.version_info < (2, 6):
62 if sys.version_info < (2, 6):
63 requirements.append("pysqlite")
63 requirements.append("pysqlite")
64
64
65 if sys.version_info < (2, 7):
65 if sys.version_info < (2, 7):
66 requirements.append("importlib==1.0.1")
66 requirements.append("importlib==1.0.1")
67 requirements.append("unittest2")
67 requirements.append("unittest2")
68 requirements.append("argparse")
68 requirements.append("argparse")
69
69
70 if is_windows:
70 if is_windows:
71 requirements.append("mercurial==2.8.2")
71 requirements.append("mercurial==2.8.2")
72 else:
72 else:
73 requirements.append("py-bcrypt==0.3.0")
73 requirements.append("py-bcrypt==0.3.0")
74 requirements.append("mercurial==2.8.2")
74 requirements.append("mercurial==2.8.2")
75
75
76
76
77 dependency_links = [
77 dependency_links = [
78 ]
78 ]
79
79
80 classifiers = [
80 classifiers = [
81 'Development Status :: 4 - Beta',
81 'Development Status :: 4 - Beta',
82 'Environment :: Web Environment',
82 'Environment :: Web Environment',
83 'Framework :: Pylons',
83 'Framework :: Pylons',
84 'Intended Audience :: Developers',
84 'Intended Audience :: Developers',
85 'License :: OSI Approved :: GNU General Public License (GPL)',
85 'License :: OSI Approved :: GNU General Public License (GPL)',
86 'Operating System :: OS Independent',
86 'Operating System :: OS Independent',
87 'Programming Language :: Python',
87 'Programming Language :: Python',
88 'Programming Language :: Python :: 2.5',
88 'Programming Language :: Python :: 2.5',
89 'Programming Language :: Python :: 2.6',
89 'Programming Language :: Python :: 2.6',
90 'Programming Language :: Python :: 2.7',
90 'Programming Language :: Python :: 2.7',
91 'Topic :: Software Development :: Version Control',
91 'Topic :: Software Development :: Version Control',
92 ]
92 ]
93
93
94
94
95 # additional files from project that goes somewhere in the filesystem
95 # additional files from project that goes somewhere in the filesystem
96 # relative to sys.prefix
96 # relative to sys.prefix
97 data_files = []
97 data_files = []
98
98
99 # additional files that goes into package itself
99 # additional files that goes into package itself
100 package_data = {'kallithea': ['i18n/*/LC_MESSAGES/*.mo', ], }
100 package_data = {'kallithea': ['i18n/*/LC_MESSAGES/*.mo', ], }
101
101
102 description = ('Kallithea is a fast and powerful management tool '
102 description = ('Kallithea is a fast and powerful management tool '
103 'for Mercurial and GIT with a built in push/pull server, '
103 'for Mercurial and GIT with a built in push/pull server, '
104 'full text search and code-review.')
104 'full text search and code-review.')
105
105
106 keywords = ' '.join([
106 keywords = ' '.join([
107 'kallithea', 'mercurial', 'git', 'code review',
107 'kallithea', 'mercurial', 'git', 'code review',
108 'repo groups', 'ldap', 'repository management', 'hgweb replacement',
108 'repo groups', 'ldap', 'repository management', 'hgweb replacement',
109 'hgwebdir', 'gitweb replacement', 'serving hgweb',
109 'hgwebdir', 'gitweb replacement', 'serving hgweb',
110 ])
110 ])
111
111
112 # long description
112 # long description
113 README_FILE = 'README.rst'
113 README_FILE = 'README.rst'
114 CHANGELOG_FILE = 'docs/changelog.rst'
114 CHANGELOG_FILE = 'docs/changelog.rst'
115 try:
115 try:
116 long_description = open(README_FILE).read() + '\n\n' + \
116 long_description = open(README_FILE).read() + '\n\n' + \
117 open(CHANGELOG_FILE).read()
117 open(CHANGELOG_FILE).read()
118
118
119 except IOError, err:
119 except IOError, err:
120 sys.stderr.write(
120 sys.stderr.write(
121 "[WARNING] Cannot find file specified as long_description (%s)\n or "
121 "[WARNING] Cannot find file specified as long_description (%s)\n or "
122 "changelog (%s) skipping that file" % (README_FILE, CHANGELOG_FILE)
122 "changelog (%s) skipping that file" % (README_FILE, CHANGELOG_FILE)
123 )
123 )
124 long_description = description
124 long_description = description
125
125
126 try:
126 try:
127 from setuptools import setup, find_packages
127 from setuptools import setup, find_packages
128 except ImportError:
128 except ImportError:
129 from ez_setup import use_setuptools
129 from ez_setup import use_setuptools
130 use_setuptools()
130 use_setuptools()
131 from setuptools import setup, find_packages
131 from setuptools import setup, find_packages
132 # packages
132 # packages
133 packages = find_packages(exclude=['ez_setup'])
133 packages = find_packages(exclude=['ez_setup'])
134
134
135 setup(
135 setup(
136 name='Kallithea',
136 name='Kallithea',
137 version=__version__,
137 version=__version__,
138 description=description,
138 description=description,
139 long_description=long_description,
139 long_description=long_description,
140 keywords=keywords,
140 keywords=keywords,
141 license=__license__,
141 license=__license__,
142 author=__author__,
142 author=__author__,
143 author_email='kallithea@sfconservancy.org',
143 author_email='kallithea@sfconservancy.org',
144 dependency_links=dependency_links,
144 dependency_links=dependency_links,
145 url=__url__,
145 url=__url__,
146 install_requires=requirements,
146 install_requires=requirements,
147 classifiers=classifiers,
147 classifiers=classifiers,
148 setup_requires=["PasteScript>=1.6.3"],
148 setup_requires=["PasteScript>=1.6.3"],
149 data_files=data_files,
149 data_files=data_files,
150 packages=packages,
150 packages=packages,
151 include_package_data=True,
151 include_package_data=True,
152 test_suite='nose.collector',
152 test_suite='nose.collector',
153 package_data=package_data,
153 package_data=package_data,
154 message_extractors={'kallithea': [
154 message_extractors={'kallithea': [
155 ('**.py', 'python', None),
155 ('**.py', 'python', None),
156 ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}),
156 ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}),
157 ('templates/**.html', 'mako', {'input_encoding': 'utf-8'}),
157 ('templates/**.html', 'mako', {'input_encoding': 'utf-8'}),
158 ('public/**', 'ignore', None)]},
158 ('public/**', 'ignore', None)]},
159 zip_safe=False,
159 zip_safe=False,
160 paster_plugins=['PasteScript', 'Pylons'],
160 paster_plugins=['PasteScript', 'Pylons'],
161 entry_points="""
161 entry_points="""
162 [console_scripts]
162 [console_scripts]
163 kallithea-api = kallithea.bin.kallithea_api:main
163 kallithea-api = kallithea.bin.kallithea_api:main
164 kallithea-gist = kallithea.bin.kallithea_gist:main
164 kallithea-gist = kallithea.bin.kallithea_gist:main
165 kallithea-config = kallithea.bin.kallithea_config:main
165 kallithea-config = kallithea.bin.kallithea_config:main
166
166
167 [paste.app_factory]
167 [paste.app_factory]
168 main = kallithea.config.middleware:make_app
168 main = kallithea.config.middleware:make_app
169
169
170 [paste.app_install]
170 [paste.app_install]
171 main = pylons.util:PylonsInstaller
171 main = pylons.util:PylonsInstaller
172
172
173 [paste.global_paster_command]
173 [paste.global_paster_command]
174 setup-db=kallithea.lib.paster_commands.setup_db:Command
174 setup-db=kallithea.lib.paster_commands.setup_db:Command
175 update-repoinfo=kallithea.lib.paster_commands.update_repoinfo:Command
175 update-repoinfo=kallithea.lib.paster_commands.update_repoinfo:Command
176 make-rcext=kallithea.lib.paster_commands.make_rcextensions:Command
176 make-rcext=kallithea.lib.paster_commands.make_rcextensions:Command
177 repo-scan=kallithea.lib.paster_commands.repo_scan:Command
177 repo-scan=kallithea.lib.paster_commands.repo_scan:Command
178 cache-keys=kallithea.lib.paster_commands.cache_keys:Command
178 cache-keys=kallithea.lib.paster_commands.cache_keys:Command
179 ishell=kallithea.lib.paster_commands.ishell:Command
179 ishell=kallithea.lib.paster_commands.ishell:Command
180 make-index=kallithea.lib.paster_commands.make_index:Command
180 make-index=kallithea.lib.paster_commands.make_index:Command
181 upgrade-db=kallithea.lib.dbmigrate:UpgradeDb
181 upgrade-db=kallithea.lib.dbmigrate:UpgradeDb
182 celeryd=kallithea.lib.celerypylons.commands:CeleryDaemonCommand
182 celeryd=kallithea.lib.celerypylons.commands:CeleryDaemonCommand
183 """,
183 """,
184 )
184 )
General Comments 0
You need to be logged in to leave comments. Login now