Lines Matching +full:- +full:- +full:proto +full:- +full:path
5 # pylint:disable=missing-module-docstring
6 # pylint:disable=g-bad-import-order
17 # pylint:disable=g-importing-member
18 # pylint:disable=g-multiple-import
30 if 'PROTOC' in os.environ and os.path.exists(os.environ['PROTOC']):
32 elif os.path.exists('../src/protoc'):
34 elif os.path.exists('../src/protoc.exe'):
36 elif os.path.exists('../vsprojects/Debug/protoc.exe'):
38 elif os.path.exists('../vsprojects/Release/protoc.exe'):
54 with open(os.path.join('google', 'protobuf', '__init__.py')) as version_file:
55 exec(version_file.read(), globals()) # pylint:disable=exec-used
56 return __version__ # pylint:disable=undefined-variable
60 """Generates a _pb2.py from the given .proto file.
65 source: the .proto file path.
66 require: if True, exit immediately when a path is not found.
69 if not require and not os.path.exists(source):
72 output = source.replace('.proto', '_pb2.py').replace('../src/', '')
74 if (not os.path.exists(output) or
75 (os.path.exists(source) and
76 os.path.getmtime(source) > os.path.getmtime(output))):
79 if not os.path.exists(source):
81 sys.exit(-1)
87 sys.exit(-1)
89 protoc_command = [protoc, '-I../src', '-I.', '--python_out=.', source]
91 sys.exit(-1)
96 GenProto('../src/google/protobuf/any_test.proto', False)
97 GenProto('../src/google/protobuf/map_proto2_unittest.proto', False)
98 GenProto('../src/google/protobuf/map_unittest.proto', False)
99 GenProto('../src/google/protobuf/test_messages_proto3.proto', False)
100 GenProto('../src/google/protobuf/test_messages_proto2.proto', False)
101 GenProto('../src/google/protobuf/unittest_arena.proto', False)
102 GenProto('../src/google/protobuf/unittest.proto', False)
103 GenProto('../src/google/protobuf/unittest_custom_options.proto', False)
104 GenProto('../src/google/protobuf/unittest_import.proto', False)
105 GenProto('../src/google/protobuf/unittest_import_public.proto', False)
106 GenProto('../src/google/protobuf/unittest_mset.proto', False)
107 GenProto('../src/google/protobuf/unittest_mset_wire_format.proto', False)
108 GenProto('../src/google/protobuf/unittest_no_generic_services.proto', False)
109 GenProto('../src/google/protobuf/unittest_proto3_arena.proto', False)
110 GenProto('../src/google/protobuf/util/json_format.proto', False)
111 GenProto('../src/google/protobuf/util/json_format_proto3.proto', False)
112 GenProto('google/protobuf/internal/any_test.proto', False)
113 GenProto('google/protobuf/internal/descriptor_pool_test1.proto', False)
114 GenProto('google/protobuf/internal/descriptor_pool_test2.proto', False)
115 GenProto('google/protobuf/internal/factory_test1.proto', False)
116 GenProto('google/protobuf/internal/factory_test2.proto', False)
117 GenProto('google/protobuf/internal/file_options_test.proto', False)
118 GenProto('google/protobuf/internal/import_test_package/import_public.proto',
121 'google/protobuf/internal/import_test_package/import_public_nested.proto',
123 GenProto('google/protobuf/internal/import_test_package/inner.proto', False)
124 GenProto('google/protobuf/internal/import_test_package/outer.proto', False)
125 GenProto('google/protobuf/internal/missing_enum_values.proto', False)
126 GenProto('google/protobuf/internal/message_set_extensions.proto', False)
127 GenProto('google/protobuf/internal/more_extensions.proto', False)
128 GenProto('google/protobuf/internal/more_extensions_dynamic.proto', False)
129 GenProto('google/protobuf/internal/more_messages.proto', False)
130 GenProto('google/protobuf/internal/no_package.proto', False)
131 GenProto('google/protobuf/internal/packed_field_test.proto', False)
132 GenProto('google/protobuf/internal/test_bad_identifiers.proto', False)
133 GenProto('google/protobuf/internal/test_proto3_optional.proto', False)
134 GenProto('google/protobuf/pyext/python.proto', False)
144 filepath = os.path.join(dirpath, filename)
148 # _clean is an old-style class, so super() doesn't work.
156 # Generate necessary .proto file if it doesn't exist.
157 GenProto('../src/google/protobuf/descriptor.proto')
158 GenProto('../src/google/protobuf/compiler/plugin.proto')
159 GenProto('../src/google/protobuf/any.proto')
160 GenProto('../src/google/protobuf/api.proto')
161 GenProto('../src/google/protobuf/duration.proto')
162 GenProto('../src/google/protobuf/empty.proto')
163 GenProto('../src/google/protobuf/field_mask.proto')
164 GenProto('../src/google/protobuf/source_context.proto')
165 GenProto('../src/google/protobuf/struct.proto')
166 GenProto('../src/google/protobuf/timestamp.proto')
167 GenProto('../src/google/protobuf/type.proto')
168 GenProto('../src/google/protobuf/wrappers.proto')
171 # _build_py is an old-style class, so super() doesn't work.
193 # linux the suffix is ".cpython-XYZ-x86_64-linux-gnu.so" When
196 # and we end up with a well-formed wheel.
201 filename = filename[:-len(orig_ext_suffix)] + new_ext_suffix
211 '--failure_list failure_list_python-post26.txt')
225 warnings_as_errors = '--warnings_as_errors'
226 if GetOptionFromArgv('--cpp_implementation'):
227 # Link libprotobuf.a and libprotobuf-lite.a statically with the
229 # -fPIC for this to work.
230 compile_static_ext = GetOptionFromArgv('--compile_static_extension')
236 '../src/.libs/libprotobuf-lite.a']
251 '-Wl,-exported_symbol,_%s' % message_init_symbol
254 '-Wl,-exported_symbol,_%s' % api_implementation_init_symbol
258 extra_compile_args.append('-Wno-write-strings')
259 extra_compile_args.append('-Wno-invalid-offsetof')
260 extra_compile_args.append('-Wno-sign-compare')
261 extra_compile_args.append('-Wno-unused-variable')
262 extra_compile_args.append('-std=c++11')
265 extra_compile_args.append('-Wno-shorten-64-to-32')
266 extra_compile_args.append('-Wno-deprecated-register')
277 r'macosx-[0-9]+\.[0-9]+-(.+)', r'macosx-10.9-\1',
282 extra_compile_args.append('-D_hypot=hypot')
284 # https://github.com/tpaviot/pythonocc-core/issues/48
286 extra_compile_args.append('-DMS_WIN64')
292 if 'clang' in os.popen('$CC --version 2> /dev/null').read():
293 extra_compile_args.append('-Wno-shorten-64-to-32')
296 extra_compile_args.append('-Werror')
315 ['-DPYTHON_PROTO2_CPP_IMPL_V2']),
330 url='https://developers.google.com/protocol-buffers/',
333 license='BSD-3-Clause',