From f69f7f41d03a98c5580ba016210d9252ca1dbd85 Mon Sep 17 00:00:00 2001 From: Eeshan Garg Date: Tue, 5 Jun 2018 20:57:36 -0230 Subject: [PATCH] zulip_bots/provision: Use subprocess and stop being --quiet. The bot provisioning code was breaking due to pip.main not being a function anymore. Also, I don't think we should pass the --quiet option here. I felt it was good to have some visual information about what deps were being installed, just in case if something went wrong and there was a conflict, the user should be able to see it. --- zulip_bots/zulip_bots/provision.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zulip_bots/zulip_bots/provision.py b/zulip_bots/zulip_bots/provision.py index 3eafea2..1d14422 100755 --- a/zulip_bots/zulip_bots/provision.py +++ b/zulip_bots/zulip_bots/provision.py @@ -6,6 +6,7 @@ import argparse import logging import os import sys +import subprocess import glob import pip from typing import Iterator @@ -26,7 +27,7 @@ def provision_bot(path_to_bot, force): logging.info('Installing dependencies for {}...'.format(bot_name)) # pip install -r $BASEDIR/requirements.txt -t $BASEDIR/bot_dependencies --quiet - rcode = pip.main(['install', '-r', req_path, '--quiet']) + rcode = subprocess.call(['pip', 'install', '-r', req_path]) if rcode != 0: logging.error('Error. Check output of `pip install` above for details.')