From bad8dccef7ce861e1dbfbd6a55087fa404ad74be Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Fri, 10 Nov 2017 13:03:40 -0800 Subject: [PATCH] provision: Make instructions to source venv more obvious. (This cleans up the print formatting a bit in tools/provision and adds an explicit step in README.md.) --- README.md | 5 ++++- tools/provision | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 12b3373..8be8b1e 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,10 @@ This repository contains the source code for Zulip's PyPI packages: ./tools/provision -p ` ``` -5. You should now be able to run all the tests within this virtualenv. +5. The above step, if successful, will tell you the command to "source" your + virtual environment. Run that command! + +6. You should now be able to run all the tests within this virtualenv. ### Running tests diff --git a/tools/provision b/tools/provision index 34fb2a8..db8888d 100755 --- a/tools/provision +++ b/tools/provision @@ -77,9 +77,20 @@ the Python version this command is executed with.""" else: warnings.warn("Your Python version does not support mypy. `tools/run-mypy` will fail.") - print("{green}Success!{end_format} Run\n {bold}source '{activate}'{end_format}\nto activate virtualenv.".format( - green='\033[92m', bold='\033[1m', end_format='\033[0m', - activate=os.path.join(base_dir, venv_dir, venv_exec_dir, 'activate'))) + green = '\033[92m' + end_format = '\033[0m' + bold = '\033[1m' + + print('\n') + print(green + 'Success!' + end_format) + + activate_command = os.path.join(base_dir, + venv_dir, + venv_exec_dir, + 'activate') + print('\nNow, run this!:') + print(bold + 'source ' + activate_command + end_format) + if __name__ == '__main__': main()