tools/provision: Exit earlier for python2.

We really want to avoid confusing folks that just want
to work on bots in python3.
This commit is contained in:
Steve Howell 2017-12-31 09:50:34 -05:00 committed by Robert Hönig
parent d4500a3b7a
commit 19c3792af5

View file

@ -40,6 +40,12 @@ the Python version this command is executed with."""
py_version = tuple(int(num) for num in py_version_list)
venv_name = 'zulip-api-py{}-venv'.format(py_version[0])
if py_version <= (3, 1) and (not options.force):
print(red + "Provision failed: Cannot create venv with outdated Python version ({}).\n"
"Run this script with --force if you want to proceed anyway."
.format(py_version_output.strip()) + end_format)
sys.exit(1)
venv_dir = os.path.join(base_dir, venv_name)
if not os.path.isdir(venv_dir):
try:
@ -88,11 +94,6 @@ the Python version this command is executed with."""
install_dependencies('requirements.txt')
if py_version > (3, 1):
install_dependencies('py3_requirements.txt')
elif not options.force:
print(red + "Provision failed: Cannot create venv with outdated Python version ({}).\n"
"Run this script with --force if you want to proceed anyway."
.format(py_version_output.strip()) + end_format)
sys.exit(1)
print(green + 'Success!' + end_format)