From 7a7395cacdf56a19bf0c6d1088c79b9b744d7dd1 Mon Sep 17 00:00:00 2001
From: Tom Vander Aa <vanderaa@imec.be>
Date: Tue, 6 Jun 2017 16:00:50 +0200
Subject: [PATCH] ENH: call generate.sh from setup.py

---
 python/setup.py | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/python/setup.py b/python/setup.py
index c39fa4b..1a0065b 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 
+from distutils.command.build_py import build_py as _build_py
 from distutils.core import setup
 import os
 
@@ -10,9 +11,20 @@ def read_version():
 LOOM_VERSION=read_version()
 print("LOOM_VERSION =", LOOM_VERSION)
 
+
+class build_protoc(_build_py):
+    """Also calls protoc"""
+    def run(self):
+        os.system("sh ./generate.sh")
+        _build_py.run(self)
+
+
+
 setup(name='loom',
       version=LOOM_VERSION,
       description='Python interface for Loom - workflow system',
       author='Loom team',
       url='',
-      packages=['loom'])
+      packages=['loom'],
+      cmdclass={'build_py': build_protoc}
+      )
-- 
GitLab