Factor out venv-installation into a script.

This commit is contained in:
Eklavya Sharma 2016-07-20 17:58:56 +05:30 committed by Tim Abbott
parent c791037166
commit 852c49a44e
2 changed files with 18 additions and 4 deletions

View File

@ -178,10 +178,7 @@ def main():
DEV_REQS_FILE = os.path.join(ZULIP_PATH, "requirements", "py3_dev.txt")
setup_virtualenv(VENV_PATH, DEV_REQS_FILE, virtualenv_args=['-p', 'python3'])
else:
DEV_REQS_FILE = os.path.join(ZULIP_PATH, "requirements", "py2_dev.txt")
setup_virtualenv(PY2_VENV_PATH, DEV_REQS_FILE)
DEV_REQS_FILE = os.path.join(ZULIP_PATH, "requirements", "py3_dev.txt")
setup_virtualenv(PY3_VENV_PATH, DEV_REQS_FILE, virtualenv_args=['-p', 'python3'])
run(["tools/setup/setup-venvs"])
# Put Python2 virtualenv activation in our .bash_profile.
with open(os.path.expanduser('~/.bash_profile'), 'w+') as bash_profile:

17
tools/setup/setup-venvs Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env python
import os
import sys
from os.path import dirname, abspath
ZULIP_PATH = dirname(dirname(dirname(abspath(__file__))))
if ZULIP_PATH not in sys.path:
sys.path.append(ZULIP_PATH)
from scripts.lib.setup_venv import setup_virtualenv
PY2_DEV_REQS_FILE = os.path.join(ZULIP_PATH, "requirements", "py2_dev.txt")
setup_virtualenv("/srv/zulip-venv", PY2_DEV_REQS_FILE)
PY3_DEV_REQS_FILE = os.path.join(ZULIP_PATH, "requirements", "py3_dev.txt")
setup_virtualenv("/srv/zulip-py3-venv", PY3_DEV_REQS_FILE, virtualenv_args=['-p', 'python3'])