zulip_bots: Move installation of bot deps to tools/provision.
A lot of these bot dependencies are pretty hefty and shouldn't be installed as part of the zulip_bots package. So the installation of these belongs in tools/provision, not in setup.py.
This commit is contained in:
parent
246f065877
commit
e7e9059cb8
|
@ -4,6 +4,7 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import glob
|
||||||
|
|
||||||
from importlib import import_module
|
from importlib import import_module
|
||||||
|
|
||||||
|
@ -93,6 +94,17 @@ the Python version this command is executed with."""
|
||||||
if py_version > (3, 1):
|
if py_version > (3, 1):
|
||||||
install_dependencies('py3_requirements.txt')
|
install_dependencies('py3_requirements.txt')
|
||||||
|
|
||||||
|
# Install all requirements for all bots. get_bot_paths()
|
||||||
|
# has requirements that must be satisfied prior to calling
|
||||||
|
# it by setup().
|
||||||
|
current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
bots_dir = os.path.join(current_dir, "..", "zulip_bots", "zulip_bots", "bots")
|
||||||
|
req_paths = glob.glob(bots_dir + "/*/requirements.txt")
|
||||||
|
for req_path in req_paths:
|
||||||
|
path_split = req_path.split(os.path.sep)[-5:]
|
||||||
|
relative_path = os.path.join(*path_split)
|
||||||
|
install_dependencies(relative_path)
|
||||||
|
|
||||||
print(green + 'Success!' + end_format)
|
print(green + 'Success!' + end_format)
|
||||||
|
|
||||||
activate_command = os.path.join(base_dir,
|
activate_command = os.path.join(base_dir,
|
||||||
|
|
|
@ -98,15 +98,3 @@ except ImportError:
|
||||||
package_info['packages'] = package_list
|
package_info['packages'] = package_list
|
||||||
|
|
||||||
setup(**package_info)
|
setup(**package_info)
|
||||||
|
|
||||||
# Install all requirements for all bots. get_bot_paths()
|
|
||||||
# has requirements that must be satisfied prior to calling
|
|
||||||
# it by setup().
|
|
||||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
bots_dir = os.path.join(current_dir, "zulip_bots", "bots")
|
|
||||||
bots_subdirs = map(lambda d: os.path.abspath(d), glob.glob(bots_dir + '/*'))
|
|
||||||
bot_paths = filter(lambda d: os.path.isdir(d), bots_subdirs)
|
|
||||||
for bot_path in bot_paths:
|
|
||||||
req_path = os.path.join(bot_path, 'requirements.txt')
|
|
||||||
if os.path.exists(req_path):
|
|
||||||
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-r', req_path, '--quiet'])
|
|
||||||
|
|
Loading…
Reference in a new issue