diff --git a/python/setup.py b/python/setup.py index 1764ec87cadcf..a1365fba577a4 100755 --- a/python/setup.py +++ b/python/setup.py @@ -1,9 +1,10 @@ #! /usr/bin/env python # # See README for usage instructions. -import sys +import glob import os import subprocess +import sys # We must use setuptools, not distutils, because we need to use the # namespace_packages option for the "google" package. @@ -86,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") @@ -153,15 +158,7 @@ def run(self): ext_module_list.append( Extension( "google.protobuf.pyext._message", - [ - "google/protobuf/pyext/descriptor.cc", - "google/protobuf/pyext/descriptor_containers.cc", - "google/protobuf/pyext/descriptor_pool.cc", - "google/protobuf/pyext/extension_dict.cc", - "google/protobuf/pyext/message.cc", - "google/protobuf/pyext/repeated_composite_container.cc", - "google/protobuf/pyext/repeated_scalar_container.cc", - ], + glob.glob('google/protobuf/pyext/*.cc'), define_macros=[('GOOGLE_PROTOBUF_HAS_ONEOF', '1')], include_dirs=[".", "../src"], libraries=['protobuf'], diff --git a/ruby/travis-test.sh b/ruby/travis-test.sh index e94af80abb806..a240dd6573301 100755 --- a/ruby/travis-test.sh +++ b/ruby/travis-test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Exit on any error. set -e diff --git a/travis.sh b/travis.sh index 556bc91c77df3..24e0a4e050497 100755 --- a/travis.sh +++ b/travis.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash build_cpp() { ./autogen.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 .. } @@ -102,10 +104,13 @@ build_python_cpp() { ./autogen.sh ./configure make -j2 - export LD_LIBRARY_PATH=../src/.libs + export LD_LIBRARY_PATH=../src/.libs # for Linux + export DYLD_LIBRARY_PATH=../src/.libs # for OS X 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 .. }