]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/setup-virtualenv.sh: pass --use-feature=2020-resolver to pip
authorKefu Chai <kchai@redhat.com>
Thu, 8 Oct 2020 07:13:36 +0000 (15:13 +0800)
committerBrad Hubbard <bhubbard@redhat.com>
Wed, 12 May 2021 23:21:19 +0000 (09:21 +1000)
as long as pip supports this option, pass it to `pip install`

to silence warnings and errors like:

ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

autopep8 1.5.4 requires pycodestyle>=2.6.0, but you'll have pycodestyle 2.5.0 which is incompatible.
pytest-cov 2.10.1 requires pytest>=4.6, but you'll have pytest 3.10.1 which is incompatible.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit fa9e2bfd4b3648f08ed3a88ce737d432ab97cce1)

src/tools/setup-virtualenv.sh

index af945e2c5a46fba68beb2aca06aadebbf3fac297..f799784b45141bf2437d93a919e37a561108dded 100755 (executable)
@@ -66,9 +66,17 @@ else
     DISABLE_PIP_VERSION_CHECK=
 fi
 
+if pip --help | grep -q use-feature; then
+    USE_FEATURE=--use-feature=2020-resolver
+else
+    USE_FEATURE=
+fi
+
 # older versions of pip will not install wrap_console scripts
 # when using wheel packages
-pip $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install --upgrade 'pip >= 6.1'
+pip $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install \
+    $USE_FEATURE \
+    --upgrade 'pip >= 6.1'
 
 if pip --help | grep -q disable-pip-version-check; then
     DISABLE_PIP_VERSION_CHECK=--disable-pip-version-check
@@ -80,7 +88,10 @@ if test -d wheelhouse ; then
     export NO_INDEX=--no-index
 fi
 
-pip $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install $NO_INDEX --find-links=file://$(pwd)/wheelhouse 'tox >=2.9.1'
+pip $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install \
+    $USE_FEATURE \
+    $NO_INDEX \
+    --find-links=file://$(pwd)/wheelhouse 'tox >=2.9.1'
 
 require_files=$(ls *requirements*.txt 2>/dev/null) || true
 constraint_files=$(ls *constraints*.txt 2>/dev/null) || true
@@ -91,6 +102,8 @@ if test "$require"; then
     if ! test -f $md5 || ! md5sum -c wheelhouse/md5 > /dev/null; then
         NO_INDEX=''
     fi
-    pip --exists-action i $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install $NO_INDEX \
-      --find-links=file://$(pwd)/wheelhouse $require $constraint 
+    pip --exists-action i $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install \
+        $USE_FEATURE \
+        $NO_INDEX \
+        --find-links=file://$(pwd)/wheelhouse $require $constraint
 fi