2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-03 23:45:27 +00:00

[#2539] hammer.py: use venv or packages instead of virtualenv

This is in the detriment of virtualenv which is considered deprecated.
This commit is contained in:
Andrei Pavel
2022-09-05 22:30:57 +03:00
parent 2c17dabcc7
commit a6c139d312

View File

@@ -1489,7 +1489,7 @@ def prepare_system_local(features, check_times):
# prepare fedora # prepare fedora
if system == 'fedora': if system == 'fedora':
packages = ['make', 'autoconf', 'automake', 'libtool', 'gcc-c++', 'openssl-devel', packages = ['make', 'autoconf', 'automake', 'libtool', 'gcc-c++', 'openssl-devel',
'log4cplus-devel', 'boost-devel', 'libpcap-devel', 'python3-virtualenv'] 'log4cplus-devel', 'boost-devel', 'libpcap-devel']
if 'native-pkg' in features: if 'native-pkg' in features:
packages.extend(['rpm-build', 'python3-devel']) packages.extend(['rpm-build', 'python3-devel'])
@@ -1547,16 +1547,13 @@ def prepare_system_local(features, check_times):
'libtool', 'log4cplus-devel', 'make', 'libtool', 'log4cplus-devel', 'make',
'openssl-devel'] 'openssl-devel']
if revision == '7': if revision in ['7', '8']:
# Install newer version of Boost in case users want to opt-in with: # Install newer version of Boost in case users want to opt-in with:
# --with-boost-include=/usr/include/boost169 --with-boost-lib-dir=/usr/lib64/boost169 # --with-boost-include=/usr/include/boost169 --with-boost-lib-dir=/usr/lib64/boost169
packages.append('boost169-devel') packages.append('boost169-devel')
if 'native-pkg' in features: if 'native-pkg' in features:
packages.extend(['bison', 'flex', 'rpm-build', 'python3-devel']) packages.extend(['bison', 'flex', 'python3-devel', 'rpm-build'])
if 'docs' in features:
packages.extend(['python3-pip'])
if 'mysql' in features: if 'mysql' in features:
packages.extend(['mariadb', 'mariadb-server']) packages.extend(['mariadb', 'mariadb-server'])
@@ -1601,8 +1598,6 @@ def prepare_system_local(features, check_times):
install_pkgs(packages, env=env, check_times=check_times) install_pkgs(packages, env=env, check_times=check_times)
if 'docs' in features: if 'docs' in features:
execute('pip install virtualenv',
env=env, timeout=120, check_times=check_times)
execute('python3 -m venv ~/venv', execute('python3 -m venv ~/venv',
env=env, timeout=60, check_times=check_times) env=env, timeout=60, check_times=check_times)
execute('~/venv/bin/pip install sphinx sphinx-rtd-theme', execute('~/venv/bin/pip install sphinx sphinx-rtd-theme',
@@ -1620,10 +1615,7 @@ def prepare_system_local(features, check_times):
packages.append('boost169-devel') packages.append('boost169-devel')
if 'native-pkg' in features: if 'native-pkg' in features:
packages.extend(['python3-devel', 'rpm-build']) packages.extend(['bison', 'flex', 'python3-devel', 'rpm-build'])
if 'docs' in features and int(revision) < 9:
packages.extend(['python3-virtualenv'])
if 'mysql' in features: if 'mysql' in features:
packages.extend(['mariadb', 'mariadb-server']) packages.extend(['mariadb', 'mariadb-server'])
@@ -1798,11 +1790,12 @@ def prepare_system_local(features, check_times):
install_pkgs(packages, env=env, timeout=240, check_times=check_times) install_pkgs(packages, env=env, timeout=240, check_times=check_times)
if 'docs' in features and revision == '8': if 'docs' in features:
execute('virtualenv -p /usr/bin/python3 ~/venv', if revision == '8':
env=env, timeout=60, check_times=check_times) execute('python3 -m venv ~/venv',
execute('~/venv/bin/pip install sphinx sphinx-rtd-theme', env=env, timeout=60, check_times=check_times)
env=env, timeout=120, check_times=check_times) execute('~/venv/bin/pip install sphinx sphinx-rtd-theme',
env=env, timeout=120, check_times=check_times)
# prepare freebsd # prepare freebsd
elif system == 'freebsd': elif system == 'freebsd':
@@ -1873,10 +1866,10 @@ def prepare_system_local(features, check_times):
packages.extend(['py-sphinx', 'py-sphinx_rtd_theme']) packages.extend(['py-sphinx', 'py-sphinx_rtd_theme'])
elif revision == '3.11': elif revision == '3.11':
packages.extend(['py3-sphinx']) packages.extend(['py3-sphinx'])
elif revision == '3.16': elif float(revision) < 3.16:
packages.extend(['py3-pip'])
else:
packages.extend(['py3-sphinx', 'py3-sphinx_rtd_theme']) packages.extend(['py3-sphinx', 'py3-sphinx_rtd_theme'])
else:
packages.extend(['py3-pip'])
if 'unittest' in features: if 'unittest' in features:
_install_gtest_sources() _install_gtest_sources()
@@ -1911,8 +1904,9 @@ def prepare_system_local(features, check_times):
install_pkgs(packages, env=env, timeout=6 * 60, check_times=check_times) install_pkgs(packages, env=env, timeout=6 * 60, check_times=check_times)
# work around outdated sphinx packages on alpine 3.16 # work around outdated sphinx packages on alpine 3.16
if 'docs' in features and revision == '3.16': if 'docs' in features:
execute('sudo pip3 install -U sphinx sphinx_rtd_theme') if float(revision) >= 3.16:
execute('sudo pip3 install -U sphinx sphinx_rtd_theme')
# check for existence of 'vagrant' user and 'abuild' group before adding him to the group # check for existence of 'vagrant' user and 'abuild' group before adding him to the group
try: try: