Support of Python 3.10 64/13264/8
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Mon, 24 Apr 2023 23:14:45 +0000 (01:14 +0200)
committerMark Beierl <mark.beierl@canonical.com>
Wed, 10 May 2023 14:02:51 +0000 (10:02 -0400)
Adds a patch to pyangbind to continue to work with updated
packages

Change-Id: I0b33375ddbb96734ae72669baaef744bf2152bb1
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
Signed-off-by: Mark Beierl <mark.beierl@canonical.com>
Dockerfile
devops-stages/stage-archive.sh
devops-stages/stage-build.sh
pyangbind.patch [new file with mode: 0644]
tox.ini

index 3ca4992..9623f7f 100644 (file)
@@ -21,7 +21,7 @@
 #   devops-stages/stage-build.sh
 #
 
-FROM ubuntu:20.04
+FROM ubuntu:22.04
 
 ARG APT_PROXY
 RUN if [ ! -z $APT_PROXY ] ; then \
@@ -34,13 +34,15 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
         debhelper \
         dh-python \
         git \
-        python3.8 \
+        python3 \
         python3-all \
-        python3.8-dev \
-        python3-setuptools
+        python3-dev \
+        python3-setuptools \
+        python3-pip \
+        tox
 
-RUN python3 -m easy_install pip==21.3.1
-RUN pip install tox==3.24.5
+ENV LC_ALL C.UTF-8
+ENV LANG C.UTF-8
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
     DEBIAN_FRONTEND=noninteractive apt-get -y install wget build-essential dh-make \
index a64b87b..2e7a6fd 100755 (executable)
@@ -20,5 +20,3 @@ rm -rf pool
 rm -rf dists
 mkdir -p pool/$MDG
 mv deb_dist/*.deb pool/$MDG/
-mv *.deb pool/$MDG/
-
index e8b397b..6268698 100755 (executable)
@@ -15,4 +15,4 @@
 
 rm -rf dist deb_dist osm*.tar.gz *.egg-info .eggs
 
-tox -e dist
+tox -e dist --recreate
diff --git a/pyangbind.patch b/pyangbind.patch
new file mode 100644 (file)
index 0000000..3077299
--- /dev/null
@@ -0,0 +1,46 @@
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+
+*** .tox/cover/lib/python3.10/site-packages/pyangbind/lib/yangtypes.py 2023-05-10 06:50:57.876027148 -0400
+--- .tox/cover/lib/python3.10/site-packages/pyangbind/lib/yangtypes.py 2023-05-10 06:51:11.772022417 -0400
+*************** limitations under the License.
+*** 22,27 ****
+--- 22,28 ----
+  from __future__ import unicode_literals
+
+  import collections
++ from six.moves import collections_abc
+  import copy
+  import uuid
+  from decimal import Decimal
+*************** def TypedListType(*args, **kwargs):
+*** 372,378 ****
+    if not isinstance(allowed_type, list):
+      allowed_type = [allowed_type]
+
+!   class TypedList(collections.MutableSequence):
+      _pybind_generated_by = "TypedListType"
+      _list = list()
+
+--- 373,379 ----
+    if not isinstance(allowed_type, list):
+      allowed_type = [allowed_type]
+
+!   class TypedList(collections_abc.MutableSequence):
+      _pybind_generated_by = "TypedListType"
+      _list = list()
+
diff --git a/tox.ini b/tox.ini
index aa926aa..7eb9118 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -23,7 +23,7 @@ toxworkdir = /tmp/.tox
 
 [testenv]
 usedevelop = True
-basepython = python3.8
+basepython = python3.10
 setenv = VIRTUAL_ENV={envdir}
          PYTHONDONTWRITEBYTECODE = 1
 passenv = HOME
@@ -43,6 +43,7 @@ skip_install = false
 deps =  {[testenv]deps}
         -r{toxinidir}/requirements-test.txt
 commands =
+        sh -c "patch {toxworkdir}/cover/lib/python3.10/site-packages/pyangbind/lib/yangtypes.py < pyangbind.patch"
         sh -c 'make clean'
         sh -c 'make models Q=""'
         sh -c 'rm -f nosetests.xml'
@@ -99,6 +100,7 @@ deps =  {[testenv]deps}
 # In the commands, we copy the requirements.txt to be presented as a source file (.py)
 # so it gets included in the .deb package for others to consume
 commands =
+        sh -c "patch {toxworkdir}/dist/lib/python3.10/site-packages/pyangbind/lib/yangtypes.py < pyangbind.patch"
         sh -c 'make clean'
         sh -c 'make Q=""'
         sh -c 'cp requirements.txt osm_im/requirements.txt'