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:
parent
d4500a3b7a
commit
19c3792af5
|
@ -40,6 +40,12 @@ the Python version this command is executed with."""
|
||||||
py_version = tuple(int(num) for num in py_version_list)
|
py_version = tuple(int(num) for num in py_version_list)
|
||||||
venv_name = 'zulip-api-py{}-venv'.format(py_version[0])
|
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)
|
venv_dir = os.path.join(base_dir, venv_name)
|
||||||
if not os.path.isdir(venv_dir):
|
if not os.path.isdir(venv_dir):
|
||||||
try:
|
try:
|
||||||
|
@ -88,11 +94,6 @@ the Python version this command is executed with."""
|
||||||
install_dependencies('requirements.txt')
|
install_dependencies('requirements.txt')
|
||||||
if py_version > (3, 1):
|
if py_version > (3, 1):
|
||||||
install_dependencies('py3_requirements.txt')
|
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)
|
print(green + 'Success!' + end_format)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue