From ec3050a150ce55468cc47dac45a2abd08bb9504d Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Thu, 3 Jan 2019 11:31:23 -0800 Subject: [PATCH] Force reinstall dependencies if using venv (#234) --- ros2_batch_job/__main__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ros2_batch_job/__main__.py b/ros2_batch_job/__main__.py index 302fef76f..6119cd357 100644 --- a/ros2_batch_job/__main__.py +++ b/ros2_batch_job/__main__.py @@ -459,8 +459,13 @@ def run(args, build_function, blacklisted_package_names=None): job.run( ['"%s"' % job.python, '-m', 'pip', 'uninstall', '-y'] + colcon_packages, shell=True) + + pip_cmd = ['"%s"' % job.python, '-m', 'pip', 'install', '-U'] + if args.do_venv: + # Force reinstall so all dependencies are in virtual environment + pip_cmd.append('--force-reinstall') job.run( - ['"%s"' % job.python, '-m', 'pip', 'install', '-U'] + pip_packages, + pip_cmd + pip_packages, shell=True) # OS X can't invoke a file which has a space in the shebang line