Skip to content

Commit

Permalink
create-production-venv: Add PY3 support to production venv creation s…
Browse files Browse the repository at this point in the history
…cript.

Create production python virtual env based on system python version.
  • Loading branch information
kkanahin authored and timabbott committed Oct 11, 2016
1 parent e7642da commit 14545d1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/lib/create-production-venv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

import os
import argparse
Expand All @@ -19,5 +19,10 @@ args = parser.parse_args()
# install dependencies for setting up the virtualenv
run(["apt-get", "-y", "install"] + VENV_DEPENDENCIES)

cached_venv_path = setup_virtualenv(args.target, os.path.join(ZULIP_PATH, "requirements", "py2_prod.txt"))
python_version = sys.version_info[0]

cached_venv_path = setup_virtualenv(
args.target,
os.path.join(ZULIP_PATH, "requirements", "py{}_prod.txt".format(python_version)),
virtualenv_args=['-p', 'python{}'.format(python_version)])
# Now the virtualenv has been activated

0 comments on commit 14545d1

Please sign in to comment.