Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PYTHON] Only generate protos in development #351

Merged
merged 4 commits into from
May 15, 2015
Merged
Show file tree
Hide file tree
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
17 changes: 7 additions & 10 deletions python/setup.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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'],
Expand Down
2 changes: 1 addition & 1 deletion ruby/travis-test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Exit on any error.
set -e
Expand Down
9 changes: 7 additions & 2 deletions travis.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

build_cpp() {
./autogen.sh
Expand Down Expand Up @@ -95,17 +95,22 @@ 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 ..
}

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 ..
}

Expand Down