Browse Source

Only generate protos in development

Fixes #333.
Tamir Duberstein 10 years ago
parent
commit
e4f4d9fe83
2 changed files with 8 additions and 0 deletions
  1. 4 0
      python/setup.py
  2. 4 0
      travis.sh

+ 4 - 0
python/setup.py

@@ -87,6 +87,10 @@ def generate_proto(source):
 
 
 def GenerateUnittestProtos():
+  # Unittest protos are only needed for development.
+  if not os.path.exists("../.git"):
+    return
+
   generate_proto("../src/google/protobuf/unittest.proto")
   generate_proto("../src/google/protobuf/unittest_custom_options.proto")
   generate_proto("../src/google/protobuf/unittest_import.proto")

+ 4 - 0
travis.sh

@@ -95,6 +95,8 @@ build_python() {
   cd python
   python setup.py build
   python setup.py test
+  python setup.py sdist
+  sudo pip install virtualenv && virtualenv /tmp/protoenv && /tmp/protoenv/bin/pip install dist/*
   cd ..
 }
 
@@ -107,6 +109,8 @@ build_python_cpp() {
   cd python
   python setup.py build --cpp_implementation
   python setup.py test --cpp_implementation
+  python setup.py sdist --cpp_implementation
+  sudo pip install virtualenv && virtualenv /tmp/protoenv && /tmp/protoenv/bin/pip install dist/*
   cd ..
 }