setup_venv: Clean up VENV_DEPENDENCIES using parsed lsb_release.

This is mostly a cleanup, but it should also save 50ms in the runtime
of create-production-venv.
This commit is contained in:
Tim Abbott
2018-05-29 10:37:11 -07:00
parent 5d39a0f0fc
commit 0fabff6dda
3 changed files with 7 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
import os
import subprocess
from scripts.lib.zulip_tools import run, ENDC, WARNING
from scripts.lib.zulip_tools import run, ENDC, WARNING, parse_lsb_release
from scripts.lib.hash_reqs import expand_reqs
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
@@ -37,6 +37,12 @@ VENV_DEPENDENCIES = [
"libpq-dev", # Needed by psycopg2
]
codename = parse_lsb_release()["DISTRIB_CODENAME"]
if codename != "trusty":
# Workaround for the fact that trusty has a different package name here.
VENV_DEPENDENCIES.append("virtualenv")
THUMBOR_VENV_DEPENDENCIES = [
"libcurl4-openssl-dev",
"libjpeg-dev",