aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2015-05-15 15:14:32 -0700
committerJoshua Haberman <jhaberman@gmail.com>2015-05-15 15:14:32 -0700
commit17ca0fee20029c571e1002938ef9bc2b5cf53266 (patch)
tree3ab03c5d88871728cb48c5326c2ccd0fd49ad609 /python
parenta526605aec4358e948bde0a8ad63f5f1de6f2cb5 (diff)
parente4f4d9fe83887b08b0db67512947645324826755 (diff)
downloadprotobuf-17ca0fee20029c571e1002938ef9bc2b5cf53266.tar.gz
protobuf-17ca0fee20029c571e1002938ef9bc2b5cf53266.tar.bz2
protobuf-17ca0fee20029c571e1002938ef9bc2b5cf53266.zip
Merge pull request #351 from tamird/remove-manifest-fix-dist
[PYTHON] Only generate protos in development
Diffstat (limited to 'python')
-rwxr-xr-xpython/setup.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/python/setup.py b/python/setup.py
index 1764ec87..a1365fba 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 @@ if __name__ == '__main__':
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'],