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.
This commit is contained in:
		
							parent
							
								
									df428b4821
								
							
						
					
					
						commit
						f69f7f41d0
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -6,6 +6,7 @@ import argparse
 | 
				
			||||||
import logging
 | 
					import logging
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
 | 
					import subprocess
 | 
				
			||||||
import glob
 | 
					import glob
 | 
				
			||||||
import pip
 | 
					import pip
 | 
				
			||||||
from typing import Iterator
 | 
					from typing import Iterator
 | 
				
			||||||
| 
						 | 
					@ -26,7 +27,7 @@ def provision_bot(path_to_bot, force):
 | 
				
			||||||
        logging.info('Installing dependencies for {}...'.format(bot_name))
 | 
					        logging.info('Installing dependencies for {}...'.format(bot_name))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # pip install -r $BASEDIR/requirements.txt -t $BASEDIR/bot_dependencies --quiet
 | 
					        # 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:
 | 
					        if rcode != 0:
 | 
				
			||||||
            logging.error('Error. Check output of `pip install` above for details.')
 | 
					            logging.error('Error. Check output of `pip install` above for details.')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue