Differences between revisions 14 and 15
Revision 14 as of 2016-10-14 12:50:18
Size: 1261
Editor: mnovakovic
Comment:
Revision 15 as of 2016-10-27 17:21:50
Size: 1261
Editor: mnovakovic
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
From the docker container sysrepo/sysrepo-netopeer2:devel_20161013 you can build Python 3 bindings with the commands. From the docker container sysrepo/sysrepo-netopeer2:devel_20161027 you can build Python 3 bindings with the commands.

Sysrepo Python 3 bindings

When Sysrepo is to be compiled with language bindings for Python 3 make sure relevant Python packages are present on the build machine. In Ubuntu world that would be python3 and python3-dev packages. The sysrepo docker container comes with preinstalled Python 3 on Ubuntu 14.04. You can find out about that in the Dockerfile

To compile the Python 3 bindings use the cmake flag GEN_PYTHON_BINDINGS and GEN_PYTHON_VERSION.

From the docker container sysrepo/sysrepo-netopeer2:devel_20161027 you can build Python 3 bindings with the commands.

cd /opt/dev/sysrepo
mkdir build_python3
cd build_python3
cmake -DGEN_PYTHON_VERSION=3 ..
make -j2
make install

The code example used can be found here.

Now you can run the Python 3 examples with:

sysrepod -l 0
netopeer2-server
python3 swig/python3/examples/python3_application_example.py

You can watch the process in the asciinema video:

https://asciinema.org/a/89233

bindings/python3 (last edited 2016-10-27 17:21:50 by mnovakovic)