From 70caf0dfe8ca47711b6fd5bcb5672355d7082c11 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 3 Oct 2020 00:41:06 +0800 Subject: [PATCH] admin: be compatible with pip shipped by distro older than v20.2 pip v20.2 introduced a new option named --use-feature, which is not available with <20.2. so we need to check for it before using it. see also https://pip.pypa.io/en/stable/user_guide/#changes-to-the-pip-dependency-resolver-in-20-2-2020 Fixes: https://tracker.ceph.com/issues/47636 Signed-off-by: Kefu Chai --- admin/build-doc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/admin/build-doc b/admin/build-doc index 239819b98cd..f52f17bb668 100755 --- a/admin/build-doc +++ b/admin/build-doc @@ -57,7 +57,14 @@ cd build-doc if [ ! -e $vdir ]; then virtualenv --python=python3 $vdir fi -$vdir/bin/pip install --use-feature=2020-resolver --quiet -r $TOPDIR/admin/doc-requirements.txt -r $TOPDIR/admin/doc-python-common-requirements.txt + +# be compatible with pip shipped by distro older v20.2 +if $vdir/bin/pip --use-feature=2020-resolver >/dev/null 2>&1 ; then + PIP_INSTALL="$vdir/bin/pip install --use-feature=2020-resolver" +else + PIP_INSTALL="$vdir/bin/pip install" +fi +$PIP_INSTALL --quiet -r $TOPDIR/admin/doc-requirements.txt -r $TOPDIR/admin/doc-python-common-requirements.txt install -d -m0755 \ $TOPDIR/build-doc/output/html \