From c190959b588326dc176cfe2200a93d23cc6eb33e Mon Sep 17 00:00:00 2001 From: rht Date: Wed, 19 Dec 2018 01:45:32 +0000 Subject: [PATCH] provision: Move CentOS & Fedora venv deps construction to setup_venv.py. They will be reused in production setup. --- scripts/lib/setup_venv.py | 14 ++++++++++++++ tools/lib/provision.py | 21 ++++++--------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/scripts/lib/setup_venv.py b/scripts/lib/setup_venv.py index 90fde13f47..b183bffdab 100644 --- a/scripts/lib/setup_venv.py +++ b/scripts/lib/setup_venv.py @@ -62,6 +62,20 @@ COMMON_YUM_VENV_DEPENDENCIES = [ "jq", ] +REDHAT_VENV_DEPENDENCIES = COMMON_YUM_VENV_DEPENDENCIES + [ + "python34-devel", + "python34-pip", + "python34-six", + "python-virtualenv", +] + +FEDORA_VENV_DEPENDENCIES = COMMON_YUM_VENV_DEPENDENCIES + [ + "python3-devel", + "python3-pip", + "python3-six", + "virtualenv", # see https://unix.stackexchange.com/questions/27877/install-virtualenv-on-fedora-16 +] + codename = parse_lsb_release()["DISTRIB_CODENAME"] if codename != "trusty": diff --git a/tools/lib/provision.py b/tools/lib/provision.py index c9418593b1..104b44f063 100755 --- a/tools/lib/provision.py +++ b/tools/lib/provision.py @@ -17,8 +17,9 @@ sys.path.append(ZULIP_PATH) from scripts.lib.zulip_tools import run, subprocess_text_output, OKBLUE, ENDC, WARNING, \ get_dev_uuid_var_path, FAIL, parse_lsb_release, file_or_package_hash_updated from scripts.lib.setup_venv import ( - setup_virtualenv, VENV_DEPENDENCIES, COMMON_YUM_VENV_DEPENDENCIES, - THUMBOR_VENV_DEPENDENCIES, YUM_THUMBOR_VENV_DEPENDENCIES + setup_virtualenv, VENV_DEPENDENCIES, REDHAT_VENV_DEPENDENCIES, + THUMBOR_VENV_DEPENDENCIES, YUM_THUMBOR_VENV_DEPENDENCIES, + FEDORA_VENV_DEPENDENCIES ) from scripts.lib.node_cache import setup_node_modules, NODE_MODULES_CACHE_PATH @@ -169,7 +170,7 @@ COMMON_YUM_DEPENDENCIES = COMMON_DEPENDENCIES + [ "freetype-devel", "fontconfig-devel", "libstdc++" -] + COMMON_YUM_VENV_DEPENDENCIES + YUM_THUMBOR_VENV_DEPENDENCIES +] + YUM_THUMBOR_VENV_DEPENDENCIES if vendor in ["Ubuntu", "Debian"]: SYSTEM_DEPENDENCIES = UBUNTU_COMMON_APT_DEPENDENCIES + [ @@ -187,12 +188,7 @@ elif vendor in ["CentOS", "RedHat"]: "postgresql{0}-devel", "postgresql{0}-pgroonga", ] - ] + [ # venv dependencies - "python34-devel", - "python34-pip", - "python34-six", - "python-virtualenv", - ] + ] + REDHAT_VENV_DEPENDENCIES elif vendor == "Fedora": SYSTEM_DEPENDENCIES = COMMON_YUM_DEPENDENCIES + [ pkg.format(POSTGRES_VERSION) for pkg in [ @@ -200,12 +196,7 @@ elif vendor == "Fedora": "postgresql{0}", "postgresql{0}-devel", ] - ] + [ # venv dependencies - "python3-devel", - "python3-pip", - "python3-six", - "virtualenv", # see https://unix.stackexchange.com/questions/27877/install-virtualenv-on-fedora-16 - ] + ] + FEDORA_VENV_DEPENDENCIES if family == 'redhat': TSEARCH_STOPWORDS_PATH = "/usr/pgsql-%s/share/tsearch_data/" % (POSTGRES_VERSION,)