##// END OF EJS Templates
setup: use old importlib_metadata version to fix kombu failing on python < 3.8...
Mads Kiilerich -
r8747:11cae16e stable
parent child Browse files
Show More
@@ -1,162 +1,164 b''
1 #!/usr/bin/env python3
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
2 # -*- coding: utf-8 -*-
3 import os
3 import os
4 import platform
4 import platform
5 import re
5 import re
6 import sys
6 import sys
7
7
8 import setuptools
8 import setuptools
9 # monkey patch setuptools to use distutils owner/group functionality
9 # monkey patch setuptools to use distutils owner/group functionality
10 from setuptools.command import sdist
10 from setuptools.command import sdist
11
11
12
12
13 if sys.version_info < (3, 6):
13 if sys.version_info < (3, 6):
14 raise Exception('Kallithea requires Python 3.6 or later')
14 raise Exception('Kallithea requires Python 3.6 or later')
15
15
16
16
17 here = os.path.abspath(os.path.dirname(__file__))
17 here = os.path.abspath(os.path.dirname(__file__))
18
18
19
19
20 def _get_meta_var(name, data, callback_handler=None):
20 def _get_meta_var(name, data, callback_handler=None):
21 matches = re.compile(r'(?:%s)\s*=\s*(.*)' % name).search(data)
21 matches = re.compile(r'(?:%s)\s*=\s*(.*)' % name).search(data)
22 if matches:
22 if matches:
23 s = eval(matches.groups()[0])
23 s = eval(matches.groups()[0])
24 if callable(callback_handler):
24 if callable(callback_handler):
25 return callback_handler(s)
25 return callback_handler(s)
26 return s
26 return s
27
27
28 _meta = open(os.path.join(here, 'kallithea', '__init__.py'), 'r')
28 _meta = open(os.path.join(here, 'kallithea', '__init__.py'), 'r')
29 _metadata = _meta.read()
29 _metadata = _meta.read()
30 _meta.close()
30 _meta.close()
31
31
32 def callback(V):
32 def callback(V):
33 return '.'.join(map(str, V[:3])) + '.'.join(V[3:])
33 return '.'.join(map(str, V[:3])) + '.'.join(V[3:])
34 __version__ = _get_meta_var('VERSION', _metadata, callback)
34 __version__ = _get_meta_var('VERSION', _metadata, callback)
35 __license__ = _get_meta_var('__license__', _metadata)
35 __license__ = _get_meta_var('__license__', _metadata)
36 __author__ = _get_meta_var('__author__', _metadata)
36 __author__ = _get_meta_var('__author__', _metadata)
37 __url__ = _get_meta_var('__url__', _metadata)
37 __url__ = _get_meta_var('__url__', _metadata)
38 # defines current platform
38 # defines current platform
39 __platform__ = platform.system()
39 __platform__ = platform.system()
40
40
41 is_windows = __platform__ in ['Windows']
41 is_windows = __platform__ in ['Windows']
42
42
43 requirements = [
43 requirements = [
44 "alembic >= 1.0.10, < 1.5",
44 "alembic >= 1.0.10, < 1.5",
45 "gearbox >= 0.1.0, < 1",
45 "gearbox >= 0.1.0, < 1",
46 "waitress >= 0.8.8, < 1.5",
46 "waitress >= 0.8.8, < 1.5",
47 "WebOb >= 1.8, < 1.9",
47 "WebOb >= 1.8, < 1.9",
48 "backlash >= 0.1.2, < 1",
48 "backlash >= 0.1.2, < 1",
49 "TurboGears2 >= 2.4, < 2.5",
49 "TurboGears2 >= 2.4, < 2.5",
50 "tgext.routes >= 0.2.0, < 1",
50 "tgext.routes >= 0.2.0, < 1",
51 "Beaker >= 1.10.1, < 2",
51 "Beaker >= 1.10.1, < 2",
52 "WebHelpers2 >= 2.0, < 2.1",
52 "WebHelpers2 >= 2.0, < 2.1",
53 "FormEncode >= 1.3.1, < 2.1",
53 "FormEncode >= 1.3.1, < 2.1",
54 "SQLAlchemy >= 1.2.9, < 1.4",
54 "SQLAlchemy >= 1.2.9, < 1.4",
55 "Mako >= 0.9.1, < 1.2",
55 "Mako >= 0.9.1, < 1.2",
56 "Pygments >= 2.2.0, < 2.7",
56 "Pygments >= 2.2.0, < 2.7",
57 "Whoosh >= 2.7.1, < 2.8",
57 "Whoosh >= 2.7.1, < 2.8",
58 "celery >= 5, < 5.1",
58 "celery >= 5, < 5.1",
59 "Babel >= 1.3, < 2.9",
59 "Babel >= 1.3, < 2.9",
60 "python-dateutil >= 2.1.0, < 2.9",
60 "python-dateutil >= 2.1.0, < 2.9",
61 "Markdown >= 2.2.1, < 3.2",
61 "Markdown >= 2.2.1, < 3.2",
62 "docutils >= 0.11, < 0.17",
62 "docutils >= 0.11, < 0.17",
63 "URLObject >= 2.3.4, < 2.5",
63 "URLObject >= 2.3.4, < 2.5",
64 "Routes >= 2.0, < 2.5",
64 "Routes >= 2.0, < 2.5",
65 "dulwich >= 0.19.0, < 0.20",
65 "dulwich >= 0.19.0, < 0.20",
66 "mercurial >= 5.2, < 6.2",
66 "mercurial >= 5.2, < 6.2",
67 "decorator >= 4.2.1, < 4.5",
67 "decorator >= 4.2.1, < 4.5",
68 "Paste >= 2.0.3, < 3.5",
68 "Paste >= 2.0.3, < 3.5",
69 "bleach >= 3.2, < 4.2",
69 "bleach >= 3.2, < 4.2",
70 "Click >= 7.0, < 8",
70 "Click >= 7.0, < 8",
71 "ipaddr >= 2.2.0, < 2.3",
71 "ipaddr >= 2.2.0, < 2.3",
72 "paginate >= 0.5, < 0.6",
72 "paginate >= 0.5, < 0.6",
73 "paginate_sqlalchemy >= 0.3.0, < 0.4",
73 "paginate_sqlalchemy >= 0.3.0, < 0.4",
74 "bcrypt >= 3.1.0, < 3.2",
74 "bcrypt >= 3.1.0, < 3.2",
75 "pip >= 20.0, < 999",
75 "pip >= 20.0, < 999",
76 "chardet >= 3",
76 "chardet >= 3",
77 ]
77 ]
78 if sys.version_info < (3, 8):
79 requirements.append("importlib-metadata < 5")
78
80
79 dependency_links = [
81 dependency_links = [
80 ]
82 ]
81
83
82 classifiers = [
84 classifiers = [
83 'Development Status :: 4 - Beta',
85 'Development Status :: 4 - Beta',
84 'Environment :: Web Environment',
86 'Environment :: Web Environment',
85 'Framework :: Pylons',
87 'Framework :: Pylons',
86 'Intended Audience :: Developers',
88 'Intended Audience :: Developers',
87 'License :: OSI Approved :: GNU General Public License (GPL)',
89 'License :: OSI Approved :: GNU General Public License (GPL)',
88 'Operating System :: OS Independent',
90 'Operating System :: OS Independent',
89 'Programming Language :: Python :: 3.6',
91 'Programming Language :: Python :: 3.6',
90 'Programming Language :: Python :: 3.7',
92 'Programming Language :: Python :: 3.7',
91 'Programming Language :: Python :: 3.8',
93 'Programming Language :: Python :: 3.8',
92 'Topic :: Software Development :: Version Control',
94 'Topic :: Software Development :: Version Control',
93 ]
95 ]
94
96
95
97
96 # additional files from project that goes somewhere in the filesystem
98 # additional files from project that goes somewhere in the filesystem
97 # relative to sys.prefix
99 # relative to sys.prefix
98 data_files = []
100 data_files = []
99
101
100 description = ('Kallithea is a fast and powerful management tool '
102 description = ('Kallithea is a fast and powerful management tool '
101 'for Mercurial and Git with a built in push/pull server, '
103 'for Mercurial and Git with a built in push/pull server, '
102 'full text search and code-review.')
104 'full text search and code-review.')
103
105
104 keywords = ' '.join([
106 keywords = ' '.join([
105 'kallithea', 'mercurial', 'git', 'code review',
107 'kallithea', 'mercurial', 'git', 'code review',
106 'repo groups', 'ldap', 'repository management', 'hgweb replacement',
108 'repo groups', 'ldap', 'repository management', 'hgweb replacement',
107 'hgwebdir', 'gitweb replacement', 'serving hgweb',
109 'hgwebdir', 'gitweb replacement', 'serving hgweb',
108 ])
110 ])
109
111
110 # long description
112 # long description
111 README_FILE = 'README.rst'
113 README_FILE = 'README.rst'
112 try:
114 try:
113 long_description = open(README_FILE).read()
115 long_description = open(README_FILE).read()
114 except IOError as err:
116 except IOError as err:
115 sys.stderr.write(
117 sys.stderr.write(
116 "[WARNING] Cannot find file specified as long_description (%s): %s\n"
118 "[WARNING] Cannot find file specified as long_description (%s): %s\n"
117 % (README_FILE, err)
119 % (README_FILE, err)
118 )
120 )
119 long_description = description
121 long_description = description
120
122
121
123
122 sdist_org = sdist.sdist
124 sdist_org = sdist.sdist
123 class sdist_new(sdist_org):
125 class sdist_new(sdist_org):
124 def initialize_options(self):
126 def initialize_options(self):
125 sdist_org.initialize_options(self)
127 sdist_org.initialize_options(self)
126 self.owner = self.group = 'root'
128 self.owner = self.group = 'root'
127 sdist.sdist = sdist_new
129 sdist.sdist = sdist_new
128
130
129 packages = setuptools.find_packages(exclude=['ez_setup'])
131 packages = setuptools.find_packages(exclude=['ez_setup'])
130
132
131 setuptools.setup(
133 setuptools.setup(
132 name='Kallithea',
134 name='Kallithea',
133 version=__version__,
135 version=__version__,
134 description=description,
136 description=description,
135 long_description=long_description,
137 long_description=long_description,
136 keywords=keywords,
138 keywords=keywords,
137 license=__license__,
139 license=__license__,
138 author=__author__,
140 author=__author__,
139 author_email='kallithea@sfconservancy.org',
141 author_email='kallithea@sfconservancy.org',
140 dependency_links=dependency_links,
142 dependency_links=dependency_links,
141 url=__url__,
143 url=__url__,
142 install_requires=requirements,
144 install_requires=requirements,
143 classifiers=classifiers,
145 classifiers=classifiers,
144 data_files=data_files,
146 data_files=data_files,
145 packages=packages,
147 packages=packages,
146 include_package_data=True,
148 include_package_data=True,
147 message_extractors={'kallithea': [
149 message_extractors={'kallithea': [
148 ('**.py', 'python', None),
150 ('**.py', 'python', None),
149 ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}),
151 ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}),
150 ('templates/**.html', 'mako', {'input_encoding': 'utf-8'}),
152 ('templates/**.html', 'mako', {'input_encoding': 'utf-8'}),
151 ('public/**', 'ignore', None)]},
153 ('public/**', 'ignore', None)]},
152 zip_safe=False,
154 zip_safe=False,
153 entry_points="""
155 entry_points="""
154 [console_scripts]
156 [console_scripts]
155 kallithea-api = kallithea.bin.kallithea_api:main
157 kallithea-api = kallithea.bin.kallithea_api:main
156 kallithea-gist = kallithea.bin.kallithea_gist:main
158 kallithea-gist = kallithea.bin.kallithea_gist:main
157 kallithea-cli = kallithea.bin.kallithea_cli:cli
159 kallithea-cli = kallithea.bin.kallithea_cli:cli
158
160
159 [paste.app_factory]
161 [paste.app_factory]
160 main = kallithea.config.application:make_app
162 main = kallithea.config.application:make_app
161 """,
163 """,
162 )
164 )
General Comments 0
You need to be logged in to leave comments. Login now