From 5d7bb098b9f2e49f47a6ff5f02eafe59b7e91782 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 27 Oct 2017 19:20:03 +0200 Subject: [PATCH] python: build protobuf serializer for Python --- Dockerfile.dev | 3 ++- Dockerfile.dev-centos | 3 ++- Dockerfile.dev-ubuntu | 3 ++- clients/Makefile.inc | 2 ++ clients/python/.gitignore | 4 ++++ clients/python/Makefile.inc | 24 ++++++++++++++++++++++++ 6 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 clients/python/.gitignore create mode 100644 clients/python/Makefile.inc diff --git a/Dockerfile.dev b/Dockerfile.dev index 54a6607a5..8e33d7bc4 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -60,7 +60,8 @@ RUN dnf -y install \ # Tools for debugging, coverage, profiling RUN pip install \ - gcovr + gcovr \ + protobuf # Some of the dependencies are only available in our own repo ADD https://villas.fein-aachen.org/packages/villas.repo /etc/yum.repos.d/ diff --git a/Dockerfile.dev-centos b/Dockerfile.dev-centos index 9a8b183a5..f50e0211c 100644 --- a/Dockerfile.dev-centos +++ b/Dockerfile.dev-centos @@ -66,7 +66,8 @@ RUN yum -y install \ # Tools for debugging, coverage, profiling RUN pip install \ - gcovr + gcovr \ + protobuf # Dependencies RUN yum -y install \ diff --git a/Dockerfile.dev-ubuntu b/Dockerfile.dev-ubuntu index 25d8322df..61b48d284 100644 --- a/Dockerfile.dev-ubuntu +++ b/Dockerfile.dev-ubuntu @@ -64,7 +64,8 @@ RUN apt-get update && apt-get install -y \ # Tools for debugging, coverage, profiling RUN pip install \ - gcovr + gcovr \ + protobuf # Dependencies RUN apt-get update && apt-get install -y \ diff --git a/clients/Makefile.inc b/clients/Makefile.inc index 3d488c616..79e330560 100644 --- a/clients/Makefile.inc +++ b/clients/Makefile.inc @@ -21,6 +21,8 @@ ################################################################################### CLIENTS = + +-include $(SRCDIR)/clients/python/Makefile.inc ifneq ($(wildcard $(SRCDIR)/thirdparty/libopal/include/opal/AsyncApi.h),) -include $(SRCDIR)/clients/opal/Makefile.inc diff --git a/clients/python/.gitignore b/clients/python/.gitignore new file mode 100644 index 000000000..c88f87224 --- /dev/null +++ b/clients/python/.gitignore @@ -0,0 +1,4 @@ +*.pyc + +# Generated code by Protobuf +*_pb2.py diff --git a/clients/python/Makefile.inc b/clients/python/Makefile.inc new file mode 100644 index 000000000..c802e18da --- /dev/null +++ b/clients/python/Makefile.inc @@ -0,0 +1,24 @@ +# Makefile. +# +# @author Steffen Vogel +# @copyright 2017, Institute for Automation of Complex Power Systems, EONERC +# @license GNU General Public License (version 3) +# +# VILLASnode +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +################################################################################### + +clients/python/villas_pb2.py: lib/io/villas.proto + protoc --proto_path=$(dir $^) --python_out=$(dir $@) $^