90
95
for (dirpath, dirnames, filenames) in os.walk("."):
91
96
for filename in filenames:
92
97
filepath = os.path.join(dirpath, filename)
93
if filepath.endswith("_pb2.py") or filepath.endswith(".pyc"):
98
if filepath.endswith("_pb2.py") or filepath.endswith(".pyc") or \
99
filepath.endswith(".so") or filepath.endswith(".o"):
94
100
os.remove(filepath)
96
102
# Generate necessary .proto file if it doesn't exist.
97
103
# TODO(kenton): Maybe we should hook this into a distutils command?
98
104
generate_proto("../src/google/protobuf/descriptor.proto")
105
generate_proto("../src/google/protobuf/compiler/plugin.proto")
109
# C++ implementation extension
110
if os.getenv("PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION", "python") == "cpp":
111
print "Using EXPERIMENTAL C++ Implmenetation."
112
ext_module_list.append(Extension(
113
"google.protobuf.internal._net_proto2___python",
114
[ "google/protobuf/pyext/python_descriptor.cc",
115
"google/protobuf/pyext/python_protobuf.cc",
116
"google/protobuf/pyext/python-proto2.cc" ],
117
include_dirs = [ "../src", ".", ],
118
libraries = [ "protobuf" ],
119
runtime_library_dirs = [ "../src/.libs" ],
120
library_dirs = [ "../src/.libs" ]))
100
122
setup(name = 'protobuf',
102
124
packages = [ 'google' ],
103
125
namespace_packages = [ 'google' ],
104
126
test_suite = 'setup.MakeTestSuite',
105
127
# Must list modules explicitly so that we don't install tests.
129
'google.protobuf.internal.api_implementation',
107
130
'google.protobuf.internal.containers',
131
'google.protobuf.internal.cpp_message',
108
132
'google.protobuf.internal.decoder',
109
133
'google.protobuf.internal.encoder',
110
134
'google.protobuf.internal.message_listener',
135
'google.protobuf.internal.python_message',
111
136
'google.protobuf.internal.type_checkers',
112
137
'google.protobuf.internal.wire_format',
113
138
'google.protobuf.descriptor',
114
139
'google.protobuf.descriptor_pb2',
140
'google.protobuf.compiler.plugin_pb2',
115
141
'google.protobuf.message',
116
142
'google.protobuf.reflection',
117
143
'google.protobuf.service',
118
144
'google.protobuf.service_reflection',
119
145
'google.protobuf.text_format' ],
146
ext_modules = ext_module_list,
120
147
url = 'http://code.google.com/p/protobuf/',
121
148
maintainer = maintainer_email,
122
149
maintainer_email = 'protobuf@googlegroups.com',