Python 3.5 and python2 tox in Ubuntu 16.04 90/63290/5
authorAric Gardner <agardner@linuxfoundation.org>
Wed, 4 Mar 2020 20:46:18 +0000 (15:46 -0500)
committerAric Gardner <agardner@linuxfoundation.org>
Thu, 5 Mar 2020 20:20:50 +0000 (15:20 -0500)
Ubuntu 16.04 calls a python2 version of tox.
so we must upgrade it even if we are testing with python3

ubuntu 16.04 has python 3.5 we must pinn the zipp package

Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
Change-Id: I4d2513c15baf4f00313885b35f8f0a297874b2b3

releasenotes/notes/fix-python-35-ubuntu1604-d9d6cec207b568d7.yaml [new file with mode: 0644]
shell/python-tools-install.sh
shell/tox-install.sh

diff --git a/releasenotes/notes/fix-python-35-ubuntu1604-d9d6cec207b568d7.yaml b/releasenotes/notes/fix-python-35-ubuntu1604-d9d6cec207b568d7.yaml
new file mode 100644 (file)
index 0000000..0067ad3
--- /dev/null
@@ -0,0 +1,9 @@
+---
+fixes:
+  - |
+    Workarounds for aging python 3.5 on Ubuntu 16.04 builders 
+    Ubuntu 16.04 calls a python2 version of tox we must upgrade
+    it even if we are testing with python3
+    ubuntu 16.04 has runs python 3.5 we must pinn the zipp package
+    more pinns will be needed as packages drop support for python 3.5
+    ideally projects will move away from this distro.
index 3a852d3..7ac7f43 100644 (file)
@@ -33,6 +33,16 @@ tox>=3.7.0 # Tox 3.7 or greater is necessary for parallel mode support
 yq
 EOF
 
+
+#Python 3.5 in Ubuntu 16.04 workaround
+if [[ -f /etc/lsb-release ]]; then
+   # shellcheck disable=SC1091
+   source /etc/lsb-release
+   if [[ $DISTRIB_RELEASE == "16.04" ]]; then
+     echo "zipp==1.1.0" >> "$requirements_file"
+   fi
+fi
+
     # Use `python -m pip` to upgrade to the latest pip into user site-packages
     python3 -m pip install --user --quiet --upgrade pip
     python3 -m pip install --user --quiet --no-warn-script-location --upgrade setuptools
index cc815cc..e9d88b5 100644 (file)
@@ -14,12 +14,24 @@ echo "---> tox-install.sh"
 # Use -x to show value of $PYTHON in output
 set -eux -o pipefail
 
-# Tox version is pulled in through detox to mitigate version conflict
+#Python 3.5 and python2 tox in Ubuntu 16.04 workaround
+done="False"
+if [[ -f /etc/lsb-release ]]; then
+   # shellcheck disable=SC1091
+   source /etc/lsb-release
+   if [[ $DISTRIB_RELEASE == "16.04" ]]; then
+       python2 -m pip install --user --quiet --upgrade tox tox-pyenv virtualenv more-itertools~=5.0.0
+       python3 -m pip install --user --quiet --upgrade tox tox-pyenv virtualenv zipp==1.1.0
+       done="True"
+   fi
+fi
 
-if [[ $PYTHON == "python2" ]]; then
-    $PYTHON -m pip install --user --quiet --upgrade tox tox-pyenv virtualenv more-itertools~=5.0.0
-else
-    $PYTHON -m pip install --user --quiet --upgrade tox tox-pyenv virtualenv
+if [[ $done != "True" ]]; then
+    if [[ $PYTHON == "python2" ]]; then
+        $PYTHON -m pip install --user --quiet --upgrade tox tox-pyenv virtualenv more-itertools~=5.0.0
+    else
+        $PYTHON -m pip install --user --quiet --upgrade tox tox-pyenv virtualenv
+    fi
 fi
 
 # installs are silent, show version details in log