##// END OF EJS Templates
setup.py: support Paste 3.0.x...
Thomas De Schampheleire -
r7418:e7d63736 default
parent child Browse files
Show More
@@ -1,161 +1,161 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, 6) or sys.version_info >= (3,):
7 if sys.version_info < (2, 6) or sys.version_info >= (3,):
8 raise Exception('Kallithea requires python 2.6 or 2.7')
8 raise Exception('Kallithea requires python 2.6 or 2.7')
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 "alembic >= 0.8.0, < 1.1",
38 "alembic >= 0.8.0, < 1.1",
39 "gearbox < 1",
39 "gearbox < 1",
40 "waitress >= 0.8.8, < 1.2",
40 "waitress >= 0.8.8, < 1.2",
41 "WebOb >= 1.7, < 1.8", # turbogears2 2.3.12 requires WebOb<1.8.0
41 "WebOb >= 1.7, < 1.8", # turbogears2 2.3.12 requires WebOb<1.8.0
42 "backlash >= 0.1.2, < 1",
42 "backlash >= 0.1.2, < 1",
43 "TurboGears2 >= 2.3.10, < 3",
43 "TurboGears2 >= 2.3.10, < 3",
44 "tgext.routes >= 0.2.0, < 1",
44 "tgext.routes >= 0.2.0, < 1",
45 "Beaker >= 1.7.0, < 2",
45 "Beaker >= 1.7.0, < 2",
46 "WebHelpers >= 1.3, < 1.4",
46 "WebHelpers >= 1.3, < 1.4",
47 "FormEncode >= 1.2.4, < 1.4",
47 "FormEncode >= 1.2.4, < 1.4",
48 "SQLAlchemy >= 1.1, < 1.3",
48 "SQLAlchemy >= 1.1, < 1.3",
49 "Mako >= 0.9.0, < 1.1",
49 "Mako >= 0.9.0, < 1.1",
50 "Pygments >= 1.5, < 2.3",
50 "Pygments >= 1.5, < 2.3",
51 "Whoosh >= 2.5.0, < 2.8",
51 "Whoosh >= 2.5.0, < 2.8",
52 "celery >= 3.1, < 4.0", # celery 4 doesn't work
52 "celery >= 3.1, < 4.0", # celery 4 doesn't work
53 "Babel >= 0.9.6, < 2.7",
53 "Babel >= 0.9.6, < 2.7",
54 "python-dateutil >= 1.5.0, < 2.8",
54 "python-dateutil >= 1.5.0, < 2.8",
55 "Markdown >= 2.2.1, < 2.7",
55 "Markdown >= 2.2.1, < 2.7",
56 "docutils >= 0.8.1, < 0.15",
56 "docutils >= 0.8.1, < 0.15",
57 "URLObject >= 2.3.4, < 2.5",
57 "URLObject >= 2.3.4, < 2.5",
58 "Routes >= 1.13, < 2",
58 "Routes >= 1.13, < 2",
59 "dulwich >= 0.14.1, < 0.20",
59 "dulwich >= 0.14.1, < 0.20",
60 "mercurial >= 4.1.1, < 4.9",
60 "mercurial >= 4.1.1, < 4.9",
61 "decorator >= 3.3.2, < 4.4",
61 "decorator >= 3.3.2, < 4.4",
62 "Paste >= 2.0.3, < 3",
62 "Paste >= 2.0.3, < 3.1",
63 "bleach >= 3.0, < 3.1",
63 "bleach >= 3.0, < 3.1",
64 "Click >= 7.0, < 8",
64 "Click >= 7.0, < 8",
65 ]
65 ]
66
66
67 if sys.version_info < (2, 7):
67 if sys.version_info < (2, 7):
68 requirements.append("importlib == 1.0.1")
68 requirements.append("importlib == 1.0.1")
69 requirements.append("argparse")
69 requirements.append("argparse")
70
70
71 if not is_windows:
71 if not is_windows:
72 requirements.append("bcrypt >= 3.1.0, < 3.2")
72 requirements.append("bcrypt >= 3.1.0, < 3.2")
73
73
74 dependency_links = [
74 dependency_links = [
75 ]
75 ]
76
76
77 classifiers = [
77 classifiers = [
78 'Development Status :: 4 - Beta',
78 'Development Status :: 4 - Beta',
79 'Environment :: Web Environment',
79 'Environment :: Web Environment',
80 'Framework :: Pylons',
80 'Framework :: Pylons',
81 'Intended Audience :: Developers',
81 'Intended Audience :: Developers',
82 'License :: OSI Approved :: GNU General Public License (GPL)',
82 'License :: OSI Approved :: GNU General Public License (GPL)',
83 'Operating System :: OS Independent',
83 'Operating System :: OS Independent',
84 'Programming Language :: Python',
84 'Programming Language :: Python',
85 'Programming Language :: Python :: 2.6',
85 'Programming Language :: Python :: 2.6',
86 'Programming Language :: Python :: 2.7',
86 'Programming Language :: Python :: 2.7',
87 'Topic :: Software Development :: Version Control',
87 'Topic :: Software Development :: Version Control',
88 ]
88 ]
89
89
90
90
91 # additional files from project that goes somewhere in the filesystem
91 # additional files from project that goes somewhere in the filesystem
92 # relative to sys.prefix
92 # relative to sys.prefix
93 data_files = []
93 data_files = []
94
94
95 description = ('Kallithea is a fast and powerful management tool '
95 description = ('Kallithea is a fast and powerful management tool '
96 'for Mercurial and Git with a built in push/pull server, '
96 'for Mercurial and Git with a built in push/pull server, '
97 'full text search and code-review.')
97 'full text search and code-review.')
98
98
99 keywords = ' '.join([
99 keywords = ' '.join([
100 'kallithea', 'mercurial', 'git', 'code review',
100 'kallithea', 'mercurial', 'git', 'code review',
101 'repo groups', 'ldap', 'repository management', 'hgweb replacement',
101 'repo groups', 'ldap', 'repository management', 'hgweb replacement',
102 'hgwebdir', 'gitweb replacement', 'serving hgweb',
102 'hgwebdir', 'gitweb replacement', 'serving hgweb',
103 ])
103 ])
104
104
105 # long description
105 # long description
106 README_FILE = 'README.rst'
106 README_FILE = 'README.rst'
107 try:
107 try:
108 long_description = open(README_FILE).read()
108 long_description = open(README_FILE).read()
109 except IOError as err:
109 except IOError as err:
110 sys.stderr.write(
110 sys.stderr.write(
111 "[WARNING] Cannot find file specified as long_description (%s)\n"
111 "[WARNING] Cannot find file specified as long_description (%s)\n"
112 % README_FILE
112 % README_FILE
113 )
113 )
114 long_description = description
114 long_description = description
115
115
116 import setuptools
116 import setuptools
117
117
118 # monkey patch setuptools to use distutils owner/group functionality
118 # monkey patch setuptools to use distutils owner/group functionality
119 from setuptools.command import sdist
119 from setuptools.command import sdist
120 sdist_org = sdist.sdist
120 sdist_org = sdist.sdist
121 class sdist_new(sdist_org):
121 class sdist_new(sdist_org):
122 def initialize_options(self):
122 def initialize_options(self):
123 sdist_org.initialize_options(self)
123 sdist_org.initialize_options(self)
124 self.owner = self.group = 'root'
124 self.owner = self.group = 'root'
125 sdist.sdist = sdist_new
125 sdist.sdist = sdist_new
126
126
127 packages = setuptools.find_packages(exclude=['ez_setup'])
127 packages = setuptools.find_packages(exclude=['ez_setup'])
128
128
129 setuptools.setup(
129 setuptools.setup(
130 name='Kallithea',
130 name='Kallithea',
131 version=__version__,
131 version=__version__,
132 description=description,
132 description=description,
133 long_description=long_description,
133 long_description=long_description,
134 keywords=keywords,
134 keywords=keywords,
135 license=__license__,
135 license=__license__,
136 author=__author__,
136 author=__author__,
137 author_email='kallithea@sfconservancy.org',
137 author_email='kallithea@sfconservancy.org',
138 dependency_links=dependency_links,
138 dependency_links=dependency_links,
139 url=__url__,
139 url=__url__,
140 install_requires=requirements,
140 install_requires=requirements,
141 classifiers=classifiers,
141 classifiers=classifiers,
142 data_files=data_files,
142 data_files=data_files,
143 packages=packages,
143 packages=packages,
144 include_package_data=True,
144 include_package_data=True,
145 message_extractors={'kallithea': [
145 message_extractors={'kallithea': [
146 ('**.py', 'python', None),
146 ('**.py', 'python', None),
147 ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}),
147 ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}),
148 ('templates/**.html', 'mako', {'input_encoding': 'utf-8'}),
148 ('templates/**.html', 'mako', {'input_encoding': 'utf-8'}),
149 ('public/**', 'ignore', None)]},
149 ('public/**', 'ignore', None)]},
150 zip_safe=False,
150 zip_safe=False,
151 entry_points="""
151 entry_points="""
152 [console_scripts]
152 [console_scripts]
153 kallithea-api = kallithea.bin.kallithea_api:main
153 kallithea-api = kallithea.bin.kallithea_api:main
154 kallithea-gist = kallithea.bin.kallithea_gist:main
154 kallithea-gist = kallithea.bin.kallithea_gist:main
155 kallithea-config = kallithea.bin.kallithea_config:main
155 kallithea-config = kallithea.bin.kallithea_config:main
156 kallithea-cli = kallithea.bin.kallithea_cli:cli
156 kallithea-cli = kallithea.bin.kallithea_cli:cli
157
157
158 [paste.app_factory]
158 [paste.app_factory]
159 main = kallithea.config.middleware:make_app
159 main = kallithea.config.middleware:make_app
160 """,
160 """,
161 )
161 )
General Comments 0
You need to be logged in to leave comments. Login now