Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions protobuf_setuptools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import sys
import subprocess

from os import path as op
from os import path as op
from distutils.spawn import find_executable
from setuptools.command.build_py import build_py
from datetime import datetime


class ProtoBuild(build_py):
Expand Down Expand Up @@ -39,6 +40,11 @@ def run(self):

if (not op.exists(output) or (op.getmtime(source) > op.getmtime(output))):
sys.stderr.write('Protobuf-compiling ' + source + '\n')
subprocess.check_call([self.find_protoc(), '--python_out=.', source])


subprocess.check_call([self.find_protoc(),
'--python_out=%s' % packagedir,
'-I%s' % packagedir,
source])
else:
sys.stderr.write("Proto file %s already generated at %s, pass\n" %
(output,
datetime.fromtimestamp(op.getmtime(output))))