python-zulip-api/zulip_bots/setup.py
Eeshan Garg c61d413f25 zulip_bots: Remove thesaurus bot.
This bot depends on PyDictionary, which isn't very well-implemented
or well-maintained. PyDictionary's dependency on goslate and
goslate's dependency on concurrent.futures has been known to cause
problems in Python 3 virtualenvs. This bot has also been the
source of disruptive BeautifulSoup warnings. Since this bot is only
meant to be an example bot, and for all the above reasons,
it makes sense to remove this bot. The cons of debugging the above
issues outweight the pros of having the bot at all.
2017-08-16 16:54:24 -07:00

78 lines
2.3 KiB
Python
Executable file

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
# We should be installable with either setuptools or distutils.
package_info = dict(
name='zulip_bots',
version='0.3.2',
description='Zulip\'s Bot framework',
author='Zulip Open Source Project',
author_email='zulip-devel@googlegroups.com',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Topic :: Communications :: Chat',
],
url='https://www.zulip.org/',
entry_points={
'console_scripts': [
'zulip-run-bot=zulip_bots.run:main',
],
},
include_package_data=True,
) # type: Dict[str, Any]
setuptools_info = dict(
install_requires=[
'zulip>=0.3.1',
'mock>=2.0.0',
'html2text', # for bots/define
],
)
try:
from setuptools import setup, find_packages
package_info.update(setuptools_info)
package_info['packages'] = find_packages()
except ImportError:
from distutils.core import setup
from distutils.version import LooseVersion
from importlib import import_module
# Manual dependency check
def check_dependency_manually(module_name, version=None):
try:
module = import_module(module_name)
if version is not None:
assert(LooseVersion(module.__version__) >= LooseVersion(version))
except (ImportError, AssertionError):
if version is not None:
print("{name}>={version} is not installed.".format(
req=req, version=version), file=sys.stderr)
else:
print("{name} is not installed.".format(name=module_name), file=sys.stderr)
sys.exit(1)
check_dependency_manually('zulip', '0.3.1')
check_dependency_manually('mock', '2.0.0')
check_dependency_manually('html2text')
check_dependency_manually('PyDictionary')
# Include all submodules under bots/
package_list = ['zulip_bots']
dirs = os.listdir('zulip_bots/bots/')
for dir_name in dirs:
if os.path.isdir(os.path.join('zulip_bots/bots/', dir_name)):
package_list.append('zulip_bots.bots.' + dir_name)
package_info['packages'] = package_list
setup(**package_info)