##// END OF EJS Templates
paster: add informational/dummy "upgrade-db" command...
Søren Løvborg -
r5979:c436f337 default
parent child Browse files
Show More
@@ -0,0 +1,8 b''
1 from paste.script.command import Command
2
3 class UpgradeDb(Command):
4 hidden = True
5 summary = '(removed)'
6
7 def run(self, args):
8 raise SystemExit('The "paster upgrade-db" command has been removed.')
@@ -1,186 +1,187 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):
7 if sys.version_info < (2, 6):
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 "waitress==0.8.8",
38 "waitress==0.8.8",
39 "webob>=1.0.8,<=1.1.1",
39 "webob>=1.0.8,<=1.1.1",
40 "webtest==1.4.3",
40 "webtest==1.4.3",
41 "Pylons>=1.0.0,<=1.0.2",
41 "Pylons>=1.0.0,<=1.0.2",
42 "Beaker==1.6.4",
42 "Beaker==1.6.4",
43 "WebHelpers==1.3",
43 "WebHelpers==1.3",
44 "formencode>=1.2.4,<=1.2.6",
44 "formencode>=1.2.4,<=1.2.6",
45 "SQLAlchemy>=0.7.10,<1.1",
45 "SQLAlchemy>=0.7.10,<1.1",
46 "Mako>=0.9.0,<=1.0.0",
46 "Mako>=0.9.0,<=1.0.0",
47 "pygments>=1.5",
47 "pygments>=1.5",
48 "whoosh>=2.4.0,<=2.5.7",
48 "whoosh>=2.4.0,<=2.5.7",
49 "celery>=2.2.5,<2.3",
49 "celery>=2.2.5,<2.3",
50 "babel>=0.9.6,<=1.3",
50 "babel>=0.9.6,<=1.3",
51 "python-dateutil>=1.5.0,<2.0.0",
51 "python-dateutil>=1.5.0,<2.0.0",
52 "markdown==2.2.1",
52 "markdown==2.2.1",
53 "docutils>=0.8.1,<=0.11",
53 "docutils>=0.8.1,<=0.11",
54 "mock",
54 "mock",
55 "URLObject==2.3.4",
55 "URLObject==2.3.4",
56 "Routes==1.13",
56 "Routes==1.13",
57 "pytest>=2.7.0,<3.0",
57 "pytest>=2.7.0,<3.0",
58 "pytest-sugar>=0.7.0,<1.0.0",
58 "pytest-sugar>=0.7.0,<1.0.0",
59 "dulwich>=0.14.1",
59 "dulwich>=0.14.1",
60 "mercurial>=2.9,<3.9",
60 "mercurial>=2.9,<3.9",
61 ]
61 ]
62
62
63 if sys.version_info < (2, 7):
63 if sys.version_info < (2, 7):
64 requirements.append("importlib==1.0.1")
64 requirements.append("importlib==1.0.1")
65 requirements.append("unittest2")
65 requirements.append("unittest2")
66 requirements.append("argparse")
66 requirements.append("argparse")
67
67
68 if not is_windows:
68 if not is_windows:
69 requirements.append("bcrypt>=2.0.0")
69 requirements.append("bcrypt>=2.0.0")
70
70
71
71
72 dependency_links = [
72 dependency_links = [
73 ]
73 ]
74
74
75 classifiers = [
75 classifiers = [
76 'Development Status :: 4 - Beta',
76 'Development Status :: 4 - Beta',
77 'Environment :: Web Environment',
77 'Environment :: Web Environment',
78 'Framework :: Pylons',
78 'Framework :: Pylons',
79 'Intended Audience :: Developers',
79 'Intended Audience :: Developers',
80 'License :: OSI Approved :: GNU General Public License (GPL)',
80 'License :: OSI Approved :: GNU General Public License (GPL)',
81 'Operating System :: OS Independent',
81 'Operating System :: OS Independent',
82 'Programming Language :: Python',
82 'Programming Language :: Python',
83 'Programming Language :: Python :: 2.6',
83 'Programming Language :: Python :: 2.6',
84 'Programming Language :: Python :: 2.7',
84 'Programming Language :: Python :: 2.7',
85 'Topic :: Software Development :: Version Control',
85 'Topic :: Software Development :: Version Control',
86 ]
86 ]
87
87
88
88
89 # additional files from project that goes somewhere in the filesystem
89 # additional files from project that goes somewhere in the filesystem
90 # relative to sys.prefix
90 # relative to sys.prefix
91 data_files = []
91 data_files = []
92
92
93 description = ('Kallithea is a fast and powerful management tool '
93 description = ('Kallithea is a fast and powerful management tool '
94 'for Mercurial and Git with a built in push/pull server, '
94 'for Mercurial and Git with a built in push/pull server, '
95 'full text search and code-review.')
95 'full text search and code-review.')
96
96
97 keywords = ' '.join([
97 keywords = ' '.join([
98 'kallithea', 'mercurial', 'git', 'code review',
98 'kallithea', 'mercurial', 'git', 'code review',
99 'repo groups', 'ldap', 'repository management', 'hgweb replacement',
99 'repo groups', 'ldap', 'repository management', 'hgweb replacement',
100 'hgwebdir', 'gitweb replacement', 'serving hgweb',
100 'hgwebdir', 'gitweb replacement', 'serving hgweb',
101 ])
101 ])
102
102
103 # long description
103 # long description
104 README_FILE = 'README.rst'
104 README_FILE = 'README.rst'
105 CHANGELOG_FILE = 'docs/changelog.rst'
105 CHANGELOG_FILE = 'docs/changelog.rst'
106 try:
106 try:
107 long_description = open(README_FILE).read() + '\n\n' + \
107 long_description = open(README_FILE).read() + '\n\n' + \
108 open(CHANGELOG_FILE).read()
108 open(CHANGELOG_FILE).read()
109
109
110 except IOError as err:
110 except IOError as err:
111 sys.stderr.write(
111 sys.stderr.write(
112 "[WARNING] Cannot find file specified as long_description (%s)\n or "
112 "[WARNING] Cannot find file specified as long_description (%s)\n or "
113 "changelog (%s) skipping that file" % (README_FILE, CHANGELOG_FILE)
113 "changelog (%s) skipping that file" % (README_FILE, CHANGELOG_FILE)
114 )
114 )
115 long_description = description
115 long_description = description
116
116
117 try:
117 try:
118 from setuptools import setup, find_packages
118 from setuptools import setup, find_packages
119 except ImportError:
119 except ImportError:
120 from ez_setup import use_setuptools
120 from ez_setup import use_setuptools
121 use_setuptools()
121 use_setuptools()
122 from setuptools import setup, find_packages
122 from setuptools import setup, find_packages
123
123
124 # monkey patch setuptools to use distutils owner/group functionality
124 # monkey patch setuptools to use distutils owner/group functionality
125 from setuptools.command import sdist
125 from setuptools.command import sdist
126 sdist_org = sdist.sdist
126 sdist_org = sdist.sdist
127 class sdist_new(sdist_org):
127 class sdist_new(sdist_org):
128 def initialize_options(self):
128 def initialize_options(self):
129 sdist_org.initialize_options(self)
129 sdist_org.initialize_options(self)
130 self.owner = self.group = 'root'
130 self.owner = self.group = 'root'
131 sdist.sdist = sdist_new
131 sdist.sdist = sdist_new
132
132
133 # packages
133 # packages
134 packages = find_packages(exclude=['ez_setup'])
134 packages = find_packages(exclude=['ez_setup'])
135
135
136 setup(
136 setup(
137 name='Kallithea',
137 name='Kallithea',
138 version=__version__,
138 version=__version__,
139 description=description,
139 description=description,
140 long_description=long_description,
140 long_description=long_description,
141 keywords=keywords,
141 keywords=keywords,
142 license=__license__,
142 license=__license__,
143 author=__author__,
143 author=__author__,
144 author_email='kallithea@sfconservancy.org',
144 author_email='kallithea@sfconservancy.org',
145 dependency_links=dependency_links,
145 dependency_links=dependency_links,
146 url=__url__,
146 url=__url__,
147 install_requires=requirements,
147 install_requires=requirements,
148 classifiers=classifiers,
148 classifiers=classifiers,
149 setup_requires=['PasteScript>=1.6.3',
149 setup_requires=['PasteScript>=1.6.3',
150 'pytest-runner'],
150 'pytest-runner'],
151 tests_require=['pytest'],
151 tests_require=['pytest'],
152 data_files=data_files,
152 data_files=data_files,
153 packages=packages,
153 packages=packages,
154 include_package_data=True,
154 include_package_data=True,
155 message_extractors={'kallithea': [
155 message_extractors={'kallithea': [
156 ('**.py', 'python', None),
156 ('**.py', 'python', None),
157 ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}),
157 ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}),
158 ('templates/**.html', 'mako', {'input_encoding': 'utf-8'}),
158 ('templates/**.html', 'mako', {'input_encoding': 'utf-8'}),
159 ('public/**', 'ignore', None)]},
159 ('public/**', 'ignore', None)]},
160 zip_safe=False,
160 zip_safe=False,
161 paster_plugins=['PasteScript', 'Pylons'],
161 paster_plugins=['PasteScript', 'Pylons'],
162 entry_points="""
162 entry_points="""
163 [console_scripts]
163 [console_scripts]
164 kallithea-api = kallithea.bin.kallithea_api:main
164 kallithea-api = kallithea.bin.kallithea_api:main
165 kallithea-gist = kallithea.bin.kallithea_gist:main
165 kallithea-gist = kallithea.bin.kallithea_gist:main
166 kallithea-config = kallithea.bin.kallithea_config:main
166 kallithea-config = kallithea.bin.kallithea_config:main
167
167
168 [paste.app_factory]
168 [paste.app_factory]
169 main = kallithea.config.middleware:make_app
169 main = kallithea.config.middleware:make_app
170
170
171 [paste.app_install]
171 [paste.app_install]
172 main = pylons.util:PylonsInstaller
172 main = pylons.util:PylonsInstaller
173
173
174 [paste.global_paster_command]
174 [paste.global_paster_command]
175 setup-db=kallithea.lib.paster_commands.setup_db:Command
175 setup-db=kallithea.lib.paster_commands.setup_db:Command
176 cleanup-repos=kallithea.lib.paster_commands.cleanup:Command
176 cleanup-repos=kallithea.lib.paster_commands.cleanup:Command
177 update-repoinfo=kallithea.lib.paster_commands.update_repoinfo:Command
177 update-repoinfo=kallithea.lib.paster_commands.update_repoinfo:Command
178 make-rcext=kallithea.lib.paster_commands.make_rcextensions:Command
178 make-rcext=kallithea.lib.paster_commands.make_rcextensions:Command
179 repo-scan=kallithea.lib.paster_commands.repo_scan:Command
179 repo-scan=kallithea.lib.paster_commands.repo_scan:Command
180 cache-keys=kallithea.lib.paster_commands.cache_keys:Command
180 cache-keys=kallithea.lib.paster_commands.cache_keys:Command
181 ishell=kallithea.lib.paster_commands.ishell:Command
181 ishell=kallithea.lib.paster_commands.ishell:Command
182 make-index=kallithea.lib.paster_commands.make_index:Command
182 make-index=kallithea.lib.paster_commands.make_index:Command
183 upgrade-db=kallithea.lib.dbmigrate:UpgradeDb
183 celeryd=kallithea.lib.celerypylons.commands:CeleryDaemonCommand
184 celeryd=kallithea.lib.celerypylons.commands:CeleryDaemonCommand
184 install-iis=kallithea.lib.paster_commands.install_iis:Command
185 install-iis=kallithea.lib.paster_commands.install_iis:Command
185 """,
186 """,
186 )
187 )
General Comments 0
You need to be logged in to leave comments. Login now