Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
#7630 Adding better error messaging in mach bootstrap for missing virtualenv/pip dependencies #7678
This PR is in reference to #7630
I've added a simple try catch around our use of subprocess.check_all when trying to invoke and use python's
Upon failure, I use sys.exit with an error message for the user. Exit seemed appropriate as anything beneath those dependencies will fail to execute and result in a non friendly error message
referenced this pull request
Sep 18, 2015
So your current solution will indeed warn if the user doesn't have pip or virtualenv installed, though I'm a little worried an
@frewsxcv I've made some changes to the code and pushed up to this branch.
I went down the path of expanding the scope on the method _get_exec as you suggested however, while digging into the documentation for subprocess.check_call I realized we are really dealing with three scenarios
Digging into the documentation on subprocess.check_call I found that it will return two types of errors
Given that, thought it might be a less invasive change if we expand our exception handling and messaging for the use-cases around our use of check_call.
So, my proposed change is to
I'm still 100% open to going down the other path (and to be clear, I did) but it seemed like I was really expanding scope on those functions when this might be less invasive change that helps make the error messages more user friendly when these executables are not installed on their machine.
It looks like there is a 'tidy' failure (check the Travis CI failure for more information)
You should be able to do something like this:
sys.exit("Python virtualenv not found. Please install virtualenv and ensure " "permissions prior to running mach.")