setup.py
161 lines
| 4.7 KiB
| text/x-python
|
PythonLexer
Mads Kiilerich
|
r8053 | #!/usr/bin/env python3 | ||
r4005 | # -*- coding: utf-8 -*- | |||
r2563 | import os | |||
Mads Kiilerich
|
r7718 | import platform | ||
r553 | import sys | |||
Mads Kiilerich
|
r7718 | |||
import setuptools | ||||
# monkey patch setuptools to use distutils owner/group functionality | ||||
from setuptools.command import sdist | ||||
r2563 | ||||
Mads Kiilerich
|
r8053 | if sys.version_info < (3, 6): | ||
raise Exception('Kallithea requires Python 3.6 or later') | ||||
r2563 | ||||
here = os.path.abspath(os.path.dirname(__file__)) | ||||
def _get_meta_var(name, data, callback_handler=None): | ||||
import re | ||||
matches = re.compile(r'(?:%s)\s*=\s*(.*)' % name).search(data) | ||||
if matches: | ||||
Mads Kiilerich
|
r8139 | s = eval(matches.groups()[0]) | ||
if callable(callback_handler): | ||||
return callback_handler(s) | ||||
return s | ||||
r2563 | ||||
Mads Kiilerich
|
r7991 | _meta = open(os.path.join(here, 'kallithea', '__init__.py'), 'r') | ||
r2563 | _metadata = _meta.read() | |||
_meta.close() | ||||
Mads Kiilerich
|
r8139 | def callback(V): | ||
return '.'.join(map(str, V[:3])) + '.'.join(V[3:]) | ||||
r2563 | __version__ = _get_meta_var('VERSION', _metadata, callback) | |||
__license__ = _get_meta_var('__license__', _metadata) | ||||
__author__ = _get_meta_var('__author__', _metadata) | ||||
__url__ = _get_meta_var('__url__', _metadata) | ||||
# defines current platform | ||||
__platform__ = platform.system() | ||||
r3892 | is_windows = __platform__ in ['Windows'] | |||
r1078 | ||||
r2563 | requirements = [ | |||
Mads Kiilerich
|
r8097 | "alembic >= 1.0.10, < 1.5", | ||
Mads Kiilerich
|
r7816 | "gearbox >= 0.1.0, < 1", | ||
Mads Kiilerich
|
r8097 | "waitress >= 0.8.8, < 1.5", | ||
Mads Kiilerich
|
r7996 | "WebOb >= 1.8, < 1.9", | ||
Mads Kiilerich
|
r7294 | "backlash >= 0.1.2, < 1", | ||
Mads Kiilerich
|
r7997 | "TurboGears2 >= 2.4, < 2.5", | ||
Mads Kiilerich
|
r7294 | "tgext.routes >= 0.2.0, < 1", | ||
Mads Kiilerich
|
r8000 | "Beaker >= 1.10.1, < 2", | ||
Mads Kiilerich
|
r7712 | "WebHelpers2 >= 2.0, < 2.1", | ||
Mads Kiilerich
|
r7999 | "FormEncode >= 1.3.1, < 1.4", | ||
Mads Kiilerich
|
r8008 | "SQLAlchemy >= 1.2.9, < 1.4", | ||
Mads Kiilerich
|
r8097 | "Mako >= 0.9.1, < 1.2", | ||
"Pygments >= 2.2.0, < 2.6", | ||||
Mads Kiilerich
|
r8003 | "Whoosh >= 2.7.1, < 2.8", | ||
Thomas De Schampheleire
|
r8282 | "celery >= 4.3, < 4.5, != 4.4.4", # 4.4.4 is broken due to unexpressed dependency on 'future', see https://github.com/celery/celery/pull/6146 | ||
Mads Kiilerich
|
r8097 | "Babel >= 1.3, < 2.9", | ||
Mads Kiilerich
|
r8001 | "python-dateutil >= 2.1.0, < 2.9", | ||
Mads Kiilerich
|
r7648 | "Markdown >= 2.2.1, < 3.2", | ||
Mads Kiilerich
|
r8097 | "docutils >= 0.11, < 0.17", | ||
Mads Kiilerich
|
r7294 | "URLObject >= 2.3.4, < 2.5", | ||
Mads Kiilerich
|
r7873 | "Routes >= 2.0, < 2.5", | ||
Mads Kiilerich
|
r8005 | "dulwich >= 0.19.0, < 0.20", | ||
Mads Kiilerich
|
r8231 | "mercurial >= 5.2, < 5.5", | ||
Mads Kiilerich
|
r8006 | "decorator >= 4.2.1, < 4.5", | ||
Mads Kiilerich
|
r8097 | "Paste >= 2.0.3, < 3.4", | ||
Mads Kiilerich
|
r8176 | "bleach >= 3.0, < 3.1.4", | ||
Thomas De Schampheleire
|
r7326 | "Click >= 7.0, < 8", | ||
Mads Kiilerich
|
r7998 | "ipaddr >= 2.2.0, < 2.3", | ||
Mads Kiilerich
|
r7858 | "paginate >= 0.5, < 0.6", | ||
"paginate_sqlalchemy >= 0.3.0, < 0.4", | ||||
Mads Kiilerich
|
r8141 | "bcrypt >= 3.1.0, < 3.2", | ||
Mads Kiilerich
|
r8208 | "pip >= 20.0, < 999", | ||
r2563 | ] | |||
r1456 | dependency_links = [ | |||
] | ||||
r1966 | classifiers = [ | |||
Mads Kiilerich
|
r4246 | 'Development Status :: 4 - Beta', | ||
r1966 | 'Environment :: Web Environment', | |||
'Framework :: Pylons', | ||||
'Intended Audience :: Developers', | ||||
'License :: OSI Approved :: GNU General Public License (GPL)', | ||||
'Operating System :: OS Independent', | ||||
Mads Kiilerich
|
r8089 | 'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||||
'Programming Language :: Python :: 3.8', | ||||
Mads Kiilerich
|
r4246 | 'Topic :: Software Development :: Version Control', | ||
r1966 | ] | |||
r572 | ||||
r1118 | ||||
r1792 | # additional files from project that goes somewhere in the filesystem | |||
# relative to sys.prefix | ||||
r553 | data_files = [] | |||
Bradley M. Kuhn
|
r4212 | description = ('Kallithea is a fast and powerful management tool ' | ||
Andrew Shadura
|
r4937 | 'for Mercurial and Git with a built in push/pull server, ' | ||
r3310 | 'full text search and code-review.') | |||
r4005 | ||||
keywords = ' '.join([ | ||||
Bradley M. Kuhn
|
r4186 | 'kallithea', 'mercurial', 'git', 'code review', | ||
r4005 | 'repo groups', 'ldap', 'repository management', 'hgweb replacement', | |||
'hgwebdir', 'gitweb replacement', 'serving hgweb', | ||||
]) | ||||
r1792 | # long description | |||
r4005 | README_FILE = 'README.rst' | |||
r553 | try: | |||
Mads Kiilerich
|
r6000 | long_description = open(README_FILE).read() | ||
Mads Kiilerich
|
r5374 | except IOError as err: | ||
r4005 | sys.stderr.write( | |||
Mads Kiilerich
|
r8107 | "[WARNING] Cannot find file specified as long_description (%s): %s\n" | ||
% (README_FILE, err) | ||||
r4005 | ) | |||
r565 | long_description = description | |||
r552 | ||||
Mads Kiilerich
|
r5501 | |||
sdist_org = sdist.sdist | ||||
class sdist_new(sdist_org): | ||||
def initialize_options(self): | ||||
sdist_org.initialize_options(self) | ||||
self.owner = self.group = 'root' | ||||
sdist.sdist = sdist_new | ||||
Mads Kiilerich
|
r5996 | packages = setuptools.find_packages(exclude=['ez_setup']) | ||
Marcin Kuzminski
|
r0 | |||
Mads Kiilerich
|
r5996 | setuptools.setup( | ||
Bradley M. Kuhn
|
r4212 | name='Kallithea', | ||
r2563 | version=__version__, | |||
r565 | description=description, | |||
r552 | long_description=long_description, | |||
r1078 | keywords=keywords, | |||
r1205 | license=__license__, | |||
r2563 | author=__author__, | |||
Bradley M. Kuhn
|
r4245 | author_email='kallithea@sfconservancy.org', | ||
r1456 | dependency_links=dependency_links, | |||
r2563 | url=__url__, | |||
r552 | install_requires=requirements, | |||
r572 | classifiers=classifiers, | |||
r552 | data_files=data_files, | |||
r553 | packages=packages, | |||
r127 | include_package_data=True, | |||
Bradley M. Kuhn
|
r4186 | message_extractors={'kallithea': [ | ||
Marcin Kuzminski
|
r0 | ('**.py', 'python', None), | ||
('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}), | ||||
r1143 | ('templates/**.html', 'mako', {'input_encoding': 'utf-8'}), | |||
Marcin Kuzminski
|
r0 | ('public/**', 'ignore', None)]}, | ||
r127 | zip_safe=False, | |||
entry_points=""" | ||||
r2379 | [console_scripts] | |||
Bradley M. Kuhn
|
r4189 | kallithea-api = kallithea.bin.kallithea_api:main | ||
kallithea-gist = kallithea.bin.kallithea_gist:main | ||||
Thomas De Schampheleire
|
r7326 | kallithea-cli = kallithea.bin.kallithea_cli:cli | ||
r2379 | ||||
Marcin Kuzminski
|
r0 | [paste.app_factory] | ||
Bradley M. Kuhn
|
r4186 | main = kallithea.config.middleware:make_app | ||
Marcin Kuzminski
|
r0 | """, | ||
) | ||||