diff --git a/python/setup.py b/python/setup.py index 228b00b3e4..a1365fba57 100755 --- a/python/setup.py +++ b/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") diff --git a/travis.sh b/travis.sh index a7dbc8408c..24e0a4e050 100755 --- a/travis.sh +++ b/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 .. }