mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
setup_venv: Added get_venv_dependencies function.
Added a get_venv_dependencies() function in setup_venv.py which returns VENV_DEPENDENCIES according to the vendor and os_version. The reason for adding this function was because python-dev will be depreciated in Focal but can be used as python2-dev so when adding support for Focal VENV_DEPENDENCIES should to be os_version dependent.
This commit is contained in:
@@ -23,7 +23,6 @@ VENV_DEPENDENCIES = [
|
||||
"libldap2-dev",
|
||||
"libmemcached-dev",
|
||||
"python3-dev", # Needed to install typed-ast dependency of mypy
|
||||
"python-dev",
|
||||
"python3-pip",
|
||||
"python-pip",
|
||||
"virtualenv",
|
||||
@@ -45,6 +44,10 @@ VENV_DEPENDENCIES = [
|
||||
"jq", # Used by scripts/lib/install-node to check yarn version
|
||||
]
|
||||
|
||||
# python-dev is depreciated in Focal but can be used as python2-dev.
|
||||
# So it is removed from VENV_DEPENDENCIES and added here.
|
||||
PYTHON_DEV_DEPENDENCY = "python{}-dev"
|
||||
|
||||
COMMON_YUM_VENV_DEPENDENCIES = [
|
||||
"libffi-devel",
|
||||
"freetype-devel",
|
||||
@@ -99,6 +102,13 @@ YUM_THUMBOR_VENV_DEPENDENCIES = [
|
||||
"gifsicle",
|
||||
]
|
||||
|
||||
def get_venv_dependencies(vendor, os_version):
|
||||
# type: (str, str) -> List[str]
|
||||
if vendor == 'ubuntu' and os_version == '20.04':
|
||||
return VENV_DEPENDENCIES + [PYTHON_DEV_DEPENDENCY.format("2"), ]
|
||||
else:
|
||||
return VENV_DEPENDENCIES + [PYTHON_DEV_DEPENDENCY.format(""), ]
|
||||
|
||||
def install_venv_deps(pip, requirements_file, python2):
|
||||
# type: (str, str, bool) -> None
|
||||
pip_requirements = os.path.join(ZULIP_PATH, "requirements", "pip2.txt" if python2 else "pip.txt")
|
||||
|
Reference in New Issue
Block a user