]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
admin: be compatible with pip shipped by distro older than v20.2 37527/head
authorKefu Chai <kchai@redhat.com>
Fri, 2 Oct 2020 16:41:06 +0000 (00:41 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 2 Oct 2020 16:45:39 +0000 (00:45 +0800)
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 <kchai@redhat.com>
admin/build-doc

index 239819b98cd8dffde68db524adaa447ea00a953d..f52f17bb66842ae70e6e43612af2088e10fa7fb3 100755 (executable)
@@ -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 \