betterproto2-compiler 0.1.0__py3-none-any.whl → 0.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,209 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # sources: google/protobuf/compiler/plugin.proto
3
- # plugin: python-betterproto
4
- # This file has been @generated
5
-
6
- from typing import TYPE_CHECKING
7
-
8
- if TYPE_CHECKING:
9
- from dataclasses import dataclass
10
- else:
11
- from pydantic.dataclasses import dataclass
12
-
13
- from typing import List
14
-
15
- import betterproto2_compiler
16
- import betterproto2_compiler.lib.pydantic.google.protobuf as betterproto_lib_pydantic_google_protobuf
17
-
18
-
19
- class CodeGeneratorResponseFeature(betterproto2_compiler.Enum):
20
- """Sync with code_generator.h."""
21
-
22
- FEATURE_NONE = 0
23
- FEATURE_PROTO3_OPTIONAL = 1
24
- FEATURE_SUPPORTS_EDITIONS = 2
25
-
26
-
27
- @dataclass(eq=False, repr=False)
28
- class Version(betterproto2_compiler.Message):
29
- """The version number of protocol compiler."""
30
-
31
- major: int = betterproto2_compiler.int32_field(1)
32
- minor: int = betterproto2_compiler.int32_field(2)
33
- patch: int = betterproto2_compiler.int32_field(3)
34
- suffix: str = betterproto2_compiler.string_field(4)
35
- """
36
- A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should
37
- be empty for mainline stable releases.
38
- """
39
-
40
-
41
- @dataclass(eq=False, repr=False)
42
- class CodeGeneratorRequest(betterproto2_compiler.Message):
43
- """An encoded CodeGeneratorRequest is written to the plugin's stdin."""
44
-
45
- file_to_generate: List[str] = betterproto2_compiler.string_field(1)
46
- """
47
- The .proto files that were explicitly listed on the command-line. The
48
- code generator should generate code only for these files. Each file's
49
- descriptor will be included in proto_file, below.
50
- """
51
-
52
- parameter: str = betterproto2_compiler.string_field(2)
53
- """The generator parameter passed on the command-line."""
54
-
55
- proto_file: List["betterproto_lib_pydantic_google_protobuf.FileDescriptorProto"] = (
56
- betterproto2_compiler.message_field(15)
57
- )
58
- """
59
- FileDescriptorProtos for all files in files_to_generate and everything
60
- they import. The files will appear in topological order, so each file
61
- appears before any file that imports it.
62
-
63
- Note: the files listed in files_to_generate will include runtime-retention
64
- options only, but all other files will include source-retention options.
65
- The source_file_descriptors field below is available in case you need
66
- source-retention options for files_to_generate.
67
-
68
- protoc guarantees that all proto_files will be written after
69
- the fields above, even though this is not technically guaranteed by the
70
- protobuf wire format. This theoretically could allow a plugin to stream
71
- in the FileDescriptorProtos and handle them one by one rather than read
72
- the entire set into memory at once. However, as of this writing, this
73
- is not similarly optimized on protoc's end -- it will store all fields in
74
- memory at once before sending them to the plugin.
75
-
76
- Type names of fields and extensions in the FileDescriptorProto are always
77
- fully qualified.
78
- """
79
-
80
- source_file_descriptors: List["betterproto_lib_pydantic_google_protobuf.FileDescriptorProto"] = (
81
- betterproto2_compiler.message_field(17)
82
- )
83
- """
84
- File descriptors with all options, including source-retention options.
85
- These descriptors are only provided for the files listed in
86
- files_to_generate.
87
- """
88
-
89
- compiler_version: "Version" = betterproto2_compiler.message_field(3)
90
- """The version number of protocol compiler."""
91
-
92
-
93
- @dataclass(eq=False, repr=False)
94
- class CodeGeneratorResponse(betterproto2_compiler.Message):
95
- """The plugin writes an encoded CodeGeneratorResponse to stdout."""
96
-
97
- error: str = betterproto2_compiler.string_field(1)
98
- """
99
- Error message. If non-empty, code generation failed. The plugin process
100
- should exit with status code zero even if it reports an error in this way.
101
-
102
- This should be used to indicate errors in .proto files which prevent the
103
- code generator from generating correct code. Errors which indicate a
104
- problem in protoc itself -- such as the input CodeGeneratorRequest being
105
- unparseable -- should be reported by writing a message to stderr and
106
- exiting with a non-zero status code.
107
- """
108
-
109
- supported_features: int = betterproto2_compiler.uint64_field(2)
110
- """
111
- A bitmask of supported features that the code generator supports.
112
- This is a bitwise "or" of values from the Feature enum.
113
- """
114
-
115
- minimum_edition: int = betterproto2_compiler.int32_field(3)
116
- """
117
- The minimum edition this plugin supports. This will be treated as an
118
- Edition enum, but we want to allow unknown values. It should be specified
119
- according the edition enum value, *not* the edition number. Only takes
120
- effect for plugins that have FEATURE_SUPPORTS_EDITIONS set.
121
- """
122
-
123
- maximum_edition: int = betterproto2_compiler.int32_field(4)
124
- """
125
- The maximum edition this plugin supports. This will be treated as an
126
- Edition enum, but we want to allow unknown values. It should be specified
127
- according the edition enum value, *not* the edition number. Only takes
128
- effect for plugins that have FEATURE_SUPPORTS_EDITIONS set.
129
- """
130
-
131
- file: List["CodeGeneratorResponseFile"] = betterproto2_compiler.message_field(15)
132
-
133
-
134
- @dataclass(eq=False, repr=False)
135
- class CodeGeneratorResponseFile(betterproto2_compiler.Message):
136
- """Represents a single generated file."""
137
-
138
- name: str = betterproto2_compiler.string_field(1)
139
- """
140
- The file name, relative to the output directory. The name must not
141
- contain "." or ".." components and must be relative, not be absolute (so,
142
- the file cannot lie outside the output directory). "/" must be used as
143
- the path separator, not "\".
144
-
145
- If the name is omitted, the content will be appended to the previous
146
- file. This allows the generator to break large files into small chunks,
147
- and allows the generated text to be streamed back to protoc so that large
148
- files need not reside completely in memory at one time. Note that as of
149
- this writing protoc does not optimize for this -- it will read the entire
150
- CodeGeneratorResponse before writing files to disk.
151
- """
152
-
153
- insertion_point: str = betterproto2_compiler.string_field(2)
154
- """
155
- If non-empty, indicates that the named file should already exist, and the
156
- content here is to be inserted into that file at a defined insertion
157
- point. This feature allows a code generator to extend the output
158
- produced by another code generator. The original generator may provide
159
- insertion points by placing special annotations in the file that look
160
- like:
161
- @@protoc_insertion_point(NAME)
162
- The annotation can have arbitrary text before and after it on the line,
163
- which allows it to be placed in a comment. NAME should be replaced with
164
- an identifier naming the point -- this is what other generators will use
165
- as the insertion_point. Code inserted at this point will be placed
166
- immediately above the line containing the insertion point (thus multiple
167
- insertions to the same point will come out in the order they were added).
168
- The double-@ is intended to make it unlikely that the generated code
169
- could contain things that look like insertion points by accident.
170
-
171
- For example, the C++ code generator places the following line in the
172
- .pb.h files that it generates:
173
- // @@protoc_insertion_point(namespace_scope)
174
- This line appears within the scope of the file's package namespace, but
175
- outside of any particular class. Another plugin can then specify the
176
- insertion_point "namespace_scope" to generate additional classes or
177
- other declarations that should be placed in this scope.
178
-
179
- Note that if the line containing the insertion point begins with
180
- whitespace, the same whitespace will be added to every line of the
181
- inserted text. This is useful for languages like Python, where
182
- indentation matters. In these languages, the insertion point comment
183
- should be indented the same amount as any inserted code will need to be
184
- in order to work correctly in that context.
185
-
186
- The code generator that generates the initial file and the one which
187
- inserts into it must both run as part of a single invocation of protoc.
188
- Code generators are executed in the order in which they appear on the
189
- command line.
190
-
191
- If |insertion_point| is present, |name| must also be present.
192
- """
193
-
194
- content: str = betterproto2_compiler.string_field(15)
195
- """The file contents."""
196
-
197
- generated_code_info: "betterproto_lib_pydantic_google_protobuf.GeneratedCodeInfo" = (
198
- betterproto2_compiler.message_field(16)
199
- )
200
- """
201
- Information describing the file content being inserted. If an insertion
202
- point is used, this information will be appropriately offset and inserted
203
- into the code generation metadata for the generated files.
204
- """
205
-
206
-
207
- CodeGeneratorRequest.__pydantic_model__.update_forward_refs() # type: ignore
208
- CodeGeneratorResponse.__pydantic_model__.update_forward_refs() # type: ignore
209
- CodeGeneratorResponseFile.__pydantic_model__.update_forward_refs() # type: ignore
File without changes
File without changes