build additional osm-im python3 package 47/6447/6
authorMike Marchetti <mmarchetti@sandvine.com>
Wed, 29 Aug 2018 19:40:41 +0000 (15:40 -0400)
committerMike Marchetti <mmarchetti@sandvine.com>
Thu, 30 Aug 2018 14:34:51 +0000 (10:34 -0400)
Signed-off-by: Mike Marchetti <mmarchetti@sandvine.com>
Change-Id: If2468a2f9f53adc2f6a479bd9654c154c8bbe323

Dockerfile
Makefile
tox.ini

index c30bf91..064baad 100644 (file)
@@ -17,8 +17,8 @@
 FROM ubuntu:16.04
 
 RUN  apt-get update && \
-  DEBIAN_FRONTEND=noninteractive apt-get -y install git make wget python python-pip debhelper tox && \
-  DEBIAN_FRONTEND=noninteractive pip install pip==9.0.3 && \
-  DEBIAN_FRONTEND=noninteractive pip install -U pyang pyangbind && \
-  DEBIAN_FRONTEND=noninteractive pip install -U stdeb
-
+  DEBIAN_FRONTEND=noninteractive apt-get -y install git make wget python python3 python3-all python3-pip python-pip debhelper tox python-setuptools python3-setuptools && \
+  DEBIAN_FRONTEND=noninteractive pip3 install pip==9.0.3 && \
+  DEBIAN_FRONTEND=noninteractive pip3 install -U pyang pyangbind && \
+  DEBIAN_FRONTEND=noninteractive pip3 install -U stdeb && \
+  DEBIAN_FRONTEND=noninteractive pip2 install -U stdeb
index 2d82418..26e3843 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -16,8 +16,8 @@
 # NOTE: pyang and pyangbind are required for build
 
 PYANG:= pyang
-PYBINDPLUGIN:=$(shell /usr/bin/env python -c \
-                   'import pyangbind; import os; print "%s/plugin" % os.path.dirname(pyangbind.__file__)')
+PYBINDPLUGIN:=$(shell /usr/bin/env python3 -c \
+                   'import pyangbind; import os; print("{}/plugin".format(os.path.dirname(pyangbind.__file__)))')
 
 YANG_DESC_MODELS := vnfd nsd
 YANG_RECORD_MODELS := vnfr nsr
@@ -84,16 +84,23 @@ $(RW_PB_EXT):
 
 package:
        tox -e build
+       tox -e build3
 
 pyangbind: pyang
        git clone https://github.com/alf-tierno/pyangbind
-       cd pyangbind; git checkout issue151; python setup.py --command-packages=stdeb.command bdist_deb; cd ..
+       cd pyangbind; git checkout issue151; \
+       python setup.py --command-packages=stdeb.command bdist_deb; \
+       python3 setup.py --command-packages=stdeb.command bdist_deb; \
+       cd ..
        mkdir -p deb_dist
        cp pyangbind/deb_dist/*.deb deb_dist
 
 pyang:
        git clone https://github.com/mbj4668/pyang
-       cd pyang; python setup.py --command-packages=stdeb.command bdist_deb; cd ..
+       cd pyang; \
+       python setup.py --command-packages=stdeb.command bdist_deb;  \
+       python3 setup.py --command-packages=stdeb.command bdist_deb;  \
+       cd ..
        mkdir -p deb_dist
        cp pyang/deb_dist/*.deb deb_dist
 
diff --git a/tox.ini b/tox.ini
index c1c0215..0b66370 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -19,3 +19,9 @@ basepython = python
 deps = stdeb
        setuptools-version-command
 commands = python setup.py --command-packages=stdeb.command bdist_deb
+
+[testenv:build3]
+basepython = python3
+deps = stdeb
+       setuptools-version-command
+commands = python3 setup.py --command-packages=stdeb.command bdist_deb