From 56a9cbe5aff011b988e97b2ae1ae79ba31b3ea6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20H=C3=B6nig?= Date: Fri, 5 Jan 2018 22:27:22 +0100 Subject: [PATCH] Make bot provisioning script install dependencies globally. Previously, a bot's dependencies were installed within the bot's directoy, which is unconventional and doesn't work with tests. --- zulip_bots/zulip_bots/provision.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/zulip_bots/zulip_bots/provision.py b/zulip_bots/zulip_bots/provision.py index 2471e16..2ebf695 100755 --- a/zulip_bots/zulip_bots/provision.py +++ b/zulip_bots/zulip_bots/provision.py @@ -13,16 +13,12 @@ from typing import Iterator def provision_bot(path_to_bot, force): # type: (str, bool) -> None req_path = os.path.join(path_to_bot, 'requirements.txt') - install_path = os.path.join(path_to_bot, 'bot_dependencies') - if os.path.isfile(req_path): bot_name = os.path.basename(path_to_bot) logging.info('Installing dependencies for {}...'.format(bot_name)) - if not os.path.isdir(install_path): - os.makedirs(install_path) # pip install -r $BASEDIR/requirements.txt -t $BASEDIR/bot_dependencies --quiet - rcode = pip.main(['install', '-r', req_path, '-t', install_path, '--quiet']) + rcode = pip.main(['install', '-r', req_path, '--quiet']) if rcode != 0: logging.error('Error. Check output of `pip install` above for details.') @@ -32,8 +28,6 @@ def provision_bot(path_to_bot, force): else: logging.info('Installed dependencies successfully.') - sys.path.insert(0, install_path) - def parse_args(available_bots): # type: (Iterator[str]) -> argparse.Namespace