From 608a2e865a8d3273a943516b657643545bdbfc5b Mon Sep 17 00:00:00 2001 From: Adrien Vannson Date: Mon, 6 Jan 2025 11:34:47 +0100 Subject: [PATCH 01/10] Update lib --- .../lib/google/protobuf/__init__.py | 3181 ++++++++--------- 1 file changed, 1566 insertions(+), 1615 deletions(-) diff --git a/src/betterproto2_compiler/lib/google/protobuf/__init__.py b/src/betterproto2_compiler/lib/google/protobuf/__init__.py index 2c61f62d..13bfb6ef 100644 --- a/src/betterproto2_compiler/lib/google/protobuf/__init__.py +++ b/src/betterproto2_compiler/lib/google/protobuf/__init__.py @@ -1,180 +1,230 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: google/protobuf/any.proto, google/protobuf/api.proto, google/protobuf/descriptor.proto, -# google/protobuf/duration.proto, google/protobuf/empty.proto, google/protobuf/field_mask.proto, -# google/protobuf/source_context.proto, google/protobuf/struct.proto, google/protobuf/timestamp.proto, -# google/protobuf/type.proto, google/protobuf/wrappers.proto +# sources: google/protobuf/any.proto, google/protobuf/api.proto, google/protobuf/descriptor.proto, google/protobuf/duration.proto, google/protobuf/empty.proto, google/protobuf/field_mask.proto, google/protobuf/source_context.proto, google/protobuf/struct.proto, google/protobuf/timestamp.proto, google/protobuf/type.proto, google/protobuf/wrappers.proto # plugin: python-betterproto2 # This file has been @generated __all__ = ( - "Syntax", - "FieldKind", "FieldCardinality", - "FieldDescriptorProtoType", + "FieldKind", "FieldDescriptorProtoLabel", - "FileOptionsOptimizeMode", + "FieldDescriptorProtoType", "FieldOptionsCType", "FieldOptionsJsType", + "FileOptionsOptimizeMode", "MethodOptionsIdempotencyLevel", "NullValue", + "Syntax", "Any", - "SourceContext", - "Type", - "Field", - "Enum", - "EnumValue", - "Option", "Api", - "Method", - "Mixin", - "FileDescriptorSet", - "FileDescriptorProto", + "BoolValue", + "BytesValue", "DescriptorProto", "DescriptorProtoExtensionRange", "DescriptorProtoReservedRange", - "ExtensionRangeOptions", - "FieldDescriptorProto", - "OneofDescriptorProto", + "DoubleValue", + "Duration", + "Empty", + "Enum", "EnumDescriptorProto", "EnumDescriptorProtoEnumReservedRange", + "EnumOptions", + "EnumValue", "EnumValueDescriptorProto", - "ServiceDescriptorProto", - "MethodDescriptorProto", + "EnumValueOptions", + "ExtensionRangeOptions", + "Field", + "FieldDescriptorProto", + "FieldMask", + "FieldOptions", + "FileDescriptorProto", + "FileDescriptorSet", "FileOptions", + "FloatValue", + "GeneratedCodeInfo", + "GeneratedCodeInfoAnnotation", + "Int32Value", + "Int64Value", + "ListValue", "MessageOptions", - "FieldOptions", + "Method", + "MethodDescriptorProto", + "MethodOptions", + "Mixin", + "OneofDescriptorProto", "OneofOptions", - "EnumOptions", - "EnumValueOptions", + "Option", + "ServiceDescriptorProto", "ServiceOptions", - "MethodOptions", - "UninterpretedOption", - "UninterpretedOptionNamePart", "SourceCodeInfo", "SourceCodeInfoLocation", - "GeneratedCodeInfo", - "GeneratedCodeInfoAnnotation", - "Duration", - "Empty", - "FieldMask", + "SourceContext", + "StringValue", "Struct", - "Value", - "ListValue", "Timestamp", - "DoubleValue", - "FloatValue", - "Int64Value", - "UInt64Value", - "Int32Value", + "Type", "UInt32Value", - "BoolValue", - "StringValue", - "BytesValue", + "UInt64Value", + "UninterpretedOption", + "UninterpretedOptionNamePart", + "Value", ) import warnings from dataclasses import dataclass from typing import ( + TYPE_CHECKING, Dict, List, - Mapping, + Optional, ) import betterproto2 -from betterproto2.utils import hybridmethod -from typing_extensions import Self +if TYPE_CHECKING: + pass -class Syntax(betterproto2.Enum): - """The syntax in which a protocol buffer element is defined.""" +betterproto2.check_compiler_version("0.1.0") - PROTO2 = 0 - """Syntax `proto2`.""" - PROTO3 = 1 - """Syntax `proto3`.""" +class FieldCardinality(betterproto2.Enum): + """ + Whether a field is optional, required, or repeated. + """ + + CARDINALITY_UNKNOWN = 0 + """ + For fields with unknown cardinality. + """ + + CARDINALITY_OPTIONAL = 1 + """ + For optional fields. + """ + + CARDINALITY_REQUIRED = 2 + """ + For required fields. Proto2 syntax only. + """ + + CARDINALITY_REPEATED = 3 + """ + For repeated fields. + """ class FieldKind(betterproto2.Enum): - """Basic field types.""" + """ + Basic field types. + """ TYPE_UNKNOWN = 0 - """Field type unknown.""" + """ + Field type unknown. + """ TYPE_DOUBLE = 1 - """Field type double.""" + """ + Field type double. + """ TYPE_FLOAT = 2 - """Field type float.""" + """ + Field type float. + """ TYPE_INT64 = 3 - """Field type int64.""" + """ + Field type int64. + """ TYPE_UINT64 = 4 - """Field type uint64.""" + """ + Field type uint64. + """ TYPE_INT32 = 5 - """Field type int32.""" + """ + Field type int32. + """ TYPE_FIXED64 = 6 - """Field type fixed64.""" + """ + Field type fixed64. + """ TYPE_FIXED32 = 7 - """Field type fixed32.""" + """ + Field type fixed32. + """ TYPE_BOOL = 8 - """Field type bool.""" + """ + Field type bool. + """ TYPE_STRING = 9 - """Field type string.""" + """ + Field type string. + """ TYPE_GROUP = 10 - """Field type group. Proto2 syntax only, and deprecated.""" + """ + Field type group. Proto2 syntax only, and deprecated. + """ TYPE_MESSAGE = 11 - """Field type message.""" + """ + Field type message. + """ TYPE_BYTES = 12 - """Field type bytes.""" + """ + Field type bytes. + """ TYPE_UINT32 = 13 - """Field type uint32.""" + """ + Field type uint32. + """ TYPE_ENUM = 14 - """Field type enum.""" + """ + Field type enum. + """ TYPE_SFIXED32 = 15 - """Field type sfixed32.""" + """ + Field type sfixed32. + """ TYPE_SFIXED64 = 16 - """Field type sfixed64.""" + """ + Field type sfixed64. + """ TYPE_SINT32 = 17 - """Field type sint32.""" + """ + Field type sint32. + """ TYPE_SINT64 = 18 - """Field type sint64.""" - - -class FieldCardinality(betterproto2.Enum): - """Whether a field is optional, required, or repeated.""" + """ + Field type sint64. + """ - CARDINALITY_UNKNOWN = 0 - """For fields with unknown cardinality.""" - CARDINALITY_OPTIONAL = 1 - """For optional fields.""" +class FieldDescriptorProtoLabel(betterproto2.Enum): + LABEL_OPTIONAL = 1 + """ + 0 is reserved for errors + """ - CARDINALITY_REQUIRED = 2 - """For required fields. Proto2 syntax only.""" + LABEL_REQUIRED = 2 - CARDINALITY_REPEATED = 3 - """For repeated fields.""" + LABEL_REPEATED = 3 class FieldDescriptorProtoType(betterproto2.Enum): - """ """ - TYPE_DOUBLE = 1 """ 0 is reserved for errors. @@ -182,9 +232,6 @@ class FieldDescriptorProtoType(betterproto2.Enum): """ TYPE_FLOAT = 2 - """ - - """ TYPE_INT64 = 3 """ @@ -193,9 +240,6 @@ class FieldDescriptorProtoType(betterproto2.Enum): """ TYPE_UINT64 = 4 - """ - - """ TYPE_INT32 = 5 """ @@ -204,24 +248,12 @@ class FieldDescriptorProtoType(betterproto2.Enum): """ TYPE_FIXED64 = 6 - """ - - """ TYPE_FIXED32 = 7 - """ - - """ TYPE_BOOL = 8 - """ - - """ TYPE_STRING = 9 - """ - - """ TYPE_GROUP = 10 """ @@ -232,102 +264,85 @@ class FieldDescriptorProtoType(betterproto2.Enum): """ TYPE_MESSAGE = 11 - """Length-delimited aggregate.""" + """ + Length-delimited aggregate. + """ TYPE_BYTES = 12 - """New in version 2.""" - - TYPE_UINT32 = 13 """ - + New in version 2. """ + TYPE_UINT32 = 13 + TYPE_ENUM = 14 - """ - - """ TYPE_SFIXED32 = 15 + + TYPE_SFIXED64 = 16 + + TYPE_SINT32 = 17 """ - + Uses ZigZag encoding. """ - TYPE_SFIXED64 = 16 + TYPE_SINT64 = 18 """ - + Uses ZigZag encoding. """ - TYPE_SINT32 = 17 - """Uses ZigZag encoding.""" - TYPE_SINT64 = 18 - """Uses ZigZag encoding.""" +class FieldOptionsCType(betterproto2.Enum): + STRING = 0 + """ + Default mode. + """ + CORD = 1 -class FieldDescriptorProtoLabel(betterproto2.Enum): - """ """ + STRING_PIECE = 2 - LABEL_OPTIONAL = 1 - """0 is reserved for errors""" - LABEL_REQUIRED = 2 +class FieldOptionsJsType(betterproto2.Enum): + JS_NORMAL = 0 """ - + Use the default type. """ - LABEL_REPEATED = 3 + JS_STRING = 1 + """ + Use JavaScript strings. + """ + + JS_NUMBER = 2 """ - + Use JavaScript numbers. """ class FileOptionsOptimizeMode(betterproto2.Enum): - """Generated classes can be optimized for speed or code size.""" + """ + Generated classes can be optimized for speed or code size. + """ SPEED = 1 - """Generate complete code for parsing, serialization,""" + """ + Generate complete code for parsing, serialization, + """ CODE_SIZE = 2 """ etc. - + Use ReflectionOps to implement these methods. """ LITE_RUNTIME = 3 - """Generate code using MessageLite and the lite runtime.""" - - -class FieldOptionsCType(betterproto2.Enum): - """ """ - - STRING = 0 - """Default mode.""" - - CORD = 1 - """ - - """ - - STRING_PIECE = 2 """ - + Generate code using MessageLite and the lite runtime. """ -class FieldOptionsJsType(betterproto2.Enum): - """ """ - - JS_NORMAL = 0 - """Use the default type.""" - - JS_STRING = 1 - """Use JavaScript strings.""" - - JS_NUMBER = 2 - """Use JavaScript numbers.""" - - class MethodOptionsIdempotencyLevel(betterproto2.Enum): """ Is this method side-effect-free (or safe in HTTP parlance), or idempotent, @@ -336,15 +351,16 @@ class MethodOptionsIdempotencyLevel(betterproto2.Enum): """ IDEMPOTENCY_UNKNOWN = 0 - """ - - """ NO_SIDE_EFFECTS = 1 - """implies idempotent""" + """ + implies idempotent + """ IDEMPOTENT = 2 - """idempotent, but may have side effects""" + """ + idempotent, but may have side effects + """ class NullValue(betterproto2.Enum): @@ -356,7 +372,25 @@ class NullValue(betterproto2.Enum): """ _ = 0 - """Null value.""" + """ + Null value. + """ + + +class Syntax(betterproto2.Enum): + """ + The syntax in which a protocol buffer element is defined. + """ + + PROTO2 = 0 + """ + Syntax `proto2`. + """ + + PROTO3 = 1 + """ + Syntax `proto3`. + """ @dataclass(eq=False, repr=False) @@ -440,9 +474,10 @@ class Any(betterproto2.Message): "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + """ - type_url: str = betterproto2.string_field(1) + type_url: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) """ A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least @@ -450,12 +485,12 @@ class Any(betterproto2.Message): the fully qualified name of the type (as in `path/google.protobuf.Duration`). The name should be in a canonical form (e.g., leading "." is not accepted). - + In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme `http`, `https`, or no scheme, one can optionally set up a type server that maps type URLs to message definitions as follows: - + * If no scheme is provided, `https` is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error. @@ -464,163 +499,22 @@ class Any(betterproto2.Message): lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.) - + Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com. - + Schemes other than `http`, `https` (or the empty scheme) might be used with implementation specific semantics. """ - - value: bytes = betterproto2.bytes_field(2) + value: "bytes" = betterproto2.field(2, betterproto2.TYPE_BYTES) """ Must be a valid serialized protocol buffer of the above specified type. """ @dataclass(eq=False, repr=False) -class SourceContext(betterproto2.Message): - """ - `SourceContext` represents information about the source of a - protobuf element, like the file in which it is defined. - """ - - file_name: str = betterproto2.string_field(1) - """ - The path-qualified name of the .proto file that contained the associated - protobuf element. For example: `"google/protobuf/source_context.proto"`. - """ - - -@dataclass(eq=False, repr=False) -class Type(betterproto2.Message): - """A protocol buffer message type.""" - - name: str = betterproto2.string_field(1) - """The fully qualified message name.""" - - fields: List["Field"] = betterproto2.message_field(2, repeated=True) - """The list of fields.""" - - oneofs: List[str] = betterproto2.string_field(3, repeated=True) - """The list of types appearing in `oneof` definitions in this type.""" - - options: List["Option"] = betterproto2.message_field(4, repeated=True) - """The protocol buffer options.""" - - source_context: "SourceContext" = betterproto2.message_field(5) - """The source context.""" - - syntax: "Syntax" = betterproto2.enum_field(6, enum_default_value=lambda: Syntax.try_value(0)) - """The source syntax.""" - - -@dataclass(eq=False, repr=False) -class Field(betterproto2.Message): - """A single field of a message type.""" - - kind: "FieldKind" = betterproto2.enum_field(1, enum_default_value=lambda: FieldKind.try_value(0)) - """The field type.""" - - cardinality: "FieldCardinality" = betterproto2.enum_field( - 2, enum_default_value=lambda: FieldCardinality.try_value(0) - ) - """The field cardinality.""" - - number: int = betterproto2.int32_field(3) - """The field number.""" - - name: str = betterproto2.string_field(4) - """The field name.""" - - type_url: str = betterproto2.string_field(6) - """ - The field type URL, without the scheme, for message or enumeration - types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. - """ - - oneof_index: int = betterproto2.int32_field(7) - """ - The index of the field type in `Type.oneofs`, for message or enumeration - types. The first type has index 1; zero means the type is not in the list. - """ - - packed: bool = betterproto2.bool_field(8) - """Whether to use alternative packed wire representation.""" - - options: List["Option"] = betterproto2.message_field(9, repeated=True) - """The protocol buffer options.""" - - json_name: str = betterproto2.string_field(10) - """The field JSON name.""" - - default_value: str = betterproto2.string_field(11) - """ - The string value of the default value of this field. Proto2 syntax only. - """ - - -@dataclass(eq=False, repr=False) -class Enum(betterproto2.Message): - """Enum type definition.""" - - name: str = betterproto2.string_field(1) - """Enum type name.""" - - enumvalue: List["EnumValue"] = betterproto2.message_field(2, wraps=betterproto2.TYPE_ENUM, repeated=True) - """Enum value definitions.""" - - options: List["Option"] = betterproto2.message_field(3, repeated=True) - """Protocol buffer options.""" - - source_context: "SourceContext" = betterproto2.message_field(4) - """The source context.""" - - syntax: "Syntax" = betterproto2.enum_field(5, enum_default_value=lambda: Syntax.try_value(0)) - """The source syntax.""" - - -@dataclass(eq=False, repr=False) -class EnumValue(betterproto2.Message): - """Enum value definition.""" - - name: str = betterproto2.string_field(1) - """Enum value name.""" - - number: int = betterproto2.int32_field(2) - """Enum value number.""" - - options: List["Option"] = betterproto2.message_field(3, repeated=True) - """Protocol buffer options.""" - - -@dataclass(eq=False, repr=False) -class Option(betterproto2.Message): - """ - A protocol buffer option, which can be attached to a message, field, - enumeration, etc. - """ - - name: str = betterproto2.string_field(1) - """ - The option's name. For protobuf built-in options (options defined in - descriptor.proto), this is the short name. For example, `"map_entry"`. - For custom options, it should be the fully-qualified name. For example, - `"google.api.http"`. - """ - - value: "Any" = betterproto2.message_field(2) - """ - The option's value packed in an Any message. If the value is a primitive, - the corresponding wrapper type defined in google/protobuf/wrappers.proto - should be used. If the value is an enum, it should be stored as an int32 - value using the google.protobuf.Int32Value type. - """ - - -@dataclass(eq=False, repr=False) -class Api(betterproto2.Message): +class Api(betterproto2.Message): """ Api is a light-weight descriptor for an API Interface. @@ -631,21 +525,23 @@ class Api(betterproto2.Message): sometimes simply referred to as "APIs" in other contexts, such as the name of this message itself. See https://cloud.google.com/apis/design/glossary for detailed terminology. + """ - name: str = betterproto2.string_field(1) + name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) """ The fully qualified name of this interface, including package name followed by the interface's simple name. """ - - methods: List["Method"] = betterproto2.message_field(2, repeated=True) - """The methods of this interface, in unspecified order.""" - - options: List["Option"] = betterproto2.message_field(3, repeated=True) - """Any metadata attached to the interface.""" - - version: str = betterproto2.string_field(4) + methods: "List[Method]" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, repeated=True) + """ + The methods of this interface, in unspecified order. + """ + options: "List[Option]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, repeated=True) + """ + Any metadata attached to the interface. + """ + version: "str" = betterproto2.field(4, betterproto2.TYPE_STRING) """ A version string for this interface. If specified, must have the form `major-version.minor-version`, as in `1.10`. If the minor version is @@ -653,461 +549,288 @@ class Api(betterproto2.Message): major version is derived from the package name, as outlined below. If the field is not empty, the version in the package name will be verified to be consistent with what is provided here. - + The versioning schema uses [semantic versioning](http://semver.org) where the major version number indicates a breaking change and the minor version an additive, non-breaking change. Both version numbers are signals to users what to expect from different versions, and should be carefully chosen based on the product plan. - + The major version is also reflected in the package name of the interface, which must end in `v`, as in `google.feature.v1`. For major versions 0 and 1, the suffix can be omitted. Zero major versions must only be used for experimental, non-GA interfaces. """ - - source_context: "SourceContext" = betterproto2.message_field(5) + source_context: "Optional[SourceContext]" = betterproto2.field(5, betterproto2.TYPE_MESSAGE, optional=True) """ Source context for the protocol buffer service represented by this message. """ - - mixins: List["Mixin"] = betterproto2.message_field(6, repeated=True) - """Included interfaces. See [Mixin][].""" - - syntax: "Syntax" = betterproto2.enum_field(7, enum_default_value=lambda: Syntax.try_value(0)) - """The source syntax of the service.""" - - -@dataclass(eq=False, repr=False) -class Method(betterproto2.Message): - """Method represents a method of an API interface.""" - - name: str = betterproto2.string_field(1) - """The simple name of this method.""" - - request_type_url: str = betterproto2.string_field(2) - """A URL of the input message type.""" - - request_streaming: bool = betterproto2.bool_field(3) - """If true, the request is streamed.""" - - response_type_url: str = betterproto2.string_field(4) - """The URL of the output message type.""" - - response_streaming: bool = betterproto2.bool_field(5) - """If true, the response is streamed.""" - - options: List["Option"] = betterproto2.message_field(6, repeated=True) - """Any metadata attached to the method.""" - - syntax: "Syntax" = betterproto2.enum_field(7, enum_default_value=lambda: Syntax.try_value(0)) - """The source syntax of this method.""" - - -@dataclass(eq=False, repr=False) -class Mixin(betterproto2.Message): + mixins: "List[Mixin]" = betterproto2.field(6, betterproto2.TYPE_MESSAGE, repeated=True) """ - Declares an API Interface to be included in this interface. The including - interface must redeclare all the methods from the included interface, but - documentation and options are inherited as follows: - - - If after comment and whitespace stripping, the documentation - string of the redeclared method is empty, it will be inherited - from the original method. - - - Each annotation belonging to the service config (http, - visibility) which is not set in the redeclared method will be - inherited. - - - If an http annotation is inherited, the path pattern will be - modified as follows. Any version prefix will be replaced by the - version of the including interface plus the [root][] path if - specified. - - Example of a simple mixin: - - package google.acl.v1; - service AccessControl { - // Get the underlying ACL object. - rpc GetAcl(GetAclRequest) returns (Acl) { - option (google.api.http).get = "/v1/{resource=**}:getAcl"; - } - } - - package google.storage.v2; - service Storage { - rpc GetAcl(GetAclRequest) returns (Acl); - - // Get a data record. - rpc GetData(GetDataRequest) returns (Data) { - option (google.api.http).get = "/v2/{resource=**}"; - } - } - - Example of a mixin configuration: - - apis: - - name: google.storage.v2.Storage - mixins: - - name: google.acl.v1.AccessControl - - The mixin construct implies that all methods in `AccessControl` are - also declared with same name and request/response types in - `Storage`. A documentation generator or annotation processor will - see the effective `Storage.GetAcl` method after inherting - documentation and annotations as follows: - - service Storage { - // Get the underlying ACL object. - rpc GetAcl(GetAclRequest) returns (Acl) { - option (google.api.http).get = "/v2/{resource=**}:getAcl"; - } - ... - } - - Note how the version in the path pattern changed from `v1` to `v2`. - - If the `root` field in the mixin is specified, it should be a - relative path under which inherited HTTP paths are placed. Example: - - apis: - - name: google.storage.v2.Storage - mixins: - - name: google.acl.v1.AccessControl - root: acls - - This implies the following inherited HTTP annotation: - - service Storage { - // Get the underlying ACL object. - rpc GetAcl(GetAclRequest) returns (Acl) { - option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; - } - ... - } + Included interfaces. See [Mixin][]. """ - - name: str = betterproto2.string_field(1) - """The fully qualified name of the interface which is included.""" - - root: str = betterproto2.string_field(2) + syntax: "Syntax" = betterproto2.field(7, betterproto2.TYPE_ENUM, default_factory=lambda: Syntax.try_value(0)) """ - If non-empty specifies a path under which inherited HTTP paths - are rooted. + The source syntax of the service. """ @dataclass(eq=False, repr=False) -class FileDescriptorSet(betterproto2.Message): +class BoolValue(betterproto2.Message): """ - The protocol compiler can output a FileDescriptorSet containing the .proto - files it parses. + Wrapper message for `bool`. + + The JSON representation for `BoolValue` is JSON `true` and `false`. + """ - file: List["FileDescriptorProto"] = betterproto2.message_field(1, repeated=True) + value: "bool" = betterproto2.field(1, betterproto2.TYPE_BOOL) """ - + The bool value. """ @dataclass(eq=False, repr=False) -class FileDescriptorProto(betterproto2.Message): - """Describes a complete .proto file.""" - - name: str = betterproto2.string_field(1) - """file name, relative to root of source tree""" - - package: str = betterproto2.string_field(2) - """e.g. "foo", "foo.bar", etc.""" +class BytesValue(betterproto2.Message): + """ + Wrapper message for `bytes`. - dependency: List[str] = betterproto2.string_field(3, repeated=True) - """Names of files imported by this file.""" + The JSON representation for `BytesValue` is JSON string. - public_dependency: List[int] = betterproto2.int32_field(10, repeated=True) - """Indexes of the public imported files in the dependency list above.""" + """ - weak_dependency: List[int] = betterproto2.int32_field(11, repeated=True) + value: "bytes" = betterproto2.field(1, betterproto2.TYPE_BYTES) """ - Indexes of the weak imported files in the dependency list. - For Google-internal migration only. Do not use. + The bytes value. """ - message_type: List["DescriptorProto"] = betterproto2.message_field(4, repeated=True) - """All top-level definitions in this file.""" - enum_type: List["EnumDescriptorProto"] = betterproto2.message_field(5, repeated=True) - """ - +@dataclass(eq=False, repr=False) +class DescriptorProto(betterproto2.Message): """ + Describes a message type. - service: List["ServiceDescriptorProto"] = betterproto2.message_field(6, repeated=True) - """ - """ - extension: List["FieldDescriptorProto"] = betterproto2.message_field(7, repeated=True) + name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) + field: "List[FieldDescriptorProto]" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, repeated=True) + extension: "List[FieldDescriptorProto]" = betterproto2.field(6, betterproto2.TYPE_MESSAGE, repeated=True) + nested_type: "List[DescriptorProto]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, repeated=True) + enum_type: "List[EnumDescriptorProto]" = betterproto2.field(4, betterproto2.TYPE_MESSAGE, repeated=True) + extension_range: "List[DescriptorProtoExtensionRange]" = betterproto2.field( + 5, betterproto2.TYPE_MESSAGE, repeated=True + ) + oneof_decl: "List[OneofDescriptorProto]" = betterproto2.field(8, betterproto2.TYPE_MESSAGE, repeated=True) + options: "Optional[MessageOptions]" = betterproto2.field(7, betterproto2.TYPE_MESSAGE, optional=True) + reserved_range: "List[DescriptorProtoReservedRange]" = betterproto2.field( + 9, betterproto2.TYPE_MESSAGE, repeated=True + ) + reserved_name: "List[str]" = betterproto2.field(10, betterproto2.TYPE_STRING, repeated=True) """ - + Reserved field names, which may not be used by fields in the same message. + A given name may only be reserved once. """ - options: "FileOptions" = betterproto2.message_field(8) - """ - - """ - source_code_info: "SourceCodeInfo" = betterproto2.message_field(9) +@dataclass(eq=False, repr=False) +class DescriptorProtoExtensionRange(betterproto2.Message): + start: "int" = betterproto2.field(1, betterproto2.TYPE_INT32) """ - This field contains optional information about the original source code. - You may safely remove this entire field without harming runtime - functionality of the descriptors -- the information is needed only by - development tools. + Inclusive. """ - - syntax: str = betterproto2.string_field(12) + end: "int" = betterproto2.field(2, betterproto2.TYPE_INT32) """ - The syntax of the proto file. - The supported values are "proto2" and "proto3". + Exclusive. """ + options: "Optional[ExtensionRangeOptions]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, optional=True) @dataclass(eq=False, repr=False) -class DescriptorProto(betterproto2.Message): - """Describes a message type.""" - - name: str = betterproto2.string_field(1) - """ - +class DescriptorProtoReservedRange(betterproto2.Message): """ + Range of reserved tag numbers. Reserved tag numbers may not be used by + fields or extension ranges in the same message. Reserved ranges may + not overlap. - field: List["FieldDescriptorProto"] = betterproto2.message_field(2, repeated=True) - """ - """ - extension: List["FieldDescriptorProto"] = betterproto2.message_field(6, repeated=True) + start: "int" = betterproto2.field(1, betterproto2.TYPE_INT32) """ - + Inclusive. """ - - nested_type: List["DescriptorProto"] = betterproto2.message_field(3, repeated=True) + end: "int" = betterproto2.field(2, betterproto2.TYPE_INT32) """ - + Exclusive. """ - enum_type: List["EnumDescriptorProto"] = betterproto2.message_field(4, repeated=True) - """ - - """ - extension_range: List["DescriptorProtoExtensionRange"] = betterproto2.message_field(5, repeated=True) - """ - +@dataclass(eq=False, repr=False) +class DoubleValue(betterproto2.Message): """ + Wrapper message for `double`. - oneof_decl: List["OneofDescriptorProto"] = betterproto2.message_field(8, repeated=True) - """ - - """ + The JSON representation for `DoubleValue` is JSON number. - options: "MessageOptions" = betterproto2.message_field(7) - """ - """ - reserved_range: List["DescriptorProtoReservedRange"] = betterproto2.message_field(9, repeated=True) + value: "float" = betterproto2.field(1, betterproto2.TYPE_DOUBLE) """ - + The double value. """ - reserved_name: List[str] = betterproto2.string_field(10, repeated=True) + +@dataclass(eq=False, repr=False) +class Duration(betterproto2.Message): """ - Reserved field names, which may not be used by fields in the same message. - A given name may only be reserved once. - """ - + A Duration represents a signed, fixed-length span of time represented + as a count of seconds and fractions of seconds at nanosecond + resolution. It is independent of any calendar and concepts like "day" + or "month". It is related to Timestamp in that the difference between + two Timestamp values is a Duration and it can be added or subtracted + from a Timestamp. Range is approximately +-10,000 years. -@dataclass(eq=False, repr=False) -class DescriptorProtoExtensionRange(betterproto2.Message): - """ """ + # Examples - start: int = betterproto2.int32_field(1) - """Inclusive.""" + Example 1: Compute Duration from two Timestamps in pseudo code. - end: int = betterproto2.int32_field(2) - """Exclusive.""" + Timestamp start = ...; + Timestamp end = ...; + Duration duration = ...; - options: "ExtensionRangeOptions" = betterproto2.message_field(3) - """ - - """ + duration.seconds = end.seconds - start.seconds; + duration.nanos = end.nanos - start.nanos; + if (duration.seconds < 0 && duration.nanos > 0) { + duration.seconds += 1; + duration.nanos -= 1000000000; + } else if (duration.seconds > 0 && duration.nanos < 0) { + duration.seconds -= 1; + duration.nanos += 1000000000; + } -@dataclass(eq=False, repr=False) -class DescriptorProtoReservedRange(betterproto2.Message): - """ - Range of reserved tag numbers. Reserved tag numbers may not be used by - fields or extension ranges in the same message. Reserved ranges may - not overlap. - """ + Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - start: int = betterproto2.int32_field(1) - """Inclusive.""" + Timestamp start = ...; + Duration duration = ...; + Timestamp end = ...; - end: int = betterproto2.int32_field(2) - """Exclusive.""" + end.seconds = start.seconds + duration.seconds; + end.nanos = start.nanos + duration.nanos; + if (end.nanos < 0) { + end.seconds -= 1; + end.nanos += 1000000000; + } else if (end.nanos >= 1000000000) { + end.seconds += 1; + end.nanos -= 1000000000; + } -@dataclass(eq=False, repr=False) -class ExtensionRangeOptions(betterproto2.Message): - """ """ + Example 3: Compute Duration from datetime.timedelta in Python. - uninterpreted_option: List["UninterpretedOption"] = betterproto2.message_field(999, repeated=True) - """The parser stores options it doesn't recognize here. See above.""" + td = datetime.timedelta(days=3, minutes=10) + duration = Duration() + duration.FromTimedelta(td) + # JSON Mapping -@dataclass(eq=False, repr=False) -class FieldDescriptorProto(betterproto2.Message): - """Describes a field within a message.""" + In JSON format, the Duration type is encoded as a string rather than an + object, where the string ends in the suffix "s" (indicating seconds) and + is preceded by the number of seconds, with nanoseconds expressed as + fractional seconds. For example, 3 seconds with 0 nanoseconds should be + encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + microsecond should be expressed in JSON format as "3.000001s". - name: str = betterproto2.string_field(1) - """ - """ - number: int = betterproto2.int32_field(3) + seconds: "int" = betterproto2.field(1, betterproto2.TYPE_INT64) """ - + Signed seconds of the span of time. Must be from -315,576,000,000 + to +315,576,000,000 inclusive. Note: these bounds are computed from: + 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years """ - - label: "FieldDescriptorProtoLabel" = betterproto2.enum_field( - 4, enum_default_value=lambda: FieldDescriptorProtoLabel.try_value(0) - ) + nanos: "int" = betterproto2.field(2, betterproto2.TYPE_INT32) """ - + Signed fractions of a second at nanosecond resolution of the span + of time. Durations less than one second are represented with a 0 + `seconds` field and a positive or negative `nanos` field. For durations + of one second or more, a non-zero value for the `nanos` field must be + of the same sign as the `seconds` field. Must be from -999,999,999 + to +999,999,999 inclusive. """ - type: "FieldDescriptorProtoType" = betterproto2.enum_field( - 5, enum_default_value=lambda: FieldDescriptorProtoType.try_value(0) - ) - """ - If type_name is set, this need not be set. If both this and type_name - are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - """ - type_name: str = betterproto2.string_field(6) - """ - For message and enum types, this is the name of the type. If the name - starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - rules are used to find the type (i.e. first the nested types within this - message are searched, then within the parent, on up to the root - namespace). +@dataclass(eq=False, repr=False) +class Empty(betterproto2.Message): """ + A generic empty message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to use it as the request + or the response type of an API method. For instance: - extendee: str = betterproto2.string_field(2) - """ - For extensions, this is the name of the type being extended. It is - resolved in the same manner as type_name. - """ + service Foo { + rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + } + + The JSON representation for `Empty` is empty JSON object `{}`. - default_value: str = betterproto2.string_field(7) - """ - For numeric types, contains the original text representation of the value. - For booleans, "true" or "false". - For strings, contains the default text contents (not escaped in any way). - For bytes, contains the C escaped value. All bytes >= 128 are escaped. - TODO(kenton): Base-64 encode? """ - oneof_index: int | None = betterproto2.int32_field(9, optional=True) + pass + + +@dataclass(eq=False, repr=False) +class Enum(betterproto2.Message): """ - If set, gives the index of a oneof in the containing type's oneof_decl - list. This field is a member of that oneof. + Enum type definition. + """ - json_name: str = betterproto2.string_field(10) + name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) """ - JSON name of this field. The value is set by protocol compiler. If the - user has set a "json_name" option on this field, that option's value - will be used. Otherwise, it's deduced from the field's name by converting - it to camelCase. + Enum type name. """ - - options: "FieldOptions" = betterproto2.message_field(8) + enumvalue: "List[EnumValue]" = betterproto2.field( + 2, betterproto2.TYPE_MESSAGE, wraps=betterproto2.TYPE_ENUM, repeated=True + ) """ - + Enum value definitions. """ - - proto3_optional: bool = betterproto2.bool_field(17) + options: "List[Option]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, repeated=True) """ - If true, this is a proto3 "optional". When a proto3 field is optional, it - tracks presence regardless of field type. - - When proto3_optional is true, this field must be belong to a oneof to - signal to old proto3 clients that presence is tracked for this field. This - oneof is known as a "synthetic" oneof, and this field must be its sole - member (each proto3 optional field gets its own synthetic oneof). Synthetic - oneofs exist in the descriptor only, and do not generate any API. Synthetic - oneofs must be ordered after all "real" oneofs. - - For message fields, proto3_optional doesn't create any semantic change, - since non-repeated message fields always track presence. However it still - indicates the semantic detail of whether the user wrote "optional" or not. - This can be useful for round-tripping the .proto file. For consistency we - give message fields a synthetic oneof also, even though it is not required - to track presence. This is especially important because the parser can't - tell if a field is a message or an enum, so it must always create a - synthetic oneof. - - Proto2 optional fields do not set this flag, because they already indicate - optional with `LABEL_OPTIONAL`. + Protocol buffer options. """ - - -@dataclass(eq=False, repr=False) -class OneofDescriptorProto(betterproto2.Message): - """Describes a oneof.""" - - name: str = betterproto2.string_field(1) + source_context: "Optional[SourceContext]" = betterproto2.field(4, betterproto2.TYPE_MESSAGE, optional=True) """ - + The source context. """ - - options: "OneofOptions" = betterproto2.message_field(2) + syntax: "Syntax" = betterproto2.field(5, betterproto2.TYPE_ENUM, default_factory=lambda: Syntax.try_value(0)) """ - + The source syntax. """ @dataclass(eq=False, repr=False) class EnumDescriptorProto(betterproto2.Message): - """Describes an enum type.""" - - name: str = betterproto2.string_field(1) - """ - """ + Describes an enum type. - value: List["EnumValueDescriptorProto"] = betterproto2.message_field(2, repeated=True) - """ - - """ - - options: "EnumOptions" = betterproto2.message_field(3) - """ - """ - reserved_range: List["EnumDescriptorProtoEnumReservedRange"] = betterproto2.message_field(4, repeated=True) + name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) + value: "List[EnumValueDescriptorProto]" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, repeated=True) + options: "Optional[EnumOptions]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, optional=True) + reserved_range: "List[EnumDescriptorProtoEnumReservedRange]" = betterproto2.field( + 4, betterproto2.TYPE_MESSAGE, repeated=True + ) """ Range of reserved numeric values. Reserved numeric values may not be used by enum values in the same enum declaration. Reserved ranges may not overlap. """ - - reserved_name: List[str] = betterproto2.string_field(5, repeated=True) + reserved_name: "List[str]" = betterproto2.field(5, betterproto2.TYPE_STRING, repeated=True) """ Reserved enum value names, which may not be reused. A given name may only be reserved once. @@ -1123,1104 +846,1360 @@ class EnumDescriptorProtoEnumReservedRange(betterproto2.Message): Note that this is distinct from DescriptorProto.ReservedRange in that it is inclusive such that it can appropriately represent the entire int32 domain. - """ - - start: int = betterproto2.int32_field(1) - """Inclusive.""" - - end: int = betterproto2.int32_field(2) - """Inclusive.""" - - -@dataclass(eq=False, repr=False) -class EnumValueDescriptorProto(betterproto2.Message): - """Describes a value within an enum.""" - name: str = betterproto2.string_field(1) - """ - """ - number: int = betterproto2.int32_field(2) + start: "int" = betterproto2.field(1, betterproto2.TYPE_INT32) """ - + Inclusive. """ - - options: "EnumValueOptions" = betterproto2.message_field(3) + end: "int" = betterproto2.field(2, betterproto2.TYPE_INT32) """ - + Inclusive. """ @dataclass(eq=False, repr=False) -class ServiceDescriptorProto(betterproto2.Message): - """Describes a service.""" - - name: str = betterproto2.string_field(1) +class EnumOptions(betterproto2.Message): + allow_alias: "bool" = betterproto2.field(2, betterproto2.TYPE_BOOL) """ - + Set this option to true to allow mapping different tag names to the same + value. """ - - method: List["MethodDescriptorProto"] = betterproto2.message_field(2, repeated=True) + deprecated: "bool" = betterproto2.field(3, betterproto2.TYPE_BOOL) """ - + Is this enum deprecated? + Depending on the target platform, this can emit Deprecated annotations + for the enum, or it will be completely ignored; in the very least, this + is a formalization for deprecating enums. """ - - options: "ServiceOptions" = betterproto2.message_field(3) + uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( + 999, betterproto2.TYPE_MESSAGE, repeated=True + ) """ - + The parser stores options it doesn't recognize here. See above. """ @dataclass(eq=False, repr=False) -class MethodDescriptorProto(betterproto2.Message): - """Describes a method of a service.""" - - name: str = betterproto2.string_field(1) +class EnumValue(betterproto2.Message): """ - + Enum value definition. + """ - input_type: str = betterproto2.string_field(2) + name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) """ - Input and output type names. These are resolved in the same way as - FieldDescriptorProto.type_name, but must refer to a message type. + Enum value name. """ - - output_type: str = betterproto2.string_field(3) + number: "int" = betterproto2.field(2, betterproto2.TYPE_INT32) """ - + Enum value number. """ - - options: "MethodOptions" = betterproto2.message_field(4) + options: "List[Option]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, repeated=True) """ - + Protocol buffer options. """ - client_streaming: bool = betterproto2.bool_field(5) - """Identifies if client streams multiple client messages""" - - server_streaming: bool = betterproto2.bool_field(6) - """Identifies if server streams multiple server messages""" - @dataclass(eq=False, repr=False) -class FileOptions(betterproto2.Message): +class EnumValueDescriptorProto(betterproto2.Message): """ - =================================================================== - Options + Describes a value within an enum. - Each of the definitions above may have "options" attached. These are - just annotations which may cause code to be generated slightly differently - or may contain hints for code that manipulates protocol messages. + """ - Clients may define custom options as extensions of the *Options messages. - These extensions may not yet be known at parsing time, so the parser cannot - store the values in them. Instead it stores them in a field in the *Options - message called uninterpreted_option. This field must have the same name - across all *Options messages. We then use this field to populate the - extensions when we build a descriptor, at which point all protos have been - parsed and so all extensions are known. + name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) + number: "int" = betterproto2.field(2, betterproto2.TYPE_INT32) + options: "Optional[EnumValueOptions]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, optional=True) - Extension numbers for custom options may be chosen as follows: - * For options which will only be used within a single application or - organization, or for experimental options, use field numbers 50000 - through 99999. It is up to you to ensure that you do not use the - same number for multiple options. - * For options which will be published and used publicly by multiple - independent entities, e-mail protobuf-global-extension-registry@google.com - to reserve extension numbers. Simply provide your project name (e.g. - Objective-C plugin) and your project website (if available) -- there's no - need to explain how you intend to use them. Usually you only need one - extension number. You can declare multiple options with only one extension - number by putting them in a sub-message. See the Custom Options section of - the docs for examples: - https://developers.google.com/protocol-buffers/docs/proto#options - If this turns out to be popular, a web service will be set up - to automatically assign option numbers. - """ - java_package: str = betterproto2.string_field(1) +@dataclass(eq=False, repr=False) +class EnumValueOptions(betterproto2.Message): + deprecated: "bool" = betterproto2.field(1, betterproto2.TYPE_BOOL) """ - Sets the Java package where classes generated from this .proto will be - placed. By default, the proto package is used, but this is often - inappropriate because proto packages do not normally start with backwards - domain names. + Is this enum value deprecated? + Depending on the target platform, this can emit Deprecated annotations + for the enum value, or it will be completely ignored; in the very least, + this is a formalization for deprecating enum values. """ - - java_outer_classname: str = betterproto2.string_field(8) + uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( + 999, betterproto2.TYPE_MESSAGE, repeated=True + ) """ - If set, all the classes from the .proto file are wrapped in a single - outer class with the given name. This applies to both Proto1 - (equivalent to the old "--one_java_file" option) and Proto2 (where - a .proto always translates to a single class, but you may want to - explicitly choose the class name). + The parser stores options it doesn't recognize here. See above. """ - java_multiple_files: bool = betterproto2.bool_field(10) + +@dataclass(eq=False, repr=False) +class ExtensionRangeOptions(betterproto2.Message): + uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( + 999, betterproto2.TYPE_MESSAGE, repeated=True + ) """ - If set true, then the Java code generator will generate a separate .java - file for each top-level message, enum, and service defined in the .proto - file. Thus, these types will *not* be nested inside the outer class - named by java_outer_classname. However, the outer class will still be - generated to contain the file's getDescriptor() method as well as any - top-level extensions defined in the file. + The parser stores options it doesn't recognize here. See above. """ - java_generate_equals_and_hash: bool = betterproto2.bool_field(20) - """This option does nothing.""" - java_string_check_utf8: bool = betterproto2.bool_field(27) +@dataclass(eq=False, repr=False) +class Field(betterproto2.Message): """ - If set true, then the Java2 code generator will generate code that - throws an exception whenever an attempt is made to assign a non-UTF-8 - byte sequence to a string field. - Message reflection will do the same. - However, an extension field still accepts non-UTF-8 byte sequences. - This option has no effect on when used with the lite runtime. + A single field of a message type. + """ - optimize_for: "FileOptionsOptimizeMode" = betterproto2.enum_field( - 9, enum_default_value=lambda: FileOptionsOptimizeMode.try_value(0) + kind: "FieldKind" = betterproto2.field(1, betterproto2.TYPE_ENUM, default_factory=lambda: FieldKind.try_value(0)) + """ + The field type. + """ + cardinality: "FieldCardinality" = betterproto2.field( + 2, betterproto2.TYPE_ENUM, default_factory=lambda: FieldCardinality.try_value(0) ) """ - + The field cardinality. """ - - go_package: str = betterproto2.string_field(11) + number: "int" = betterproto2.field(3, betterproto2.TYPE_INT32) """ - Sets the Go package where structs generated from this .proto will be - placed. If omitted, the Go package will be derived from the following: - - The basename of the package import path, if provided. - - Otherwise, the package statement in the .proto file, if present. - - Otherwise, the basename of the .proto file, without extension. + The field number. """ - - cc_generic_services: bool = betterproto2.bool_field(16) + name: "str" = betterproto2.field(4, betterproto2.TYPE_STRING) """ - Should generic services be generated in each language? "Generic" services - are not specific to any particular RPC system. They are generated by the - main code generators in each language (without additional plugins). - Generic services were the only kind of service generation supported by - early versions of google.protobuf. - - Generic services are now considered deprecated in favor of using plugins - that generate code specific to your particular RPC system. Therefore, - these default to false. Old code which depends on generic services should - explicitly set them to true. + The field name. """ - - java_generic_services: bool = betterproto2.bool_field(17) + type_url: "str" = betterproto2.field(6, betterproto2.TYPE_STRING) """ - + The field type URL, without the scheme, for message or enumeration + types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. """ - - py_generic_services: bool = betterproto2.bool_field(18) + oneof_index: "int" = betterproto2.field(7, betterproto2.TYPE_INT32) """ - + The index of the field type in `Type.oneofs`, for message or enumeration + types. The first type has index 1; zero means the type is not in the list. """ - - php_generic_services: bool = betterproto2.bool_field(42) + packed: "bool" = betterproto2.field(8, betterproto2.TYPE_BOOL) """ - + Whether to use alternative packed wire representation. """ - - deprecated: bool = betterproto2.bool_field(23) + options: "List[Option]" = betterproto2.field(9, betterproto2.TYPE_MESSAGE, repeated=True) """ - Is this file deprecated? - Depending on the target platform, this can emit Deprecated annotations - for everything in the file, or it will be completely ignored; in the very - least, this is a formalization for deprecating files. + The protocol buffer options. """ - - cc_enable_arenas: bool = betterproto2.bool_field(31) + json_name: "str" = betterproto2.field(10, betterproto2.TYPE_STRING) """ - Enables the use of arenas for the proto messages in this file. This applies - only to generated classes for C++. + The field JSON name. """ - - objc_class_prefix: str = betterproto2.string_field(36) + default_value: "str" = betterproto2.field(11, betterproto2.TYPE_STRING) """ - Sets the objective c class prefix which is prepended to all objective c - generated classes from this .proto. There is no default. + The string value of the default value of this field. Proto2 syntax only. """ - csharp_namespace: str = betterproto2.string_field(37) - """Namespace for generated classes; defaults to the package.""" - - swift_prefix: str = betterproto2.string_field(39) - """ - By default Swift generators will take the proto package and CamelCase it - replacing '.' with underscore and use that to prefix the types/symbols - defined. When this options is provided, they will use this value instead - to prefix the types/symbols defined. - """ - php_class_prefix: str = betterproto2.string_field(40) - """ - Sets the php class prefix which is prepended to all php generated classes - from this .proto. Default is empty. +@dataclass(eq=False, repr=False) +class FieldDescriptorProto(betterproto2.Message): """ + Describes a field within a message. - php_namespace: str = betterproto2.string_field(41) - """ - Use this option to change the namespace of php generated classes. Default - is empty. When this option is empty, the package name will be used for - determining the namespace. """ - php_metadata_namespace: str = betterproto2.string_field(44) - """ - Use this option to change the namespace of php generated metadata classes. - Default is empty. When this option is empty, the proto file name will be - used for determining the namespace. + name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) + number: "int" = betterproto2.field(3, betterproto2.TYPE_INT32) + label: "FieldDescriptorProtoLabel" = betterproto2.field( + 4, betterproto2.TYPE_ENUM, default_factory=lambda: FieldDescriptorProtoLabel.try_value(0) + ) + type: "FieldDescriptorProtoType" = betterproto2.field( + 5, betterproto2.TYPE_ENUM, default_factory=lambda: FieldDescriptorProtoType.try_value(0) + ) """ - - ruby_package: str = betterproto2.string_field(45) + If type_name is set, this need not be set. If both this and type_name + are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. """ - Use this option to change the package of ruby generated classes. Default - is empty. When this option is not set, the package name will be used for - determining the ruby package. + type_name: "str" = betterproto2.field(6, betterproto2.TYPE_STRING) """ - - uninterpreted_option: List["UninterpretedOption"] = betterproto2.message_field(999, repeated=True) + For message and enum types, this is the name of the type. If the name + starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + rules are used to find the type (i.e. first the nested types within this + message are searched, then within the parent, on up to the root + namespace). """ - The parser stores options it doesn't recognize here. - See the documentation for the "Options" section above. + extendee: "str" = betterproto2.field(2, betterproto2.TYPE_STRING) """ - - def __post_init__(self) -> None: - super().__post_init__() - if self.is_set("java_generate_equals_and_hash"): - warnings.warn( - "FileOptions.java_generate_equals_and_hash is deprecated", - DeprecationWarning, - ) - - -@dataclass(eq=False, repr=False) -class MessageOptions(betterproto2.Message): - """ """ - - message_set_wire_format: bool = betterproto2.bool_field(1) + For extensions, this is the name of the type being extended. It is + resolved in the same manner as type_name. """ - Set true to use the old proto1 MessageSet wire format for extensions. - This is provided for backwards-compatibility with the MessageSet wire - format. You should not use this for any other reason: It's less - efficient, has fewer features, and is more complicated. - - The message must be defined exactly as follows: - message Foo { - option message_set_wire_format = true; - extensions 4 to max; - } - Note that the message cannot have any defined fields; MessageSets only - have extensions. - - All extensions of your type must be singular messages; e.g. they cannot - be int32s, enums, or repeated messages. - - Because this is an option, the above two restrictions are not enforced by - the protocol compiler. + default_value: "str" = betterproto2.field(7, betterproto2.TYPE_STRING) """ - - no_standard_descriptor_accessor: bool = betterproto2.bool_field(2) + For numeric types, contains the original text representation of the value. + For booleans, "true" or "false". + For strings, contains the default text contents (not escaped in any way). + For bytes, contains the C escaped value. All bytes >= 128 are escaped. + TODO(kenton): Base-64 encode? """ - Disables the generation of the standard "descriptor()" accessor, which can - conflict with a field of the same name. This is meant to make migration - from proto1 easier; new code should avoid fields named "descriptor". + oneof_index: "int" = betterproto2.field(9, betterproto2.TYPE_INT32) """ - - deprecated: bool = betterproto2.bool_field(3) + If set, gives the index of a oneof in the containing type's oneof_decl + list. This field is a member of that oneof. """ - Is this message deprecated? - Depending on the target platform, this can emit Deprecated annotations - for the message, or it will be completely ignored; in the very least, - this is a formalization for deprecating messages. + json_name: "str" = betterproto2.field(10, betterproto2.TYPE_STRING) """ - - map_entry: bool = betterproto2.bool_field(7) + JSON name of this field. The value is set by protocol compiler. If the + user has set a "json_name" option on this field, that option's value + will be used. Otherwise, it's deduced from the field's name by converting + it to camelCase. """ - Whether the message is an automatically generated map entry type for the - maps field. - - For maps fields: - map map_field = 1; - The parsed descriptor looks like: - message MapFieldEntry { - option map_entry = true; - optional KeyType key = 1; - optional ValueType value = 2; - } - repeated MapFieldEntry map_field = 1; - - Implementations may choose not to generate the map_entry=true message, but - use a native map in the target language to hold the keys and values. - The reflection APIs in such implementations still need to work as - if the field is a repeated message field. - - NOTE: Do not set the option in .proto files. Always use the maps syntax - instead. The option should only be implicitly set by the proto compiler - parser. + options: "Optional[FieldOptions]" = betterproto2.field(8, betterproto2.TYPE_MESSAGE, optional=True) + proto3_optional: "bool" = betterproto2.field(17, betterproto2.TYPE_BOOL) """ + If true, this is a proto3 "optional". When a proto3 field is optional, it + tracks presence regardless of field type. - uninterpreted_option: List["UninterpretedOption"] = betterproto2.message_field(999, repeated=True) - """The parser stores options it doesn't recognize here. See above.""" - + When proto3_optional is true, this field must be belong to a oneof to + signal to old proto3 clients that presence is tracked for this field. This + oneof is known as a "synthetic" oneof, and this field must be its sole + member (each proto3 optional field gets its own synthetic oneof). Synthetic + oneofs exist in the descriptor only, and do not generate any API. Synthetic + oneofs must be ordered after all "real" oneofs. -@dataclass(eq=False, repr=False) -class FieldOptions(betterproto2.Message): - """ """ + For message fields, proto3_optional doesn't create any semantic change, + since non-repeated message fields always track presence. However it still + indicates the semantic detail of whether the user wrote "optional" or not. + This can be useful for round-tripping the .proto file. For consistency we + give message fields a synthetic oneof also, even though it is not required + to track presence. This is especially important because the parser can't + tell if a field is a message or an enum, so it must always create a + synthetic oneof. - ctype: "FieldOptionsCType" = betterproto2.enum_field(1, enum_default_value=lambda: FieldOptionsCType.try_value(0)) - """ - The ctype option instructs the C++ code generator to use a different - representation of the field than it normally would. See the specific - options below. This option is not yet implemented in the open source - release -- sorry, we'll try to include it in a future version! + Proto2 optional fields do not set this flag, because they already indicate + optional with `LABEL_OPTIONAL`. """ - packed: bool = betterproto2.bool_field(2) - """ - The packed option can be enabled for repeated primitive fields to enable - a more efficient representation on the wire. Rather than repeatedly - writing the tag and type for each element, the entire array is encoded as - a single length-delimited blob. In proto3, only explicit setting it to - false will avoid using packed encoding. - """ - jstype: "FieldOptionsJsType" = betterproto2.enum_field( - 6, enum_default_value=lambda: FieldOptionsJsType.try_value(0) - ) - """ - The jstype option determines the JavaScript type used for values of the - field. The option is permitted only for 64 bit integral and fixed types - (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - is represented as JavaScript string, which avoids loss of precision that - can happen when a large value is converted to a floating point JavaScript. - Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - use the JavaScript "number" type. The behavior of the default option - JS_NORMAL is implementation dependent. - - This option is an enum to permit additional types to be added, e.g. - goog.math.Integer. +@dataclass(eq=False, repr=False) +class FieldMask(betterproto2.Message): """ + `FieldMask` represents a set of symbolic field paths, for example: - lazy: bool = betterproto2.bool_field(5) - """ - Should this field be parsed lazily? Lazy applies only to message-type - fields. It means that when the outer message is initially parsed, the - inner message's contents will not be parsed but instead stored in encoded - form. The inner message will actually be parsed when it is first accessed. - - This is only a hint. Implementations are free to choose whether to use - eager or lazy parsing regardless of the value of this option. However, - setting this option true suggests that the protocol author believes that - using lazy parsing on this field is worth the additional bookkeeping - overhead typically needed to implement it. - - This option does not affect the public interface of any generated code; - all method signatures remain the same. Furthermore, thread-safety of the - interface is not affected by this option; const methods remain safe to - call from multiple threads concurrently, while non-const methods continue - to require exclusive access. - - Note that implementations may choose not to check required fields within - a lazy sub-message. That is, calling IsInitialized() on the outer message - may return true even if the inner message has missing required fields. - This is necessary because otherwise the inner message would have to be - parsed in order to perform the check, defeating the purpose of lazy - parsing. An implementation which chooses not to check required fields - must be consistent about it. That is, for any particular sub-message, the - implementation must either *always* check its required fields, or *never* - check its required fields, regardless of whether or not the message has - been parsed. - """ + paths: "f.a" + paths: "f.b.d" - deprecated: bool = betterproto2.bool_field(3) - """ - Is this field deprecated? - Depending on the target platform, this can emit Deprecated annotations - for accessors, or it will be completely ignored; in the very least, this - is a formalization for deprecating fields. - """ + Here `f` represents a field in some root message, `a` and `b` + fields in the message found in `f`, and `d` a field found in the + message in `f.b`. - weak: bool = betterproto2.bool_field(10) - """For Google-internal migration only. Do not use.""" + Field masks are used to specify a subset of fields that should be + returned by a get operation or modified by an update operation. + Field masks also have a custom JSON encoding (see below). - uninterpreted_option: List["UninterpretedOption"] = betterproto2.message_field(999, repeated=True) - """The parser stores options it doesn't recognize here. See above.""" + # Field Masks in Projections + When used in the context of a projection, a response message or + sub-message is filtered by the API to only contain those fields as + specified in the mask. For example, if the mask in the previous + example is applied to a response message as follows: -@dataclass(eq=False, repr=False) -class OneofOptions(betterproto2.Message): - """ """ + f { + a : 22 + b { + d : 1 + x : 2 + } + y : 13 + } + z: 8 - uninterpreted_option: List["UninterpretedOption"] = betterproto2.message_field(999, repeated=True) - """The parser stores options it doesn't recognize here. See above.""" + The result will not contain specific values for fields x,y and z + (their value will be set to the default, and omitted in proto text + output): + f { + a : 22 + b { + d : 1 + } + } -@dataclass(eq=False, repr=False) -class EnumOptions(betterproto2.Message): - """ """ + A repeated field is not allowed except at the last position of a + paths string. - allow_alias: bool = betterproto2.bool_field(2) - """ - Set this option to true to allow mapping different tag names to the same - value. - """ + If a FieldMask object is not present in a get operation, the + operation applies to all fields (as if a FieldMask of all fields + had been specified). + + Note that a field mask does not necessarily apply to the + top-level response message. In case of a REST get operation, the + field mask applies directly to the response, but in case of a REST + list operation, the mask instead applies to each individual message + in the returned resource list. In case of a REST custom method, + other definitions may be used. Where the mask applies will be + clearly documented together with its declaration in the API. In + any case, the effect on the returned resource/resources is required + behavior for APIs. + + # Field Masks in Update Operations + + A field mask in update operations specifies which fields of the + targeted resource are going to be updated. The API is required + to only change the values of the fields as specified in the mask + and leave the others untouched. If a resource is passed in to + describe the updated values, the API ignores the values of all + fields not covered by the mask. + + If a repeated field is specified for an update operation, new values will + be appended to the existing repeated field in the target resource. Note that + a repeated field is only allowed in the last position of a `paths` string. + + If a sub-message is specified in the last position of the field mask for an + update operation, then new value will be merged into the existing sub-message + in the target resource. + + For example, given the target message: + + f { + b { + d: 1 + x: 2 + } + c: [1] + } + + And an update message: + + f { + b { + d: 10 + } + c: [2] + } + + then if the field mask is: + + paths: ["f.b", "f.c"] + + then the result will be: + + f { + b { + d: 10 + x: 2 + } + c: [1, 2] + } + + An implementation may provide options to override this default behavior for + repeated and message fields. + + In order to reset a field's value to the default, the field must + be in the mask and set to the default value in the provided resource. + Hence, in order to reset all fields of a resource, provide a default + instance of the resource and set all fields in the mask, or do + not provide a mask as described below. + + If a field mask is not present on update, the operation applies to + all fields (as if a field mask of all fields has been specified). + Note that in the presence of schema evolution, this may mean that + fields the client does not know and has therefore not filled into + the request will be reset to their default. If this is unwanted + behavior, a specific service may require a client to always specify + a field mask, producing an error if not. + + As with get operations, the location of the resource which + describes the updated values in the request message depends on the + operation kind. In any case, the effect of the field mask is + required to be honored by the API. + + ## Considerations for HTTP REST + + The HTTP kind of an update operation which uses a field mask must + be set to PATCH instead of PUT in order to satisfy HTTP semantics + (PUT must only be used for full updates). + + # JSON Encoding of Field Masks + + In JSON, a field mask is encoded as a single string where paths are + separated by a comma. Fields name in each path are converted + to/from lower-camel naming conventions. + + As an example, consider the following message declarations: + + message Profile { + User user = 1; + Photo photo = 2; + } + message User { + string display_name = 1; + string address = 2; + } + + In proto a field mask for `Profile` may look as such: + + mask { + paths: "user.display_name" + paths: "photo" + } + + In JSON, the same mask is represented as below: + + { + mask: "user.displayName,photo" + } + + # Field Masks and Oneof Fields + + Field masks treat fields in oneofs just as regular fields. Consider the + following message: + + message SampleMessage { + oneof test_oneof { + string name = 4; + SubMessage sub_message = 9; + } + } + + The field mask can be: + + mask { + paths: "name" + } + + Or: + + mask { + paths: "sub_message" + } + + Note that oneof type names ("test_oneof" in this case) cannot be used in + paths. + + ## Field Mask Verification + + The implementation of any API method which has a FieldMask type field in the + request should verify the included field paths, and return an + `INVALID_ARGUMENT` error if any path is unmappable. + + """ + + paths: "List[str]" = betterproto2.field(1, betterproto2.TYPE_STRING, repeated=True) + """ + The set of field mask paths. + """ + + +@dataclass(eq=False, repr=False) +class FieldOptions(betterproto2.Message): + ctype: "FieldOptionsCType" = betterproto2.field( + 1, betterproto2.TYPE_ENUM, default_factory=lambda: FieldOptionsCType.try_value(0) + ) + """ + The ctype option instructs the C++ code generator to use a different + representation of the field than it normally would. See the specific + options below. This option is not yet implemented in the open source + release -- sorry, we'll try to include it in a future version! + """ + packed: "bool" = betterproto2.field(2, betterproto2.TYPE_BOOL) + """ + The packed option can be enabled for repeated primitive fields to enable + a more efficient representation on the wire. Rather than repeatedly + writing the tag and type for each element, the entire array is encoded as + a single length-delimited blob. In proto3, only explicit setting it to + false will avoid using packed encoding. + """ + jstype: "FieldOptionsJsType" = betterproto2.field( + 6, betterproto2.TYPE_ENUM, default_factory=lambda: FieldOptionsJsType.try_value(0) + ) + """ + The jstype option determines the JavaScript type used for values of the + field. The option is permitted only for 64 bit integral and fixed types + (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + is represented as JavaScript string, which avoids loss of precision that + can happen when a large value is converted to a floating point JavaScript. + Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + use the JavaScript "number" type. The behavior of the default option + JS_NORMAL is implementation dependent. + + This option is an enum to permit additional types to be added, e.g. + goog.math.Integer. + """ + lazy: "bool" = betterproto2.field(5, betterproto2.TYPE_BOOL) + """ + Should this field be parsed lazily? Lazy applies only to message-type + fields. It means that when the outer message is initially parsed, the + inner message's contents will not be parsed but instead stored in encoded + form. The inner message will actually be parsed when it is first accessed. + + This is only a hint. Implementations are free to choose whether to use + eager or lazy parsing regardless of the value of this option. However, + setting this option true suggests that the protocol author believes that + using lazy parsing on this field is worth the additional bookkeeping + overhead typically needed to implement it. + + This option does not affect the public interface of any generated code; + all method signatures remain the same. Furthermore, thread-safety of the + interface is not affected by this option; const methods remain safe to + call from multiple threads concurrently, while non-const methods continue + to require exclusive access. + + Note that implementations may choose not to check required fields within + a lazy sub-message. That is, calling IsInitialized() on the outer message + may return true even if the inner message has missing required fields. + This is necessary because otherwise the inner message would have to be + parsed in order to perform the check, defeating the purpose of lazy + parsing. An implementation which chooses not to check required fields + must be consistent about it. That is, for any particular sub-message, the + implementation must either *always* check its required fields, or *never* + check its required fields, regardless of whether or not the message has + been parsed. + """ + deprecated: "bool" = betterproto2.field(3, betterproto2.TYPE_BOOL) + """ + Is this field deprecated? + Depending on the target platform, this can emit Deprecated annotations + for accessors, or it will be completely ignored; in the very least, this + is a formalization for deprecating fields. + """ + weak: "bool" = betterproto2.field(10, betterproto2.TYPE_BOOL) + """ + For Google-internal migration only. Do not use. + """ + uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( + 999, betterproto2.TYPE_MESSAGE, repeated=True + ) + """ + The parser stores options it doesn't recognize here. See above. + """ + + +@dataclass(eq=False, repr=False) +class FileDescriptorProto(betterproto2.Message): + """ + Describes a complete .proto file. + + """ + + name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) + """ + file name, relative to root of source tree + """ + package: "str" = betterproto2.field(2, betterproto2.TYPE_STRING) + """ + e.g. "foo", "foo.bar", etc. + """ + dependency: "List[str]" = betterproto2.field(3, betterproto2.TYPE_STRING, repeated=True) + """ + Names of files imported by this file. + """ + public_dependency: "List[int]" = betterproto2.field(10, betterproto2.TYPE_INT32, repeated=True) + """ + Indexes of the public imported files in the dependency list above. + """ + weak_dependency: "List[int]" = betterproto2.field(11, betterproto2.TYPE_INT32, repeated=True) + """ + Indexes of the weak imported files in the dependency list. + For Google-internal migration only. Do not use. + """ + message_type: "List[DescriptorProto]" = betterproto2.field(4, betterproto2.TYPE_MESSAGE, repeated=True) + """ + All top-level definitions in this file. + """ + enum_type: "List[EnumDescriptorProto]" = betterproto2.field(5, betterproto2.TYPE_MESSAGE, repeated=True) + service: "List[ServiceDescriptorProto]" = betterproto2.field(6, betterproto2.TYPE_MESSAGE, repeated=True) + extension: "List[FieldDescriptorProto]" = betterproto2.field(7, betterproto2.TYPE_MESSAGE, repeated=True) + options: "Optional[FileOptions]" = betterproto2.field(8, betterproto2.TYPE_MESSAGE, optional=True) + source_code_info: "Optional[SourceCodeInfo]" = betterproto2.field(9, betterproto2.TYPE_MESSAGE, optional=True) + """ + This field contains optional information about the original source code. + You may safely remove this entire field without harming runtime + functionality of the descriptors -- the information is needed only by + development tools. + """ + syntax: "str" = betterproto2.field(12, betterproto2.TYPE_STRING) + """ + The syntax of the proto file. + The supported values are "proto2" and "proto3". + """ + + +@dataclass(eq=False, repr=False) +class FileDescriptorSet(betterproto2.Message): + """ + The protocol compiler can output a FileDescriptorSet containing the .proto + files it parses. + + """ + + file: "List[FileDescriptorProto]" = betterproto2.field(1, betterproto2.TYPE_MESSAGE, repeated=True) + + +@dataclass(eq=False, repr=False) +class FileOptions(betterproto2.Message): + """ + =================================================================== + Options + + Each of the definitions above may have "options" attached. These are + just annotations which may cause code to be generated slightly differently + or may contain hints for code that manipulates protocol messages. + + Clients may define custom options as extensions of the *Options messages. + These extensions may not yet be known at parsing time, so the parser cannot + store the values in them. Instead it stores them in a field in the *Options + message called uninterpreted_option. This field must have the same name + across all *Options messages. We then use this field to populate the + extensions when we build a descriptor, at which point all protos have been + parsed and so all extensions are known. + + Extension numbers for custom options may be chosen as follows: + * For options which will only be used within a single application or + organization, or for experimental options, use field numbers 50000 + through 99999. It is up to you to ensure that you do not use the + same number for multiple options. + * For options which will be published and used publicly by multiple + independent entities, e-mail protobuf-global-extension-registry@google.com + to reserve extension numbers. Simply provide your project name (e.g. + Objective-C plugin) and your project website (if available) -- there's no + need to explain how you intend to use them. Usually you only need one + extension number. You can declare multiple options with only one extension + number by putting them in a sub-message. See the Custom Options section of + the docs for examples: + https://developers.google.com/protocol-buffers/docs/proto#options + If this turns out to be popular, a web service will be set up + to automatically assign option numbers. - deprecated: bool = betterproto2.bool_field(3) """ - Is this enum deprecated? + + java_package: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) + """ + Sets the Java package where classes generated from this .proto will be + placed. By default, the proto package is used, but this is often + inappropriate because proto packages do not normally start with backwards + domain names. + """ + java_outer_classname: "str" = betterproto2.field(8, betterproto2.TYPE_STRING) + """ + If set, all the classes from the .proto file are wrapped in a single + outer class with the given name. This applies to both Proto1 + (equivalent to the old "--one_java_file" option) and Proto2 (where + a .proto always translates to a single class, but you may want to + explicitly choose the class name). + """ + java_multiple_files: "bool" = betterproto2.field(10, betterproto2.TYPE_BOOL) + """ + If set true, then the Java code generator will generate a separate .java + file for each top-level message, enum, and service defined in the .proto + file. Thus, these types will *not* be nested inside the outer class + named by java_outer_classname. However, the outer class will still be + generated to contain the file's getDescriptor() method as well as any + top-level extensions defined in the file. + """ + java_generate_equals_and_hash: "bool" = betterproto2.field(20, betterproto2.TYPE_BOOL) + """ + This option does nothing. + """ + java_string_check_utf8: "bool" = betterproto2.field(27, betterproto2.TYPE_BOOL) + """ + If set true, then the Java2 code generator will generate code that + throws an exception whenever an attempt is made to assign a non-UTF-8 + byte sequence to a string field. + Message reflection will do the same. + However, an extension field still accepts non-UTF-8 byte sequences. + This option has no effect on when used with the lite runtime. + """ + optimize_for: "FileOptionsOptimizeMode" = betterproto2.field( + 9, betterproto2.TYPE_ENUM, default_factory=lambda: FileOptionsOptimizeMode.try_value(0) + ) + go_package: "str" = betterproto2.field(11, betterproto2.TYPE_STRING) + """ + Sets the Go package where structs generated from this .proto will be + placed. If omitted, the Go package will be derived from the following: + - The basename of the package import path, if provided. + - Otherwise, the package statement in the .proto file, if present. + - Otherwise, the basename of the .proto file, without extension. + """ + cc_generic_services: "bool" = betterproto2.field(16, betterproto2.TYPE_BOOL) + """ + Should generic services be generated in each language? "Generic" services + are not specific to any particular RPC system. They are generated by the + main code generators in each language (without additional plugins). + Generic services were the only kind of service generation supported by + early versions of google.protobuf. + + Generic services are now considered deprecated in favor of using plugins + that generate code specific to your particular RPC system. Therefore, + these default to false. Old code which depends on generic services should + explicitly set them to true. + """ + java_generic_services: "bool" = betterproto2.field(17, betterproto2.TYPE_BOOL) + py_generic_services: "bool" = betterproto2.field(18, betterproto2.TYPE_BOOL) + php_generic_services: "bool" = betterproto2.field(42, betterproto2.TYPE_BOOL) + deprecated: "bool" = betterproto2.field(23, betterproto2.TYPE_BOOL) + """ + Is this file deprecated? Depending on the target platform, this can emit Deprecated annotations - for the enum, or it will be completely ignored; in the very least, this - is a formalization for deprecating enums. + for everything in the file, or it will be completely ignored; in the very + least, this is a formalization for deprecating files. + """ + cc_enable_arenas: "bool" = betterproto2.field(31, betterproto2.TYPE_BOOL) + """ + Enables the use of arenas for the proto messages in this file. This applies + only to generated classes for C++. + """ + objc_class_prefix: "str" = betterproto2.field(36, betterproto2.TYPE_STRING) + """ + Sets the objective c class prefix which is prepended to all objective c + generated classes from this .proto. There is no default. + """ + csharp_namespace: "str" = betterproto2.field(37, betterproto2.TYPE_STRING) + """ + Namespace for generated classes; defaults to the package. + """ + swift_prefix: "str" = betterproto2.field(39, betterproto2.TYPE_STRING) + """ + By default Swift generators will take the proto package and CamelCase it + replacing '.' with underscore and use that to prefix the types/symbols + defined. When this options is provided, they will use this value instead + to prefix the types/symbols defined. + """ + php_class_prefix: "str" = betterproto2.field(40, betterproto2.TYPE_STRING) + """ + Sets the php class prefix which is prepended to all php generated classes + from this .proto. Default is empty. + """ + php_namespace: "str" = betterproto2.field(41, betterproto2.TYPE_STRING) + """ + Use this option to change the namespace of php generated classes. Default + is empty. When this option is empty, the package name will be used for + determining the namespace. + """ + php_metadata_namespace: "str" = betterproto2.field(44, betterproto2.TYPE_STRING) + """ + Use this option to change the namespace of php generated metadata classes. + Default is empty. When this option is empty, the proto file name will be + used for determining the namespace. + """ + ruby_package: "str" = betterproto2.field(45, betterproto2.TYPE_STRING) + """ + Use this option to change the package of ruby generated classes. Default + is empty. When this option is not set, the package name will be used for + determining the ruby package. + """ + uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( + 999, betterproto2.TYPE_MESSAGE, repeated=True + ) + """ + The parser stores options it doesn't recognize here. + See the documentation for the "Options" section above. """ - uninterpreted_option: List["UninterpretedOption"] = betterproto2.message_field(999, repeated=True) - """The parser stores options it doesn't recognize here. See above.""" + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("java_generate_equals_and_hash"): + warnings.warn("FileOptions.java_generate_equals_and_hash is deprecated", DeprecationWarning) @dataclass(eq=False, repr=False) -class EnumValueOptions(betterproto2.Message): - """ """ - - deprecated: bool = betterproto2.bool_field(1) +class FloatValue(betterproto2.Message): """ - Is this enum value deprecated? - Depending on the target platform, this can emit Deprecated annotations - for the enum value, or it will be completely ignored; in the very least, - this is a formalization for deprecating enum values. + Wrapper message for `float`. + + The JSON representation for `FloatValue` is JSON number. + """ - uninterpreted_option: List["UninterpretedOption"] = betterproto2.message_field(999, repeated=True) - """The parser stores options it doesn't recognize here. See above.""" + value: "float" = betterproto2.field(1, betterproto2.TYPE_FLOAT) + """ + The float value. + """ @dataclass(eq=False, repr=False) -class ServiceOptions(betterproto2.Message): - """ """ +class GeneratedCodeInfo(betterproto2.Message): + """ + Describes the relationship between generated code and its original source + file. A GeneratedCodeInfo message is associated with only one generated + source file, but may contain references to different source .proto files. - deprecated: bool = betterproto2.bool_field(33) """ - Note: Field numbers 1 through 32 are reserved for Google's internal RPC - framework. We apologize for hoarding these numbers to ourselves, but - we were already using them long before we decided to release Protocol - Buffers. - - Is this service deprecated? - Depending on the target platform, this can emit Deprecated annotations - for the service, or it will be completely ignored; in the very least, - this is a formalization for deprecating services. + + annotation: "List[GeneratedCodeInfoAnnotation]" = betterproto2.field(1, betterproto2.TYPE_MESSAGE, repeated=True) """ + An Annotation connects some span of text in generated code to an element + of its generating .proto file. + """ + - uninterpreted_option: List["UninterpretedOption"] = betterproto2.message_field(999, repeated=True) - """The parser stores options it doesn't recognize here. See above.""" +@dataclass(eq=False, repr=False) +class GeneratedCodeInfoAnnotation(betterproto2.Message): + path: "List[int]" = betterproto2.field(1, betterproto2.TYPE_INT32, repeated=True) + """ + Identifies the element in the original source .proto file. This field + is formatted the same as SourceCodeInfo.Location.path. + """ + source_file: "str" = betterproto2.field(2, betterproto2.TYPE_STRING) + """ + Identifies the filesystem path to the original source .proto. + """ + begin: "int" = betterproto2.field(3, betterproto2.TYPE_INT32) + """ + Identifies the starting offset in bytes in the generated code + that relates to the identified object. + """ + end: "int" = betterproto2.field(4, betterproto2.TYPE_INT32) + """ + Identifies the ending offset in bytes in the generated code that + relates to the identified offset. The end offset should be one past + the last relevant byte (so the length of the text = end - begin). + """ @dataclass(eq=False, repr=False) -class MethodOptions(betterproto2.Message): - """ """ +class Int32Value(betterproto2.Message): + """ + Wrapper message for `int32`. + + The JSON representation for `Int32Value` is JSON number. - deprecated: bool = betterproto2.bool_field(33) """ - Note: Field numbers 1 through 32 are reserved for Google's internal RPC - framework. We apologize for hoarding these numbers to ourselves, but - we were already using them long before we decided to release Protocol - Buffers. - - Is this method deprecated? - Depending on the target platform, this can emit Deprecated annotations - for the method, or it will be completely ignored; in the very least, - this is a formalization for deprecating methods. + + value: "int" = betterproto2.field(1, betterproto2.TYPE_INT32) + """ + The int32 value. """ - idempotency_level: "MethodOptionsIdempotencyLevel" = betterproto2.enum_field( - 34, enum_default_value=lambda: MethodOptionsIdempotencyLevel.try_value(0) - ) + +@dataclass(eq=False, repr=False) +class Int64Value(betterproto2.Message): """ - + Wrapper message for `int64`. + + The JSON representation for `Int64Value` is JSON string. + """ - uninterpreted_option: List["UninterpretedOption"] = betterproto2.message_field(999, repeated=True) - """The parser stores options it doesn't recognize here. See above.""" + value: "int" = betterproto2.field(1, betterproto2.TYPE_INT64) + """ + The int64 value. + """ @dataclass(eq=False, repr=False) -class UninterpretedOption(betterproto2.Message): +class ListValue(betterproto2.Message): """ - A message representing a option the parser does not recognize. This only - appears in options protos created by the compiler::Parser class. - DescriptorPool resolves these when building Descriptor objects. Therefore, - options protos in descriptor objects (e.g. returned by Descriptor::options(), - or produced by Descriptor::CopyTo()) will never have UninterpretedOptions - in them. + `ListValue` is a wrapper around a repeated field of values. + + The JSON representation for `ListValue` is JSON array. + """ - name: List["UninterpretedOptionNamePart"] = betterproto2.message_field(2, repeated=True) + values: "List[Value]" = betterproto2.field(1, betterproto2.TYPE_MESSAGE, repeated=True) """ - + Repeated field of dynamically typed values. """ - identifier_value: str = betterproto2.string_field(3) + +@dataclass(eq=False, repr=False) +class MessageOptions(betterproto2.Message): + message_set_wire_format: "bool" = betterproto2.field(1, betterproto2.TYPE_BOOL) """ - The value of the uninterpreted option, in whatever type the tokenizer - identified it as during parsing. Exactly one of these should be set. + Set true to use the old proto1 MessageSet wire format for extensions. + This is provided for backwards-compatibility with the MessageSet wire + format. You should not use this for any other reason: It's less + efficient, has fewer features, and is more complicated. + + The message must be defined exactly as follows: + message Foo { + option message_set_wire_format = true; + extensions 4 to max; + } + Note that the message cannot have any defined fields; MessageSets only + have extensions. + + All extensions of your type must be singular messages; e.g. they cannot + be int32s, enums, or repeated messages. + + Because this is an option, the above two restrictions are not enforced by + the protocol compiler. + """ + no_standard_descriptor_accessor: "bool" = betterproto2.field(2, betterproto2.TYPE_BOOL) + """ + Disables the generation of the standard "descriptor()" accessor, which can + conflict with a field of the same name. This is meant to make migration + from proto1 easier; new code should avoid fields named "descriptor". + """ + deprecated: "bool" = betterproto2.field(3, betterproto2.TYPE_BOOL) + """ + Is this message deprecated? + Depending on the target platform, this can emit Deprecated annotations + for the message, or it will be completely ignored; in the very least, + this is a formalization for deprecating messages. + """ + map_entry: "bool" = betterproto2.field(7, betterproto2.TYPE_BOOL) """ + Whether the message is an automatically generated map entry type for the + maps field. + + For maps fields: + map map_field = 1; + The parsed descriptor looks like: + message MapFieldEntry { + option map_entry = true; + optional KeyType key = 1; + optional ValueType value = 2; + } + repeated MapFieldEntry map_field = 1; + + Implementations may choose not to generate the map_entry=true message, but + use a native map in the target language to hold the keys and values. + The reflection APIs in such implementations still need to work as + if the field is a repeated message field. - positive_int_value: int = betterproto2.uint64_field(4) + NOTE: Do not set the option in .proto files. Always use the maps syntax + instead. The option should only be implicitly set by the proto compiler + parser. + """ + uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( + 999, betterproto2.TYPE_MESSAGE, repeated=True + ) """ - + The parser stores options it doesn't recognize here. See above. """ - negative_int_value: int = betterproto2.int64_field(5) - """ - - """ - double_value: float = betterproto2.double_field(6) +@dataclass(eq=False, repr=False) +class Method(betterproto2.Message): """ - + Method represents a method of an API interface. + """ - string_value: bytes = betterproto2.bytes_field(7) + name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) """ - + The simple name of this method. """ - - aggregate_value: str = betterproto2.string_field(8) + request_type_url: "str" = betterproto2.field(2, betterproto2.TYPE_STRING) """ - + A URL of the input message type. """ - - -@dataclass(eq=False, repr=False) -class UninterpretedOptionNamePart(betterproto2.Message): + request_streaming: "bool" = betterproto2.field(3, betterproto2.TYPE_BOOL) """ - The name of the uninterpreted option. Each string represents a segment in - a dot-separated name. is_extension is true iff a segment represents an - extension (denoted with parentheses in options specs in .proto files). - E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents - "foo.(bar.baz).qux". + If true, the request is streamed. """ - - name_part: str = betterproto2.string_field(1) + response_type_url: "str" = betterproto2.field(4, betterproto2.TYPE_STRING) """ - + The URL of the output message type. """ - - is_extension: bool = betterproto2.bool_field(2) + response_streaming: "bool" = betterproto2.field(5, betterproto2.TYPE_BOOL) """ - + If true, the response is streamed. """ - - -@dataclass(eq=False, repr=False) -class SourceCodeInfo(betterproto2.Message): + options: "List[Option]" = betterproto2.field(6, betterproto2.TYPE_MESSAGE, repeated=True) """ - =================================================================== - Optional source code info - - Encapsulates information about the original source file from which a - FileDescriptorProto was generated. + Any metadata attached to the method. """ - - location: List["SourceCodeInfoLocation"] = betterproto2.message_field(1, repeated=True) + syntax: "Syntax" = betterproto2.field(7, betterproto2.TYPE_ENUM, default_factory=lambda: Syntax.try_value(0)) """ - A Location identifies a piece of source code in a .proto file which - corresponds to a particular definition. This information is intended - to be useful to IDEs, code indexers, documentation generators, and similar - tools. - - For example, say we have a file like: - message Foo { - optional string foo = 1; - } - Let's look at just the field definition: - optional string foo = 1; - ^ ^^ ^^ ^ ^^^ - a bc de f ghi - We have the following locations: - span path represents - [a,i) [ 4, 0, 2, 0 ] The whole field definition. - [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - - Notes: - - A location may refer to a repeated field itself (i.e. not to any - particular index within it). This is used whenever a set of elements are - logically enclosed in a single code segment. For example, an entire - extend block (possibly containing multiple extension definitions) will - have an outer location whose path refers to the "extensions" repeated - field without an index. - - Multiple locations may have the same path. This happens when a single - logical declaration is spread out across multiple places. The most - obvious example is the "extend" block again -- there may be multiple - extend blocks in the same scope, each of which will have the same path. - - A location's span is not always a subset of its parent's span. For - example, the "extendee" of an extension declaration appears at the - beginning of the "extend" block and is shared by all extensions within - the block. - - Just because a location's span is a subset of some other location's span - does not mean that it is a descendant. For example, a "group" defines - both a type and a field in a single declaration. Thus, the locations - corresponding to the type and field and their components will overlap. - - Code which tries to interpret locations should probably be designed to - ignore those that it doesn't understand, as more types of locations could - be recorded in the future. + The source syntax of this method. """ @dataclass(eq=False, repr=False) -class SourceCodeInfoLocation(betterproto2.Message): - """ """ - - path: List[int] = betterproto2.int32_field(1, repeated=True) - """ - Identifies which part of the FileDescriptorProto was defined at this - location. - - Each element is a field number or an index. They form a path from - the root FileDescriptorProto to the place where the definition. For - example, this path: - [ 4, 3, 2, 7, 1 ] - refers to: - file.message_type(3) // 4, 3 - .field(7) // 2, 7 - .name() // 1 - This is because FileDescriptorProto.message_type has field number 4: - repeated DescriptorProto message_type = 4; - and DescriptorProto.field has field number 2: - repeated FieldDescriptorProto field = 2; - and FieldDescriptorProto.name has field number 1: - optional string name = 1; - - Thus, the above path gives the location of a field name. If we removed - the last element: - [ 4, 3, 2, 7 ] - this path refers to the whole field declaration (from the beginning - of the label to the terminating semicolon). +class MethodDescriptorProto(betterproto2.Message): """ + Describes a method of a service. - span: List[int] = betterproto2.int32_field(2, repeated=True) - """ - Always has exactly three or four elements: start line, start column, - end line (optional, otherwise assumed same as start line), end column. - These are packed into a single field for efficiency. Note that line - and column numbers are zero-based -- typically you will want to add - 1 to each before displaying to a user. """ - leading_comments: str = betterproto2.string_field(3) + name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) + input_type: "str" = betterproto2.field(2, betterproto2.TYPE_STRING) """ - If this SourceCodeInfo represents a complete declaration, these are any - comments appearing before and after the declaration which appear to be - attached to the declaration. - - A series of line comments appearing on consecutive lines, with no other - tokens appearing on those lines, will be treated as a single comment. - - leading_detached_comments will keep paragraphs of comments that appear - before (but not connected to) the current element. Each paragraph, - separated by empty lines, will be one comment element in the repeated - field. - - Only the comment content is provided; comment markers (e.g. //) are - stripped out. For block comments, leading whitespace and an asterisk - will be stripped from the beginning of each line other than the first. - Newlines are included in the output. - - Examples: - - optional int32 foo = 1; // Comment attached to foo. - // Comment attached to bar. - optional int32 bar = 2; - - optional string baz = 3; - // Comment attached to baz. - // Another line attached to baz. - - // Comment attached to qux. - // - // Another line attached to qux. - optional double qux = 4; - - // Detached comment for corge. This is not leading or trailing comments - // to qux or corge because there are blank lines separating it from - // both. - - // Detached comment for corge paragraph 2. - - optional string corge = 5; - /* Block comment attached - * to corge. Leading asterisks - * will be removed. */ - /* Block comment attached to - * grault. */ - optional int32 grault = 6; - - // ignored detached comments. + Input and output type names. These are resolved in the same way as + FieldDescriptorProto.type_name, but must refer to a message type. """ - - trailing_comments: str = betterproto2.string_field(4) + output_type: "str" = betterproto2.field(3, betterproto2.TYPE_STRING) + options: "Optional[MethodOptions]" = betterproto2.field(4, betterproto2.TYPE_MESSAGE, optional=True) + client_streaming: "bool" = betterproto2.field(5, betterproto2.TYPE_BOOL) """ - + Identifies if client streams multiple client messages """ - - leading_detached_comments: List[str] = betterproto2.string_field(6, repeated=True) + server_streaming: "bool" = betterproto2.field(6, betterproto2.TYPE_BOOL) """ - + Identifies if server streams multiple server messages """ @dataclass(eq=False, repr=False) -class GeneratedCodeInfo(betterproto2.Message): - """ - Describes the relationship between generated code and its original source - file. A GeneratedCodeInfo message is associated with only one generated - source file, but may contain references to different source .proto files. +class MethodOptions(betterproto2.Message): + deprecated: "bool" = betterproto2.field(33, betterproto2.TYPE_BOOL) """ + Note: Field numbers 1 through 32 are reserved for Google's internal RPC + framework. We apologize for hoarding these numbers to ourselves, but + we were already using them long before we decided to release Protocol + Buffers. - annotation: List["GeneratedCodeInfoAnnotation"] = betterproto2.message_field(1, repeated=True) - """ - An Annotation connects some span of text in generated code to an element - of its generating .proto file. + Is this method deprecated? + Depending on the target platform, this can emit Deprecated annotations + for the method, or it will be completely ignored; in the very least, + this is a formalization for deprecating methods. """ - - -@dataclass(eq=False, repr=False) -class GeneratedCodeInfoAnnotation(betterproto2.Message): - """ """ - - path: List[int] = betterproto2.int32_field(1, repeated=True) + idempotency_level: "MethodOptionsIdempotencyLevel" = betterproto2.field( + 34, betterproto2.TYPE_ENUM, default_factory=lambda: MethodOptionsIdempotencyLevel.try_value(0) + ) + uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( + 999, betterproto2.TYPE_MESSAGE, repeated=True + ) """ - Identifies the element in the original source .proto file. This field - is formatted the same as SourceCodeInfo.Location.path. + The parser stores options it doesn't recognize here. See above. """ - source_file: str = betterproto2.string_field(2) - """Identifies the filesystem path to the original source .proto.""" - - begin: int = betterproto2.int32_field(3) - """ - Identifies the starting offset in bytes in the generated code - that relates to the identified object. - """ - end: int = betterproto2.int32_field(4) - """ - Identifies the ending offset in bytes in the generated code that - relates to the identified offset. The end offset should be one past - the last relevant byte (so the length of the text = end - begin). +@dataclass(eq=False, repr=False) +class Mixin(betterproto2.Message): """ + Declares an API Interface to be included in this interface. The including + interface must redeclare all the methods from the included interface, but + documentation and options are inherited as follows: + - If after comment and whitespace stripping, the documentation + string of the redeclared method is empty, it will be inherited + from the original method. -@dataclass(eq=False, repr=False) -class Duration(betterproto2.Message): - """ - A Duration represents a signed, fixed-length span of time represented - as a count of seconds and fractions of seconds at nanosecond - resolution. It is independent of any calendar and concepts like "day" - or "month". It is related to Timestamp in that the difference between - two Timestamp values is a Duration and it can be added or subtracted - from a Timestamp. Range is approximately +-10,000 years. + - Each annotation belonging to the service config (http, + visibility) which is not set in the redeclared method will be + inherited. - # Examples + - If an http annotation is inherited, the path pattern will be + modified as follows. Any version prefix will be replaced by the + version of the including interface plus the [root][] path if + specified. - Example 1: Compute Duration from two Timestamps in pseudo code. + Example of a simple mixin: - Timestamp start = ...; - Timestamp end = ...; - Duration duration = ...; + package google.acl.v1; + service AccessControl { + // Get the underlying ACL object. + rpc GetAcl(GetAclRequest) returns (Acl) { + option (google.api.http).get = "/v1/{resource=**}:getAcl"; + } + } - duration.seconds = end.seconds - start.seconds; - duration.nanos = end.nanos - start.nanos; + package google.storage.v2; + service Storage { + rpc GetAcl(GetAclRequest) returns (Acl); - if (duration.seconds < 0 && duration.nanos > 0) { - duration.seconds += 1; - duration.nanos -= 1000000000; - } else if (duration.seconds > 0 && duration.nanos < 0) { - duration.seconds -= 1; - duration.nanos += 1000000000; + // Get a data record. + rpc GetData(GetDataRequest) returns (Data) { + option (google.api.http).get = "/v2/{resource=**}"; + } } - Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + Example of a mixin configuration: - Timestamp start = ...; - Duration duration = ...; - Timestamp end = ...; + apis: + - name: google.storage.v2.Storage + mixins: + - name: google.acl.v1.AccessControl - end.seconds = start.seconds + duration.seconds; - end.nanos = start.nanos + duration.nanos; + The mixin construct implies that all methods in `AccessControl` are + also declared with same name and request/response types in + `Storage`. A documentation generator or annotation processor will + see the effective `Storage.GetAcl` method after inherting + documentation and annotations as follows: - if (end.nanos < 0) { - end.seconds -= 1; - end.nanos += 1000000000; - } else if (end.nanos >= 1000000000) { - end.seconds += 1; - end.nanos -= 1000000000; + service Storage { + // Get the underlying ACL object. + rpc GetAcl(GetAclRequest) returns (Acl) { + option (google.api.http).get = "/v2/{resource=**}:getAcl"; + } + ... } - Example 3: Compute Duration from datetime.timedelta in Python. + Note how the version in the path pattern changed from `v1` to `v2`. + + If the `root` field in the mixin is specified, it should be a + relative path under which inherited HTTP paths are placed. Example: - td = datetime.timedelta(days=3, minutes=10) - duration = Duration() - duration.FromTimedelta(td) + apis: + - name: google.storage.v2.Storage + mixins: + - name: google.acl.v1.AccessControl + root: acls - # JSON Mapping + This implies the following inherited HTTP annotation: + + service Storage { + // Get the underlying ACL object. + rpc GetAcl(GetAclRequest) returns (Acl) { + option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + } + ... + } - In JSON format, the Duration type is encoded as a string rather than an - object, where the string ends in the suffix "s" (indicating seconds) and - is preceded by the number of seconds, with nanoseconds expressed as - fractional seconds. For example, 3 seconds with 0 nanoseconds should be - encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - microsecond should be expressed in JSON format as "3.000001s". """ - seconds: int = betterproto2.int64_field(1) + name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) """ - Signed seconds of the span of time. Must be from -315,576,000,000 - to +315,576,000,000 inclusive. Note: these bounds are computed from: - 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + The fully qualified name of the interface which is included. """ - - nanos: int = betterproto2.int32_field(2) + root: "str" = betterproto2.field(2, betterproto2.TYPE_STRING) """ - Signed fractions of a second at nanosecond resolution of the span - of time. Durations less than one second are represented with a 0 - `seconds` field and a positive or negative `nanos` field. For durations - of one second or more, a non-zero value for the `nanos` field must be - of the same sign as the `seconds` field. Must be from -999,999,999 - to +999,999,999 inclusive. + If non-empty specifies a path under which inherited HTTP paths + are rooted. """ @dataclass(eq=False, repr=False) -class Empty(betterproto2.Message): +class OneofDescriptorProto(betterproto2.Message): """ - A generic empty message that you can re-use to avoid defining duplicated - empty messages in your APIs. A typical example is to use it as the request - or the response type of an API method. For instance: - - service Foo { - rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - } + Describes a oneof. - The JSON representation for `Empty` is empty JSON object `{}`. """ - pass + name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) + options: "Optional[OneofOptions]" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, optional=True) @dataclass(eq=False, repr=False) -class FieldMask(betterproto2.Message): +class OneofOptions(betterproto2.Message): + uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( + 999, betterproto2.TYPE_MESSAGE, repeated=True + ) + """ + The parser stores options it doesn't recognize here. See above. """ - `FieldMask` represents a set of symbolic field paths, for example: - - paths: "f.a" - paths: "f.b.d" - - Here `f` represents a field in some root message, `a` and `b` - fields in the message found in `f`, and `d` a field found in the - message in `f.b`. - - Field masks are used to specify a subset of fields that should be - returned by a get operation or modified by an update operation. - Field masks also have a custom JSON encoding (see below). - - # Field Masks in Projections - - When used in the context of a projection, a response message or - sub-message is filtered by the API to only contain those fields as - specified in the mask. For example, if the mask in the previous - example is applied to a response message as follows: - - f { - a : 22 - b { - d : 1 - x : 2 - } - y : 13 - } - z: 8 - - The result will not contain specific values for fields x,y and z - (their value will be set to the default, and omitted in proto text - output): - f { - a : 22 - b { - d : 1 - } - } - A repeated field is not allowed except at the last position of a - paths string. +@dataclass(eq=False, repr=False) +class Option(betterproto2.Message): + """ + A protocol buffer option, which can be attached to a message, field, + enumeration, etc. - If a FieldMask object is not present in a get operation, the - operation applies to all fields (as if a FieldMask of all fields - had been specified). + """ - Note that a field mask does not necessarily apply to the - top-level response message. In case of a REST get operation, the - field mask applies directly to the response, but in case of a REST - list operation, the mask instead applies to each individual message - in the returned resource list. In case of a REST custom method, - other definitions may be used. Where the mask applies will be - clearly documented together with its declaration in the API. In - any case, the effect on the returned resource/resources is required - behavior for APIs. + name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) + """ + The option's name. For protobuf built-in options (options defined in + descriptor.proto), this is the short name. For example, `"map_entry"`. + For custom options, it should be the fully-qualified name. For example, + `"google.api.http"`. + """ + value: "Optional[Any]" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, optional=True) + """ + The option's value packed in an Any message. If the value is a primitive, + the corresponding wrapper type defined in google/protobuf/wrappers.proto + should be used. If the value is an enum, it should be stored as an int32 + value using the google.protobuf.Int32Value type. + """ - # Field Masks in Update Operations - A field mask in update operations specifies which fields of the - targeted resource are going to be updated. The API is required - to only change the values of the fields as specified in the mask - and leave the others untouched. If a resource is passed in to - describe the updated values, the API ignores the values of all - fields not covered by the mask. +@dataclass(eq=False, repr=False) +class ServiceDescriptorProto(betterproto2.Message): + """ + Describes a service. - If a repeated field is specified for an update operation, new values will - be appended to the existing repeated field in the target resource. Note that - a repeated field is only allowed in the last position of a `paths` string. + """ - If a sub-message is specified in the last position of the field mask for an - update operation, then new value will be merged into the existing sub-message - in the target resource. + name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) + method: "List[MethodDescriptorProto]" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, repeated=True) + options: "Optional[ServiceOptions]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, optional=True) - For example, given the target message: - f { - b { - d: 1 - x: 2 - } - c: [1] - } +@dataclass(eq=False, repr=False) +class ServiceOptions(betterproto2.Message): + deprecated: "bool" = betterproto2.field(33, betterproto2.TYPE_BOOL) + """ + Note: Field numbers 1 through 32 are reserved for Google's internal RPC + framework. We apologize for hoarding these numbers to ourselves, but + we were already using them long before we decided to release Protocol + Buffers. - And an update message: + Is this service deprecated? + Depending on the target platform, this can emit Deprecated annotations + for the service, or it will be completely ignored; in the very least, + this is a formalization for deprecating services. + """ + uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( + 999, betterproto2.TYPE_MESSAGE, repeated=True + ) + """ + The parser stores options it doesn't recognize here. See above. + """ - f { - b { - d: 10 - } - c: [2] - } - then if the field mask is: +@dataclass(eq=False, repr=False) +class SourceCodeInfo(betterproto2.Message): + """ + =================================================================== + Optional source code info - paths: ["f.b", "f.c"] + Encapsulates information about the original source file from which a + FileDescriptorProto was generated. - then the result will be: + """ - f { - b { - d: 10 - x: 2 - } - c: [1, 2] - } + location: "List[SourceCodeInfoLocation]" = betterproto2.field(1, betterproto2.TYPE_MESSAGE, repeated=True) + """ + A Location identifies a piece of source code in a .proto file which + corresponds to a particular definition. This information is intended + to be useful to IDEs, code indexers, documentation generators, and similar + tools. - An implementation may provide options to override this default behavior for - repeated and message fields. + For example, say we have a file like: + message Foo { + optional string foo = 1; + } + Let's look at just the field definition: + optional string foo = 1; + ^ ^^ ^^ ^ ^^^ + a bc de f ghi + We have the following locations: + span path represents + [a,i) [ 4, 0, 2, 0 ] The whole field definition. + [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - In order to reset a field's value to the default, the field must - be in the mask and set to the default value in the provided resource. - Hence, in order to reset all fields of a resource, provide a default - instance of the resource and set all fields in the mask, or do - not provide a mask as described below. + Notes: + - A location may refer to a repeated field itself (i.e. not to any + particular index within it). This is used whenever a set of elements are + logically enclosed in a single code segment. For example, an entire + extend block (possibly containing multiple extension definitions) will + have an outer location whose path refers to the "extensions" repeated + field without an index. + - Multiple locations may have the same path. This happens when a single + logical declaration is spread out across multiple places. The most + obvious example is the "extend" block again -- there may be multiple + extend blocks in the same scope, each of which will have the same path. + - A location's span is not always a subset of its parent's span. For + example, the "extendee" of an extension declaration appears at the + beginning of the "extend" block and is shared by all extensions within + the block. + - Just because a location's span is a subset of some other location's span + does not mean that it is a descendant. For example, a "group" defines + both a type and a field in a single declaration. Thus, the locations + corresponding to the type and field and their components will overlap. + - Code which tries to interpret locations should probably be designed to + ignore those that it doesn't understand, as more types of locations could + be recorded in the future. + """ - If a field mask is not present on update, the operation applies to - all fields (as if a field mask of all fields has been specified). - Note that in the presence of schema evolution, this may mean that - fields the client does not know and has therefore not filled into - the request will be reset to their default. If this is unwanted - behavior, a specific service may require a client to always specify - a field mask, producing an error if not. - As with get operations, the location of the resource which - describes the updated values in the request message depends on the - operation kind. In any case, the effect of the field mask is - required to be honored by the API. +@dataclass(eq=False, repr=False) +class SourceCodeInfoLocation(betterproto2.Message): + path: "List[int]" = betterproto2.field(1, betterproto2.TYPE_INT32, repeated=True) + """ + Identifies which part of the FileDescriptorProto was defined at this + location. - ## Considerations for HTTP REST + Each element is a field number or an index. They form a path from + the root FileDescriptorProto to the place where the definition. For + example, this path: + [ 4, 3, 2, 7, 1 ] + refers to: + file.message_type(3) // 4, 3 + .field(7) // 2, 7 + .name() // 1 + This is because FileDescriptorProto.message_type has field number 4: + repeated DescriptorProto message_type = 4; + and DescriptorProto.field has field number 2: + repeated FieldDescriptorProto field = 2; + and FieldDescriptorProto.name has field number 1: + optional string name = 1; - The HTTP kind of an update operation which uses a field mask must - be set to PATCH instead of PUT in order to satisfy HTTP semantics - (PUT must only be used for full updates). + Thus, the above path gives the location of a field name. If we removed + the last element: + [ 4, 3, 2, 7 ] + this path refers to the whole field declaration (from the beginning + of the label to the terminating semicolon). + """ + span: "List[int]" = betterproto2.field(2, betterproto2.TYPE_INT32, repeated=True) + """ + Always has exactly three or four elements: start line, start column, + end line (optional, otherwise assumed same as start line), end column. + These are packed into a single field for efficiency. Note that line + and column numbers are zero-based -- typically you will want to add + 1 to each before displaying to a user. + """ + leading_comments: "str" = betterproto2.field(3, betterproto2.TYPE_STRING) + """ + If this SourceCodeInfo represents a complete declaration, these are any + comments appearing before and after the declaration which appear to be + attached to the declaration. - # JSON Encoding of Field Masks + A series of line comments appearing on consecutive lines, with no other + tokens appearing on those lines, will be treated as a single comment. - In JSON, a field mask is encoded as a single string where paths are - separated by a comma. Fields name in each path are converted - to/from lower-camel naming conventions. + leading_detached_comments will keep paragraphs of comments that appear + before (but not connected to) the current element. Each paragraph, + separated by empty lines, will be one comment element in the repeated + field. - As an example, consider the following message declarations: + Only the comment content is provided; comment markers (e.g. //) are + stripped out. For block comments, leading whitespace and an asterisk + will be stripped from the beginning of each line other than the first. + Newlines are included in the output. - message Profile { - User user = 1; - Photo photo = 2; - } - message User { - string display_name = 1; - string address = 2; - } + Examples: - In proto a field mask for `Profile` may look as such: + optional int32 foo = 1; // Comment attached to foo. + // Comment attached to bar. + optional int32 bar = 2; - mask { - paths: "user.display_name" - paths: "photo" - } + optional string baz = 3; + // Comment attached to baz. + // Another line attached to baz. - In JSON, the same mask is represented as below: + // Comment attached to qux. + // + // Another line attached to qux. + optional double qux = 4; - { - mask: "user.displayName,photo" - } + // Detached comment for corge. This is not leading or trailing comments + // to qux or corge because there are blank lines separating it from + // both. - # Field Masks and Oneof Fields + // Detached comment for corge paragraph 2. - Field masks treat fields in oneofs just as regular fields. Consider the - following message: + optional string corge = 5; + /* Block comment attached + * to corge. Leading asterisks + * will be removed. */ + /* Block comment attached to + * grault. */ + optional int32 grault = 6; - message SampleMessage { - oneof test_oneof { - string name = 4; - SubMessage sub_message = 9; - } - } + // ignored detached comments. + """ + trailing_comments: "str" = betterproto2.field(4, betterproto2.TYPE_STRING) + leading_detached_comments: "List[str]" = betterproto2.field(6, betterproto2.TYPE_STRING, repeated=True) - The field mask can be: - mask { - paths: "name" - } +@dataclass(eq=False, repr=False) +class SourceContext(betterproto2.Message): + """ + `SourceContext` represents information about the source of a + protobuf element, like the file in which it is defined. - Or: + """ - mask { - paths: "sub_message" - } + file_name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) + """ + The path-qualified name of the .proto file that contained the associated + protobuf element. For example: `"google/protobuf/source_context.proto"`. + """ - Note that oneof type names ("test_oneof" in this case) cannot be used in - paths. - ## Field Mask Verification +@dataclass(eq=False, repr=False) +class StringValue(betterproto2.Message): + """ + Wrapper message for `string`. + + The JSON representation for `StringValue` is JSON string. - The implementation of any API method which has a FieldMask type field in the - request should verify the included field paths, and return an - `INVALID_ARGUMENT` error if any path is unmappable. """ - paths: List[str] = betterproto2.string_field(1, repeated=True) - """The set of field mask paths.""" + value: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) + """ + The string value. + """ @dataclass(eq=False, repr=False) @@ -2234,81 +2213,16 @@ class Struct(betterproto2.Message): with the proto support for the language. The JSON representation for `Struct` is JSON object. - """ - - fields: Dict[str, "Value"] = betterproto2.map_field(1, betterproto2.TYPE_STRING, betterproto2.TYPE_MESSAGE) - """Unordered map of dynamically typed values.""" - - @hybridmethod - def from_dict(cls: "type[Self]", value: Mapping[str, Any]) -> Self: # type: ignore - self = cls() - return self.from_dict(value) - - @from_dict.instancemethod - def from_dict(self, value: Mapping[str, Any]) -> Self: - fields = {**value} - for k in fields: - if hasattr(fields[k], "from_dict"): - fields[k] = fields[k].from_dict() - - self.fields = fields - return self - - def to_dict( - self, - casing: betterproto2.Casing = betterproto2.Casing.CAMEL, - include_default_values: bool = False, - ) -> Dict[str, Any]: - output = {**self.fields} - for k in self.fields: - if hasattr(self.fields[k], "to_dict"): - output[k] = self.fields[k].to_dict(casing, include_default_values) - return output - - -@dataclass(eq=False, repr=False) -class Value(betterproto2.Message): - """ - `Value` represents a dynamically typed value which can be either - null, a number, a string, a boolean, a recursive struct value, or a - list of values. A producer of value is expected to set one of that - variants, absence of any variant indicates an error. - The JSON representation for `Value` is JSON value. """ - null_value: "NullValue" = betterproto2.enum_field( - 1, enum_default_value=lambda: NullValue.try_value(0), group="kind" + fields: "Dict[str, Value]" = betterproto2.field( + 1, betterproto2.TYPE_MAP, map_types=(betterproto2.TYPE_STRING, betterproto2.TYPE_MESSAGE) ) - """Represents a null value.""" - - number_value: float = betterproto2.double_field(2, group="kind") - """Represents a double value.""" - - string_value: str = betterproto2.string_field(3, group="kind") - """Represents a string value.""" - - bool_value: bool = betterproto2.bool_field(4, group="kind") - """Represents a boolean value.""" - - struct_value: "Struct" = betterproto2.message_field(5, group="kind") - """Represents a structured value.""" - - list_value: "ListValue" = betterproto2.message_field(6, group="kind") - """Represents a repeated `Value`.""" - - -@dataclass(eq=False, repr=False) -class ListValue(betterproto2.Message): """ - `ListValue` is a wrapper around a repeated field of values. - - The JSON representation for `ListValue` is JSON array. + Unordered map of dynamically typed values. """ - values: List["Value"] = betterproto2.message_field(1, repeated=True) - """Repeated field of dynamically typed values.""" - @dataclass(eq=False, repr=False) class Timestamp(betterproto2.Message): @@ -2394,16 +2308,16 @@ class Timestamp(betterproto2.Message): the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D ) to obtain a formatter capable of generating timestamps in this format. + """ - seconds: int = betterproto2.int64_field(1) + seconds: "int" = betterproto2.field(1, betterproto2.TYPE_INT64) """ Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. """ - - nanos: int = betterproto2.int32_field(2) + nanos: "int" = betterproto2.field(2, betterproto2.TYPE_INT32) """ Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values @@ -2413,39 +2327,51 @@ class Timestamp(betterproto2.Message): @dataclass(eq=False, repr=False) -class DoubleValue(betterproto2.Message): +class Type(betterproto2.Message): """ - Wrapper message for `double`. + A protocol buffer message type. - The JSON representation for `DoubleValue` is JSON number. """ - value: float = betterproto2.double_field(1) - """The double value.""" - - -@dataclass(eq=False, repr=False) -class FloatValue(betterproto2.Message): + name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) """ - Wrapper message for `float`. - - The JSON representation for `FloatValue` is JSON number. + The fully qualified message name. + """ + fields: "List[Field]" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, repeated=True) + """ + The list of fields. + """ + oneofs: "List[str]" = betterproto2.field(3, betterproto2.TYPE_STRING, repeated=True) + """ + The list of types appearing in `oneof` definitions in this type. + """ + options: "List[Option]" = betterproto2.field(4, betterproto2.TYPE_MESSAGE, repeated=True) + """ + The protocol buffer options. + """ + source_context: "Optional[SourceContext]" = betterproto2.field(5, betterproto2.TYPE_MESSAGE, optional=True) + """ + The source context. + """ + syntax: "Syntax" = betterproto2.field(6, betterproto2.TYPE_ENUM, default_factory=lambda: Syntax.try_value(0)) + """ + The source syntax. """ - - value: float = betterproto2.float_field(1) - """The float value.""" @dataclass(eq=False, repr=False) -class Int64Value(betterproto2.Message): +class UInt32Value(betterproto2.Message): """ - Wrapper message for `int64`. + Wrapper message for `uint32`. + + The JSON representation for `UInt32Value` is JSON number. - The JSON representation for `Int64Value` is JSON string. """ - value: int = betterproto2.int64_field(1) - """The int64 value.""" + value: "int" = betterproto2.field(1, betterproto2.TYPE_UINT32) + """ + The uint32 value. + """ @dataclass(eq=False, repr=False) @@ -2454,67 +2380,92 @@ class UInt64Value(betterproto2.Message): Wrapper message for `uint64`. The JSON representation for `UInt64Value` is JSON string. - """ - value: int = betterproto2.uint64_field(1) - """The uint64 value.""" - - -@dataclass(eq=False, repr=False) -class Int32Value(betterproto2.Message): """ - Wrapper message for `int32`. - The JSON representation for `Int32Value` is JSON number. + value: "int" = betterproto2.field(1, betterproto2.TYPE_UINT64) + """ + The uint64 value. """ - - value: int = betterproto2.int32_field(1) - """The int32 value.""" @dataclass(eq=False, repr=False) -class UInt32Value(betterproto2.Message): +class UninterpretedOption(betterproto2.Message): """ - Wrapper message for `uint32`. + A message representing a option the parser does not recognize. This only + appears in options protos created by the compiler::Parser class. + DescriptorPool resolves these when building Descriptor objects. Therefore, + options protos in descriptor objects (e.g. returned by Descriptor::options(), + or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + in them. - The JSON representation for `UInt32Value` is JSON number. """ - value: int = betterproto2.uint32_field(1) - """The uint32 value.""" - - -@dataclass(eq=False, repr=False) -class BoolValue(betterproto2.Message): + name: "List[UninterpretedOptionNamePart]" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, repeated=True) + identifier_value: "str" = betterproto2.field(3, betterproto2.TYPE_STRING) """ - Wrapper message for `bool`. - - The JSON representation for `BoolValue` is JSON `true` and `false`. + The value of the uninterpreted option, in whatever type the tokenizer + identified it as during parsing. Exactly one of these should be set. """ - - value: bool = betterproto2.bool_field(1) - """The bool value.""" + positive_int_value: "int" = betterproto2.field(4, betterproto2.TYPE_UINT64) + negative_int_value: "int" = betterproto2.field(5, betterproto2.TYPE_INT64) + double_value: "float" = betterproto2.field(6, betterproto2.TYPE_DOUBLE) + string_value: "bytes" = betterproto2.field(7, betterproto2.TYPE_BYTES) + aggregate_value: "str" = betterproto2.field(8, betterproto2.TYPE_STRING) @dataclass(eq=False, repr=False) -class StringValue(betterproto2.Message): +class UninterpretedOptionNamePart(betterproto2.Message): """ - Wrapper message for `string`. + The name of the uninterpreted option. Each string represents a segment in + a dot-separated name. is_extension is true iff a segment represents an + extension (denoted with parentheses in options specs in .proto files). + E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + "foo.(bar.baz).qux". - The JSON representation for `StringValue` is JSON string. """ - value: str = betterproto2.string_field(1) - """The string value.""" + name_part: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) + is_extension: "bool" = betterproto2.field(2, betterproto2.TYPE_BOOL) @dataclass(eq=False, repr=False) -class BytesValue(betterproto2.Message): +class Value(betterproto2.Message): """ - Wrapper message for `bytes`. + `Value` represents a dynamically typed value which can be either + null, a number, a string, a boolean, a recursive struct value, or a + list of values. A producer of value is expected to set one of that + variants, absence of any variant indicates an error. - The JSON representation for `BytesValue` is JSON string. + The JSON representation for `Value` is JSON value. + + Oneofs: + - kind: The kind of value. """ - value: bytes = betterproto2.bytes_field(1) - """The bytes value.""" + null_value: "Optional[NullValue]" = betterproto2.field( + 1, betterproto2.TYPE_ENUM, optional=True, default_factory=lambda: NullValue.try_value(0), group="kind" + ) + """ + Represents a null value. + """ + number_value: "Optional[float]" = betterproto2.field(2, betterproto2.TYPE_DOUBLE, optional=True, group="kind") + """ + Represents a double value. + """ + string_value: "Optional[str]" = betterproto2.field(3, betterproto2.TYPE_STRING, optional=True, group="kind") + """ + Represents a string value. + """ + bool_value: "Optional[bool]" = betterproto2.field(4, betterproto2.TYPE_BOOL, optional=True, group="kind") + """ + Represents a boolean value. + """ + struct_value: "Optional[Struct]" = betterproto2.field(5, betterproto2.TYPE_MESSAGE, optional=True, group="kind") + """ + Represents a structured value. + """ + list_value: "Optional[ListValue]" = betterproto2.field(6, betterproto2.TYPE_MESSAGE, optional=True, group="kind") + """ + Represents a repeated `Value`. + """ From f3bb419fab1910a6df8b0e725b1539fd4948555e Mon Sep 17 00:00:00 2001 From: Adrien Vannson Date: Mon, 6 Jan 2025 11:42:24 +0100 Subject: [PATCH 02/10] Update compiler file --- poetry.lock | 463 +++++++++--------- pyproject.toml | 14 +- .../lib/google/protobuf/compiler/__init__.py | 304 +++++++----- 3 files changed, 403 insertions(+), 378 deletions(-) diff --git a/poetry.lock b/poetry.lock index 42252b68..0388a599 100644 --- a/poetry.lock +++ b/poetry.lock @@ -87,127 +87,114 @@ files = [ [[package]] name = "charset-normalizer" -version = "3.4.0" +version = "3.4.1" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false -python-versions = ">=3.7.0" -files = [ - {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:4f9fc98dad6c2eaa32fc3af1417d95b5e3d08aff968df0cd320066def971f9a6"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0de7b687289d3c1b3e8660d0741874abe7888100efe14bd0f9fd7141bcbda92b"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5ed2e36c3e9b4f21dd9422f6893dec0abf2cca553af509b10cd630f878d3eb99"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40d3ff7fc90b98c637bda91c89d51264a3dcf210cade3a2c6f838c7268d7a4ca"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1110e22af8ca26b90bd6364fe4c763329b0ebf1ee213ba32b68c73de5752323d"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:86f4e8cca779080f66ff4f191a685ced73d2f72d50216f7112185dc02b90b9b7"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f683ddc7eedd742e2889d2bfb96d69573fde1d92fcb811979cdb7165bb9c7d3"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:27623ba66c183eca01bf9ff833875b459cad267aeeb044477fedac35e19ba907"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f606a1881d2663630ea5b8ce2efe2111740df4b687bd78b34a8131baa007f79b"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:0b309d1747110feb25d7ed6b01afdec269c647d382c857ef4663bbe6ad95a912"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:136815f06a3ae311fae551c3df1f998a1ebd01ddd424aa5603a4336997629e95"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:14215b71a762336254351b00ec720a8e85cada43b987da5a042e4ce3e82bd68e"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:79983512b108e4a164b9c8d34de3992f76d48cadc9554c9e60b43f308988aabe"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-win32.whl", hash = "sha256:c94057af19bc953643a33581844649a7fdab902624d2eb739738a30e2b3e60fc"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:55f56e2ebd4e3bc50442fbc0888c9d8c94e4e06a933804e2af3e89e2f9c1c749"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0d99dd8ff461990f12d6e42c7347fd9ab2532fb70e9621ba520f9e8637161d7c"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c57516e58fd17d03ebe67e181a4e4e2ccab1168f8c2976c6a334d4f819fe5944"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6dba5d19c4dfab08e58d5b36304b3f92f3bd5d42c1a3fa37b5ba5cdf6dfcbcee"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf4475b82be41b07cc5e5ff94810e6a01f276e37c2d55571e3fe175e467a1a1c"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce031db0408e487fd2775d745ce30a7cd2923667cf3b69d48d219f1d8f5ddeb6"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ff4e7cdfdb1ab5698e675ca622e72d58a6fa2a8aa58195de0c0061288e6e3ea"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3710a9751938947e6327ea9f3ea6332a09bf0ba0c09cae9cb1f250bd1f1549bc"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82357d85de703176b5587dbe6ade8ff67f9f69a41c0733cf2425378b49954de5"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:47334db71978b23ebcf3c0f9f5ee98b8d65992b65c9c4f2d34c2eaf5bcaf0594"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8ce7fd6767a1cc5a92a639b391891bf1c268b03ec7e021c7d6d902285259685c"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:f1a2f519ae173b5b6a2c9d5fa3116ce16e48b3462c8b96dfdded11055e3d6365"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:63bc5c4ae26e4bc6be6469943b8253c0fd4e4186c43ad46e713ea61a0ba49129"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:bcb4f8ea87d03bc51ad04add8ceaf9b0f085ac045ab4d74e73bbc2dc033f0236"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-win32.whl", hash = "sha256:9ae4ef0b3f6b41bad6366fb0ea4fc1d7ed051528e113a60fa2a65a9abb5b1d99"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:cee4373f4d3ad28f1ab6290684d8e2ebdb9e7a1b74fdc39e4c211995f77bec27"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0713f3adb9d03d49d365b70b84775d0a0d18e4ab08d12bc46baa6132ba78aaf6"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:de7376c29d95d6719048c194a9cf1a1b0393fbe8488a22008610b0361d834ecf"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4a51b48f42d9358460b78725283f04bddaf44a9358197b889657deba38f329db"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b295729485b06c1a0683af02a9e42d2caa9db04a373dc38a6a58cdd1e8abddf1"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ee803480535c44e7f5ad00788526da7d85525cfefaf8acf8ab9a310000be4b03"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3d59d125ffbd6d552765510e3f31ed75ebac2c7470c7274195b9161a32350284"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8cda06946eac330cbe6598f77bb54e690b4ca93f593dee1568ad22b04f347c15"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:07afec21bbbbf8a5cc3651aa96b980afe2526e7f048fdfb7f1014d84acc8b6d8"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6b40e8d38afe634559e398cc32b1472f376a4099c75fe6299ae607e404c033b2"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:b8dcd239c743aa2f9c22ce674a145e0a25cb1566c495928440a181ca1ccf6719"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:84450ba661fb96e9fd67629b93d2941c871ca86fc38d835d19d4225ff946a631"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:44aeb140295a2f0659e113b31cfe92c9061622cadbc9e2a2f7b8ef6b1e29ef4b"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1db4e7fefefd0f548d73e2e2e041f9df5c59e178b4c72fbac4cc6f535cfb1565"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-win32.whl", hash = "sha256:5726cf76c982532c1863fb64d8c6dd0e4c90b6ece9feb06c9f202417a31f7dd7"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:b197e7094f232959f8f20541ead1d9862ac5ebea1d58e9849c1bf979255dfac9"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:dd4eda173a9fcccb5f2e2bd2a9f423d180194b1bf17cf59e3269899235b2a114"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e9e3c4c9e1ed40ea53acf11e2a386383c3304212c965773704e4603d589343ed"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:92a7e36b000bf022ef3dbb9c46bfe2d52c047d5e3f3343f43204263c5addc250"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54b6a92d009cbe2fb11054ba694bc9e284dad30a26757b1e372a1fdddaf21920"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ffd9493de4c922f2a38c2bf62b831dcec90ac673ed1ca182fe11b4d8e9f2a64"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:35c404d74c2926d0287fbd63ed5d27eb911eb9e4a3bb2c6d294f3cfd4a9e0c23"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4796efc4faf6b53a18e3d46343535caed491776a22af773f366534056c4e1fbc"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e7fdd52961feb4c96507aa649550ec2a0d527c086d284749b2f582f2d40a2e0d"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:92db3c28b5b2a273346bebb24857fda45601aef6ae1c011c0a997106581e8a88"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ab973df98fc99ab39080bfb0eb3a925181454d7c3ac8a1e695fddfae696d9e90"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4b67fdab07fdd3c10bb21edab3cbfe8cf5696f453afce75d815d9d7223fbe88b"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:aa41e526a5d4a9dfcfbab0716c7e8a1b215abd3f3df5a45cf18a12721d31cb5d"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ffc519621dce0c767e96b9c53f09c5d215578e10b02c285809f76509a3931482"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-win32.whl", hash = "sha256:f19c1585933c82098c2a520f8ec1227f20e339e33aca8fa6f956f6691b784e67"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:707b82d19e65c9bd28b81dde95249b07bf9f5b90ebe1ef17d9b57473f8a64b7b"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:dbe03226baf438ac4fda9e2d0715022fd579cb641c4cf639fa40d53b2fe6f3e2"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dd9a8bd8900e65504a305bf8ae6fa9fbc66de94178c420791d0293702fce2df7"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b8831399554b92b72af5932cdbbd4ddc55c55f631bb13ff8fe4e6536a06c5c51"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a14969b8691f7998e74663b77b4c36c0337cb1df552da83d5c9004a93afdb574"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcaf7c1524c0542ee2fc82cc8ec337f7a9f7edee2532421ab200d2b920fc97cf"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:425c5f215d0eecee9a56cdb703203dda90423247421bf0d67125add85d0c4455"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:d5b054862739d276e09928de37c79ddeec42a6e1bfc55863be96a36ba22926f6"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:f3e73a4255342d4eb26ef6df01e3962e73aa29baa3124a8e824c5d3364a65748"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:2f6c34da58ea9c1a9515621f4d9ac379871a8f21168ba1b5e09d74250de5ad62"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:f09cb5a7bbe1ecae6e87901a2eb23e0256bb524a79ccc53eb0b7629fbe7677c4"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:0099d79bdfcf5c1f0c2c72f91516702ebf8b0b8ddd8905f97a8aecf49712c621"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-win32.whl", hash = "sha256:9c98230f5042f4945f957d006edccc2af1e03ed5e37ce7c373f00a5a4daa6149"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-win_amd64.whl", hash = "sha256:62f60aebecfc7f4b82e3f639a7d1433a20ec32824db2199a11ad4f5e146ef5ee"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:af73657b7a68211996527dbfeffbb0864e043d270580c5aef06dc4b659a4b578"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cab5d0b79d987c67f3b9e9c53f54a61360422a5a0bc075f43cab5621d530c3b6"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:9289fd5dddcf57bab41d044f1756550f9e7cf0c8e373b8cdf0ce8773dc4bd417"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b493a043635eb376e50eedf7818f2f322eabbaa974e948bd8bdd29eb7ef2a51"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9fa2566ca27d67c86569e8c85297aaf413ffab85a8960500f12ea34ff98e4c41"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8e538f46104c815be19c975572d74afb53f29650ea2025bbfaef359d2de2f7f"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fd30dc99682dc2c603c2b315bded2799019cea829f8bf57dc6b61efde6611c8"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2006769bd1640bdf4d5641c69a3d63b71b81445473cac5ded39740a226fa88ab"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:dc15e99b2d8a656f8e666854404f1ba54765871104e50c8e9813af8a7db07f12"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:ab2e5bef076f5a235c3774b4f4028a680432cded7cad37bba0fd90d64b187d19"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:4ec9dd88a5b71abfc74e9df5ebe7921c35cbb3b641181a531ca65cdb5e8e4dea"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:43193c5cda5d612f247172016c4bb71251c784d7a4d9314677186a838ad34858"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:aa693779a8b50cd97570e5a0f343538a8dbd3e496fa5dcb87e29406ad0299654"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-win32.whl", hash = "sha256:7706f5850360ac01d80c89bcef1640683cc12ed87f42579dab6c5d3ed6888613"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:c3e446d253bd88f6377260d07c895816ebf33ffffd56c1c792b13bff9c3e1ade"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:980b4f289d1d90ca5efcf07958d3eb38ed9c0b7676bf2831a54d4f66f9c27dfa"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f28f891ccd15c514a0981f3b9db9aa23d62fe1a99997512b0491d2ed323d229a"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8aacce6e2e1edcb6ac625fb0f8c3a9570ccc7bfba1f63419b3769ccf6a00ed0"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd7af3717683bea4c87acd8c0d3d5b44d56120b26fd3f8a692bdd2d5260c620a"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5ff2ed8194587faf56555927b3aa10e6fb69d931e33953943bc4f837dfee2242"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e91f541a85298cf35433bf66f3fab2a4a2cff05c127eeca4af174f6d497f0d4b"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:309a7de0a0ff3040acaebb35ec45d18db4b28232f21998851cfa709eeff49d62"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:285e96d9d53422efc0d7a17c60e59f37fbf3dfa942073f666db4ac71e8d726d0"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:5d447056e2ca60382d460a604b6302d8db69476fd2015c81e7c35417cfabe4cd"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:20587d20f557fe189b7947d8e7ec5afa110ccf72a3128d61a2a387c3313f46be"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:130272c698667a982a5d0e626851ceff662565379baf0ff2cc58067b81d4f11d"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:ab22fbd9765e6954bc0bcff24c25ff71dcbfdb185fcdaca49e81bac68fe724d3"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:7782afc9b6b42200f7362858f9e73b1f8316afb276d316336c0ec3bd73312742"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-win32.whl", hash = "sha256:2de62e8801ddfff069cd5c504ce3bc9672b23266597d4e4f50eda28846c322f2"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-win_amd64.whl", hash = "sha256:95c3c157765b031331dd4db3c775e58deaee050a3042fcad72cbc4189d7c8dca"}, - {file = "charset_normalizer-3.4.0-py3-none-any.whl", hash = "sha256:fe9f97feb71aa9896b81973a7bbada8c49501dc73e58a10fcef6663af95e5079"}, - {file = "charset_normalizer-3.4.0.tar.gz", hash = "sha256:223217c3d4f82c3ac5e29032b3f1c2eb0fb591b72161f86d93f5719079dae93e"}, +python-versions = ">=3.7" +files = [ + {file = "charset_normalizer-3.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:91b36a978b5ae0ee86c394f5a54d6ef44db1de0815eb43de826d41d21e4af3de"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7461baadb4dc00fd9e0acbe254e3d7d2112e7f92ced2adc96e54ef6501c5f176"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e218488cd232553829be0664c2292d3af2eeeb94b32bea483cf79ac6a694e037"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80ed5e856eb7f30115aaf94e4a08114ccc8813e6ed1b5efa74f9f82e8509858f"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b010a7a4fd316c3c484d482922d13044979e78d1861f0e0650423144c616a46a"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4532bff1b8421fd0a320463030c7520f56a79c9024a4e88f01c537316019005a"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d973f03c0cb71c5ed99037b870f2be986c3c05e63622c017ea9816881d2dd247"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3a3bd0dcd373514dcec91c411ddb9632c0d7d92aed7093b8c3bbb6d69ca74408"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:d9c3cdf5390dcd29aa8056d13e8e99526cda0305acc038b96b30352aff5ff2bb"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:2bdfe3ac2e1bbe5b59a1a63721eb3b95fc9b6817ae4a46debbb4e11f6232428d"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:eab677309cdb30d047996b36d34caeda1dc91149e4fdca0b1a039b3f79d9a807"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-win32.whl", hash = "sha256:c0429126cf75e16c4f0ad00ee0eae4242dc652290f940152ca8c75c3a4b6ee8f"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:9f0b8b1c6d84c8034a44893aba5e767bf9c7a211e313a9605d9c617d7083829f"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8bfa33f4f2672964266e940dd22a195989ba31669bd84629f05fab3ef4e2d125"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:28bf57629c75e810b6ae989f03c0828d64d6b26a5e205535585f96093e405ed1"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f08ff5e948271dc7e18a35641d2f11a4cd8dfd5634f55228b691e62b37125eb3"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:234ac59ea147c59ee4da87a0c0f098e9c8d169f4dc2a159ef720f1a61bbe27cd"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd4ec41f914fa74ad1b8304bbc634b3de73d2a0889bd32076342a573e0779e00"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eea6ee1db730b3483adf394ea72f808b6e18cf3cb6454b4d86e04fa8c4327a12"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c96836c97b1238e9c9e3fe90844c947d5afbf4f4c92762679acfe19927d81d77"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4d86f7aff21ee58f26dcf5ae81a9addbd914115cdebcbb2217e4f0ed8982e146"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:09b5e6733cbd160dcc09589227187e242a30a49ca5cefa5a7edd3f9d19ed53fd"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:5777ee0881f9499ed0f71cc82cf873d9a0ca8af166dfa0af8ec4e675b7df48e6"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:237bdbe6159cff53b4f24f397d43c6336c6b0b42affbe857970cefbb620911c8"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-win32.whl", hash = "sha256:8417cb1f36cc0bc7eaba8ccb0e04d55f0ee52df06df3ad55259b9a323555fc8b"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:d7f50a1f8c450f3925cb367d011448c39239bb3eb4117c36a6d354794de4ce76"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:73d94b58ec7fecbc7366247d3b0b10a21681004153238750bb67bd9012414545"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dad3e487649f498dd991eeb901125411559b22e8d7ab25d3aeb1af367df5efd7"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c30197aa96e8eed02200a83fba2657b4c3acd0f0aa4bdc9f6c1af8e8962e0757"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2369eea1ee4a7610a860d88f268eb39b95cb588acd7235e02fd5a5601773d4fa"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc2722592d8998c870fa4e290c2eec2c1569b87fe58618e67d38b4665dfa680d"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffc9202a29ab3920fa812879e95a9e78b2465fd10be7fcbd042899695d75e616"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:804a4d582ba6e5b747c625bf1255e6b1507465494a40a2130978bda7b932c90b"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:0f55e69f030f7163dffe9fd0752b32f070566451afe180f99dbeeb81f511ad8d"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c4c3e6da02df6fa1410a7680bd3f63d4f710232d3139089536310d027950696a"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:5df196eb874dae23dcfb968c83d4f8fdccb333330fe1fc278ac5ceeb101003a9"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e358e64305fe12299a08e08978f51fc21fac060dcfcddd95453eabe5b93ed0e1"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-win32.whl", hash = "sha256:9b23ca7ef998bc739bf6ffc077c2116917eabcc901f88da1b9856b210ef63f35"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:6ff8a4a60c227ad87030d76e99cd1698345d4491638dfa6673027c48b3cd395f"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:aabfa34badd18f1da5ec1bc2715cadc8dca465868a4e73a0173466b688f29dda"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22e14b5d70560b8dd51ec22863f370d1e595ac3d024cb8ad7d308b4cd95f8313"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8436c508b408b82d87dc5f62496973a1805cd46727c34440b0d29d8a2f50a6c9"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2d074908e1aecee37a7635990b2c6d504cd4766c7bc9fc86d63f9c09af3fa11b"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:955f8851919303c92343d2f66165294848d57e9bba6cf6e3625485a70a038d11"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:44ecbf16649486d4aebafeaa7ec4c9fed8b88101f4dd612dcaf65d5e815f837f"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0924e81d3d5e70f8126529951dac65c1010cdf117bb75eb02dd12339b57749dd"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:2967f74ad52c3b98de4c3b32e1a44e32975e008a9cd2a8cc8966d6a5218c5cb2"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:c75cb2a3e389853835e84a2d8fb2b81a10645b503eca9bcb98df6b5a43eb8886"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:09b26ae6b1abf0d27570633b2b078a2a20419c99d66fb2823173d73f188ce601"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:fa88b843d6e211393a37219e6a1c1df99d35e8fd90446f1118f4216e307e48cd"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-win32.whl", hash = "sha256:eb8178fe3dba6450a3e024e95ac49ed3400e506fd4e9e5c32d30adda88cbd407"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:b1ac5992a838106edb89654e0aebfc24f5848ae2547d22c2c3f66454daa11971"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f30bf9fd9be89ecb2360c7d94a711f00c09b976258846efe40db3d05828e8089"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:97f68b8d6831127e4787ad15e6757232e14e12060bec17091b85eb1486b91d8d"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7974a0b5ecd505609e3b19742b60cee7aa2aa2fb3151bc917e6e2646d7667dcf"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc54db6c8593ef7d4b2a331b58653356cf04f67c960f584edb7c3d8c97e8f39e"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:311f30128d7d333eebd7896965bfcfbd0065f1716ec92bd5638d7748eb6f936a"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:7d053096f67cd1241601111b698f5cad775f97ab25d81567d3f59219b5f1adbd"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:807f52c1f798eef6cf26beb819eeb8819b1622ddfeef9d0977a8502d4db6d534"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:dccbe65bd2f7f7ec22c4ff99ed56faa1e9f785482b9bbd7c717e26fd723a1d1e"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:2fb9bd477fdea8684f78791a6de97a953c51831ee2981f8e4f583ff3b9d9687e"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:01732659ba9b5b873fc117534143e4feefecf3b2078b0a6a2e925271bb6f4cfa"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-win32.whl", hash = "sha256:7a4f97a081603d2050bfaffdefa5b02a9ec823f8348a572e39032caa8404a487"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:7b1bef6280950ee6c177b326508f86cad7ad4dff12454483b51d8b7d673a2c5d"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:ecddf25bee22fe4fe3737a399d0d177d72bc22be6913acfab364b40bce1ba83c"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c60ca7339acd497a55b0ea5d506b2a2612afb2826560416f6894e8b5770d4a9"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b7b2d86dd06bfc2ade3312a83a5c364c7ec2e3498f8734282c6c3d4b07b346b8"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dd78cfcda14a1ef52584dbb008f7ac81c1328c0f58184bf9a84c49c605002da6"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e27f48bcd0957c6d4cb9d6fa6b61d192d0b13d5ef563e5f2ae35feafc0d179c"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:01ad647cdd609225c5350561d084b42ddf732f4eeefe6e678765636791e78b9a"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:619a609aa74ae43d90ed2e89bdd784765de0a25ca761b93e196d938b8fd1dbbd"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:89149166622f4db9b4b6a449256291dc87a99ee53151c74cbd82a53c8c2f6ccd"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:7709f51f5f7c853f0fb938bcd3bc59cdfdc5203635ffd18bf354f6967ea0f824"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:345b0426edd4e18138d6528aed636de7a9ed169b4aaf9d61a8c19e39d26838ca"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:0907f11d019260cdc3f94fbdb23ff9125f6b5d1039b76003b5b0ac9d6a6c9d5b"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-win32.whl", hash = "sha256:ea0d8d539afa5eb2728aa1932a988a9a7af94f18582ffae4bc10b3fbdad0626e"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:329ce159e82018d646c7ac45b01a430369d526569ec08516081727a20e9e4af4"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b97e690a2118911e39b4042088092771b4ae3fc3aa86518f84b8cf6888dbdb41"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:78baa6d91634dfb69ec52a463534bc0df05dbd546209b79a3880a34487f4b84f"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1a2bc9f351a75ef49d664206d51f8e5ede9da246602dc2d2726837620ea034b2"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:75832c08354f595c760a804588b9357d34ec00ba1c940c15e31e96d902093770"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0af291f4fe114be0280cdd29d533696a77b5b49cfde5467176ecab32353395c4"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0167ddc8ab6508fe81860a57dd472b2ef4060e8d378f0cc555707126830f2537"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2a75d49014d118e4198bcee5ee0a6f25856b29b12dbf7cd012791f8a6cc5c496"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:363e2f92b0f0174b2f8238240a1a30142e3db7b957a5dd5689b0e75fb717cc78"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:ab36c8eb7e454e34e60eb55ca5d241a5d18b2c6244f6827a30e451c42410b5f7"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:4c0907b1928a36d5a998d72d64d8eaa7244989f7aaaf947500d3a800c83a3fd6"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:04432ad9479fa40ec0f387795ddad4437a2b50417c69fa275e212933519ff294"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-win32.whl", hash = "sha256:3bed14e9c89dcb10e8f3a29f9ccac4955aebe93c71ae803af79265c9ca5644c5"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:49402233c892a461407c512a19435d1ce275543138294f7ef013f0b63d5d3765"}, + {file = "charset_normalizer-3.4.1-py3-none-any.whl", hash = "sha256:d98b1668f06378c6dbefec3b92299716b931cd4e6061f3c875a71ced1780ab85"}, + {file = "charset_normalizer-3.4.1.tar.gz", hash = "sha256:44251f18cd68a75b56585dd00dae26183e102cd5e0f9f1466e6df5da2ed64ea3"}, ] [[package]] name = "click" -version = "8.1.7" +version = "8.1.8" description = "Composable command line interface toolkit" optional = false python-versions = ">=3.7" files = [ - {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, - {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, + {file = "click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2"}, + {file = "click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a"}, ] [package.dependencies] @@ -270,13 +257,13 @@ dev = ["flake8", "markdown", "twine", "wheel"] [[package]] name = "griffe" -version = "1.5.1" +version = "1.5.4" description = "Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API." optional = false python-versions = ">=3.9" files = [ - {file = "griffe-1.5.1-py3-none-any.whl", hash = "sha256:ad6a7980f8c424c9102160aafa3bcdf799df0e75f7829d75af9ee5aef656f860"}, - {file = "griffe-1.5.1.tar.gz", hash = "sha256:72964f93e08c553257706d6cd2c42d1c172213feb48b2be386f243380b405d4b"}, + {file = "griffe-1.5.4-py3-none-any.whl", hash = "sha256:ed33af890586a5bebc842fcb919fc694b3dc1bc55b7d9e0228de41ce566b4a1d"}, + {file = "griffe-1.5.4.tar.gz", hash = "sha256:073e78ad3e10c8378c2f798bd4ef87b92d8411e9916e157fd366a17cc4fd4e52"}, ] [package.dependencies] @@ -284,70 +271,70 @@ colorama = ">=0.4" [[package]] name = "grpcio" -version = "1.68.1" +version = "1.69.0" description = "HTTP/2-based RPC framework" optional = false python-versions = ">=3.8" files = [ - {file = "grpcio-1.68.1-cp310-cp310-linux_armv7l.whl", hash = "sha256:d35740e3f45f60f3c37b1e6f2f4702c23867b9ce21c6410254c9c682237da68d"}, - {file = "grpcio-1.68.1-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:d99abcd61760ebb34bdff37e5a3ba333c5cc09feda8c1ad42547bea0416ada78"}, - {file = "grpcio-1.68.1-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:f8261fa2a5f679abeb2a0a93ad056d765cdca1c47745eda3f2d87f874ff4b8c9"}, - {file = "grpcio-1.68.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0feb02205a27caca128627bd1df4ee7212db051019a9afa76f4bb6a1a80ca95e"}, - {file = "grpcio-1.68.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:919d7f18f63bcad3a0f81146188e90274fde800a94e35d42ffe9eadf6a9a6330"}, - {file = "grpcio-1.68.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:963cc8d7d79b12c56008aabd8b457f400952dbea8997dd185f155e2f228db079"}, - {file = "grpcio-1.68.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ccf2ebd2de2d6661e2520dae293298a3803a98ebfc099275f113ce1f6c2a80f1"}, - {file = "grpcio-1.68.1-cp310-cp310-win32.whl", hash = "sha256:2cc1fd04af8399971bcd4f43bd98c22d01029ea2e56e69c34daf2bf8470e47f5"}, - {file = "grpcio-1.68.1-cp310-cp310-win_amd64.whl", hash = "sha256:ee2e743e51cb964b4975de572aa8fb95b633f496f9fcb5e257893df3be854746"}, - {file = "grpcio-1.68.1-cp311-cp311-linux_armv7l.whl", hash = "sha256:55857c71641064f01ff0541a1776bfe04a59db5558e82897d35a7793e525774c"}, - {file = "grpcio-1.68.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:4b177f5547f1b995826ef529d2eef89cca2f830dd8b2c99ffd5fde4da734ba73"}, - {file = "grpcio-1.68.1-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:3522c77d7e6606d6665ec8d50e867f13f946a4e00c7df46768f1c85089eae515"}, - {file = "grpcio-1.68.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9d1fae6bbf0816415b81db1e82fb3bf56f7857273c84dcbe68cbe046e58e1ccd"}, - {file = "grpcio-1.68.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:298ee7f80e26f9483f0b6f94cc0a046caf54400a11b644713bb5b3d8eb387600"}, - {file = "grpcio-1.68.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:cbb5780e2e740b6b4f2d208e90453591036ff80c02cc605fea1af8e6fc6b1bbe"}, - {file = "grpcio-1.68.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:ddda1aa22495d8acd9dfbafff2866438d12faec4d024ebc2e656784d96328ad0"}, - {file = "grpcio-1.68.1-cp311-cp311-win32.whl", hash = "sha256:b33bd114fa5a83f03ec6b7b262ef9f5cac549d4126f1dc702078767b10c46ed9"}, - {file = "grpcio-1.68.1-cp311-cp311-win_amd64.whl", hash = "sha256:7f20ebec257af55694d8f993e162ddf0d36bd82d4e57f74b31c67b3c6d63d8b2"}, - {file = "grpcio-1.68.1-cp312-cp312-linux_armv7l.whl", hash = "sha256:8829924fffb25386995a31998ccbbeaa7367223e647e0122043dfc485a87c666"}, - {file = "grpcio-1.68.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:3aed6544e4d523cd6b3119b0916cef3d15ef2da51e088211e4d1eb91a6c7f4f1"}, - {file = "grpcio-1.68.1-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:4efac5481c696d5cb124ff1c119a78bddbfdd13fc499e3bc0ca81e95fc573684"}, - {file = "grpcio-1.68.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ab2d912ca39c51f46baf2a0d92aa265aa96b2443266fc50d234fa88bf877d8e"}, - {file = "grpcio-1.68.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95c87ce2a97434dffe7327a4071839ab8e8bffd0054cc74cbe971fba98aedd60"}, - {file = "grpcio-1.68.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:e4842e4872ae4ae0f5497bf60a0498fa778c192cc7a9e87877abd2814aca9475"}, - {file = "grpcio-1.68.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:255b1635b0ed81e9f91da4fcc8d43b7ea5520090b9a9ad9340d147066d1d3613"}, - {file = "grpcio-1.68.1-cp312-cp312-win32.whl", hash = "sha256:7dfc914cc31c906297b30463dde0b9be48e36939575eaf2a0a22a8096e69afe5"}, - {file = "grpcio-1.68.1-cp312-cp312-win_amd64.whl", hash = "sha256:a0c8ddabef9c8f41617f213e527254c41e8b96ea9d387c632af878d05db9229c"}, - {file = "grpcio-1.68.1-cp313-cp313-linux_armv7l.whl", hash = "sha256:a47faedc9ea2e7a3b6569795c040aae5895a19dde0c728a48d3c5d7995fda385"}, - {file = "grpcio-1.68.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:390eee4225a661c5cd133c09f5da1ee3c84498dc265fd292a6912b65c421c78c"}, - {file = "grpcio-1.68.1-cp313-cp313-manylinux_2_17_aarch64.whl", hash = "sha256:66a24f3d45c33550703f0abb8b656515b0ab777970fa275693a2f6dc8e35f1c1"}, - {file = "grpcio-1.68.1-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c08079b4934b0bf0a8847f42c197b1d12cba6495a3d43febd7e99ecd1cdc8d54"}, - {file = "grpcio-1.68.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8720c25cd9ac25dd04ee02b69256d0ce35bf8a0f29e20577427355272230965a"}, - {file = "grpcio-1.68.1-cp313-cp313-musllinux_1_1_i686.whl", hash = "sha256:04cfd68bf4f38f5bb959ee2361a7546916bd9a50f78617a346b3aeb2b42e2161"}, - {file = "grpcio-1.68.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:c28848761a6520c5c6071d2904a18d339a796ebe6b800adc8b3f474c5ce3c3ad"}, - {file = "grpcio-1.68.1-cp313-cp313-win32.whl", hash = "sha256:77d65165fc35cff6e954e7fd4229e05ec76102d4406d4576528d3a3635fc6172"}, - {file = "grpcio-1.68.1-cp313-cp313-win_amd64.whl", hash = "sha256:a8040f85dcb9830d8bbb033ae66d272614cec6faceee88d37a88a9bd1a7a704e"}, - {file = "grpcio-1.68.1-cp38-cp38-linux_armv7l.whl", hash = "sha256:eeb38ff04ab6e5756a2aef6ad8d94e89bb4a51ef96e20f45c44ba190fa0bcaad"}, - {file = "grpcio-1.68.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:8a3869a6661ec8f81d93f4597da50336718bde9eb13267a699ac7e0a1d6d0bea"}, - {file = "grpcio-1.68.1-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:2c4cec6177bf325eb6faa6bd834d2ff6aa8bb3b29012cceb4937b86f8b74323c"}, - {file = "grpcio-1.68.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:12941d533f3cd45d46f202e3667be8ebf6bcb3573629c7ec12c3e211d99cfccf"}, - {file = "grpcio-1.68.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80af6f1e69c5e68a2be529990684abdd31ed6622e988bf18850075c81bb1ad6e"}, - {file = "grpcio-1.68.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:e8dbe3e00771bfe3d04feed8210fc6617006d06d9a2679b74605b9fed3e8362c"}, - {file = "grpcio-1.68.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:83bbf5807dc3ee94ce1de2dfe8a356e1d74101e4b9d7aa8c720cc4818a34aded"}, - {file = "grpcio-1.68.1-cp38-cp38-win32.whl", hash = "sha256:8cb620037a2fd9eeee97b4531880e439ebfcd6d7d78f2e7dcc3726428ab5ef63"}, - {file = "grpcio-1.68.1-cp38-cp38-win_amd64.whl", hash = "sha256:52fbf85aa71263380d330f4fce9f013c0798242e31ede05fcee7fbe40ccfc20d"}, - {file = "grpcio-1.68.1-cp39-cp39-linux_armv7l.whl", hash = "sha256:cb400138e73969eb5e0535d1d06cae6a6f7a15f2cc74add320e2130b8179211a"}, - {file = "grpcio-1.68.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:a1b988b40f2fd9de5c820f3a701a43339d8dcf2cb2f1ca137e2c02671cc83ac1"}, - {file = "grpcio-1.68.1-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:96f473cdacfdd506008a5d7579c9f6a7ff245a9ade92c3c0265eb76cc591914f"}, - {file = "grpcio-1.68.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:37ea3be171f3cf3e7b7e412a98b77685eba9d4fd67421f4a34686a63a65d99f9"}, - {file = "grpcio-1.68.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ceb56c4285754e33bb3c2fa777d055e96e6932351a3082ce3559be47f8024f0"}, - {file = "grpcio-1.68.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:dffd29a2961f3263a16d73945b57cd44a8fd0b235740cb14056f0612329b345e"}, - {file = "grpcio-1.68.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:025f790c056815b3bf53da850dd70ebb849fd755a4b1ac822cb65cd631e37d43"}, - {file = "grpcio-1.68.1-cp39-cp39-win32.whl", hash = "sha256:1098f03dedc3b9810810568060dea4ac0822b4062f537b0f53aa015269be0a76"}, - {file = "grpcio-1.68.1-cp39-cp39-win_amd64.whl", hash = "sha256:334ab917792904245a028f10e803fcd5b6f36a7b2173a820c0b5b076555825e1"}, - {file = "grpcio-1.68.1.tar.gz", hash = "sha256:44a8502dd5de653ae6a73e2de50a401d84184f0331d0ac3daeb044e66d5c5054"}, + {file = "grpcio-1.69.0-cp310-cp310-linux_armv7l.whl", hash = "sha256:2060ca95a8db295ae828d0fc1c7f38fb26ccd5edf9aa51a0f44251f5da332e97"}, + {file = "grpcio-1.69.0-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:2e52e107261fd8fa8fa457fe44bfadb904ae869d87c1280bf60f93ecd3e79278"}, + {file = "grpcio-1.69.0-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:316463c0832d5fcdb5e35ff2826d9aa3f26758d29cdfb59a368c1d6c39615a11"}, + {file = "grpcio-1.69.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:26c9a9c4ac917efab4704b18eed9082ed3b6ad19595f047e8173b5182fec0d5e"}, + {file = "grpcio-1.69.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90b3646ced2eae3a0599658eeccc5ba7f303bf51b82514c50715bdd2b109e5ec"}, + {file = "grpcio-1.69.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:3b75aea7c6cb91b341c85e7c1d9db1e09e1dd630b0717f836be94971e015031e"}, + {file = "grpcio-1.69.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:5cfd14175f9db33d4b74d63de87c64bb0ee29ce475ce3c00c01ad2a3dc2a9e51"}, + {file = "grpcio-1.69.0-cp310-cp310-win32.whl", hash = "sha256:9031069d36cb949205293cf0e243abd5e64d6c93e01b078c37921493a41b72dc"}, + {file = "grpcio-1.69.0-cp310-cp310-win_amd64.whl", hash = "sha256:cc89b6c29f3dccbe12d7a3b3f1b3999db4882ae076c1c1f6df231d55dbd767a5"}, + {file = "grpcio-1.69.0-cp311-cp311-linux_armv7l.whl", hash = "sha256:8de1b192c29b8ce45ee26a700044717bcbbd21c697fa1124d440548964328561"}, + {file = "grpcio-1.69.0-cp311-cp311-macosx_10_14_universal2.whl", hash = "sha256:7e76accf38808f5c5c752b0ab3fd919eb14ff8fafb8db520ad1cc12afff74de6"}, + {file = "grpcio-1.69.0-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:d5658c3c2660417d82db51e168b277e0ff036d0b0f859fa7576c0ffd2aec1442"}, + {file = "grpcio-1.69.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5494d0e52bf77a2f7eb17c6da662886ca0a731e56c1c85b93505bece8dc6cf4c"}, + {file = "grpcio-1.69.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4ed866f9edb574fd9be71bf64c954ce1b88fc93b2a4cbf94af221e9426eb14d6"}, + {file = "grpcio-1.69.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c5ba38aeac7a2fe353615c6b4213d1fbb3a3c34f86b4aaa8be08baaaee8cc56d"}, + {file = "grpcio-1.69.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f79e05f5bbf551c4057c227d1b041ace0e78462ac8128e2ad39ec58a382536d2"}, + {file = "grpcio-1.69.0-cp311-cp311-win32.whl", hash = "sha256:bf1f8be0da3fcdb2c1e9f374f3c2d043d606d69f425cd685110dd6d0d2d61258"}, + {file = "grpcio-1.69.0-cp311-cp311-win_amd64.whl", hash = "sha256:fb9302afc3a0e4ba0b225cd651ef8e478bf0070cf11a529175caecd5ea2474e7"}, + {file = "grpcio-1.69.0-cp312-cp312-linux_armv7l.whl", hash = "sha256:fc18a4de8c33491ad6f70022af5c460b39611e39578a4d84de0fe92f12d5d47b"}, + {file = "grpcio-1.69.0-cp312-cp312-macosx_10_14_universal2.whl", hash = "sha256:0f0270bd9ffbff6961fe1da487bdcd594407ad390cc7960e738725d4807b18c4"}, + {file = "grpcio-1.69.0-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:dc48f99cc05e0698e689b51a05933253c69a8c8559a47f605cff83801b03af0e"}, + {file = "grpcio-1.69.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e925954b18d41aeb5ae250262116d0970893b38232689c4240024e4333ac084"}, + {file = "grpcio-1.69.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87d222569273720366f68a99cb62e6194681eb763ee1d3b1005840678d4884f9"}, + {file = "grpcio-1.69.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:b62b0f41e6e01a3e5082000b612064c87c93a49b05f7602fe1b7aa9fd5171a1d"}, + {file = "grpcio-1.69.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:db6f9fd2578dbe37db4b2994c94a1d9c93552ed77dca80e1657bb8a05b898b55"}, + {file = "grpcio-1.69.0-cp312-cp312-win32.whl", hash = "sha256:b192b81076073ed46f4b4dd612b8897d9a1e39d4eabd822e5da7b38497ed77e1"}, + {file = "grpcio-1.69.0-cp312-cp312-win_amd64.whl", hash = "sha256:1227ff7836f7b3a4ab04e5754f1d001fa52a730685d3dc894ed8bc262cc96c01"}, + {file = "grpcio-1.69.0-cp313-cp313-linux_armv7l.whl", hash = "sha256:a78a06911d4081a24a1761d16215a08e9b6d4d29cdbb7e427e6c7e17b06bcc5d"}, + {file = "grpcio-1.69.0-cp313-cp313-macosx_10_14_universal2.whl", hash = "sha256:dc5a351927d605b2721cbb46158e431dd49ce66ffbacb03e709dc07a491dde35"}, + {file = "grpcio-1.69.0-cp313-cp313-manylinux_2_17_aarch64.whl", hash = "sha256:3629d8a8185f5139869a6a17865d03113a260e311e78fbe313f1a71603617589"}, + {file = "grpcio-1.69.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c9a281878feeb9ae26db0622a19add03922a028d4db684658f16d546601a4870"}, + {file = "grpcio-1.69.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8cc614e895177ab7e4b70f154d1a7c97e152577ea101d76026d132b7aaba003b"}, + {file = "grpcio-1.69.0-cp313-cp313-musllinux_1_1_i686.whl", hash = "sha256:1ee76cd7e2e49cf9264f6812d8c9ac1b85dda0eaea063af07292400f9191750e"}, + {file = "grpcio-1.69.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:0470fa911c503af59ec8bc4c82b371ee4303ececbbdc055f55ce48e38b20fd67"}, + {file = "grpcio-1.69.0-cp313-cp313-win32.whl", hash = "sha256:b650f34aceac8b2d08a4c8d7dc3e8a593f4d9e26d86751ebf74ebf5107d927de"}, + {file = "grpcio-1.69.0-cp313-cp313-win_amd64.whl", hash = "sha256:028337786f11fecb5d7b7fa660475a06aabf7e5e52b5ac2df47414878c0ce7ea"}, + {file = "grpcio-1.69.0-cp38-cp38-linux_armv7l.whl", hash = "sha256:b7f693db593d6bf285e015d5538bf1c86cf9c60ed30b6f7da04a00ed052fe2f3"}, + {file = "grpcio-1.69.0-cp38-cp38-macosx_10_14_universal2.whl", hash = "sha256:8b94e83f66dbf6fd642415faca0608590bc5e8d30e2c012b31d7d1b91b1de2fd"}, + {file = "grpcio-1.69.0-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:b634851b92c090763dde61df0868c730376cdb73a91bcc821af56ae043b09596"}, + {file = "grpcio-1.69.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bf5f680d3ed08c15330d7830d06bc65f58ca40c9999309517fd62880d70cb06e"}, + {file = "grpcio-1.69.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:200e48a6e7b00f804cf00a1c26292a5baa96507c7749e70a3ec10ca1a288936e"}, + {file = "grpcio-1.69.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:45a4704339b6e5b24b0e136dea9ad3815a94f30eb4f1e1d44c4ac484ef11d8dd"}, + {file = "grpcio-1.69.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:85d347cb8237751b23539981dbd2d9d8f6e9ff90082b427b13022b948eb6347a"}, + {file = "grpcio-1.69.0-cp38-cp38-win32.whl", hash = "sha256:60e5de105dc02832dc8f120056306d0ef80932bcf1c0e2b4ca3b676de6dc6505"}, + {file = "grpcio-1.69.0-cp38-cp38-win_amd64.whl", hash = "sha256:282f47d0928e40f25d007f24eb8fa051cb22551e3c74b8248bc9f9bea9c35fe0"}, + {file = "grpcio-1.69.0-cp39-cp39-linux_armv7l.whl", hash = "sha256:dd034d68a2905464c49479b0c209c773737a4245d616234c79c975c7c90eca03"}, + {file = "grpcio-1.69.0-cp39-cp39-macosx_10_14_universal2.whl", hash = "sha256:01f834732c22a130bdf3dc154d1053bdbc887eb3ccb7f3e6285cfbfc33d9d5cc"}, + {file = "grpcio-1.69.0-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:a7f4ed0dcf202a70fe661329f8874bc3775c14bb3911d020d07c82c766ce0eb1"}, + {file = "grpcio-1.69.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cd7ea241b10bc5f0bb0f82c0d7896822b7ed122b3ab35c9851b440c1ccf81588"}, + {file = "grpcio-1.69.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1f03dc9b4da4c0dc8a1db7a5420f575251d7319b7a839004d8916257ddbe4816"}, + {file = "grpcio-1.69.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:ca71d73a270dff052fe4edf74fef142d6ddd1f84175d9ac4a14b7280572ac519"}, + {file = "grpcio-1.69.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5ccbed100dc43704e94ccff9e07680b540d64e4cc89213ab2832b51b4f68a520"}, + {file = "grpcio-1.69.0-cp39-cp39-win32.whl", hash = "sha256:1514341def9c6ec4b7f0b9628be95f620f9d4b99331b7ef0a1845fd33d9b579c"}, + {file = "grpcio-1.69.0-cp39-cp39-win_amd64.whl", hash = "sha256:c1fea55d26d647346acb0069b08dca70984101f2dc95066e003019207212e303"}, + {file = "grpcio-1.69.0.tar.gz", hash = "sha256:936fa44241b5379c5afc344e1260d467bee495747eaf478de825bab2791da6f5"}, ] [package.extras] -protobuf = ["grpcio-tools (>=1.68.1)"] +protobuf = ["grpcio-tools (>=1.69.0)"] [[package]] name = "grpcio-tools" @@ -467,13 +454,13 @@ files = [ [[package]] name = "identify" -version = "2.6.3" +version = "2.6.5" description = "File identification library for Python" optional = false python-versions = ">=3.9" files = [ - {file = "identify-2.6.3-py2.py3-none-any.whl", hash = "sha256:9edba65473324c2ea9684b1f944fe3191db3345e50b6d04571d10ed164f8d7bd"}, - {file = "identify-2.6.3.tar.gz", hash = "sha256:62f5dae9b5fef52c84cc188514e9ea4f3f636b1d8799ab5ebc475471f9e47a02"}, + {file = "identify-2.6.5-py2.py3-none-any.whl", hash = "sha256:14181a47091eb75b337af4c23078c9d09225cd4c48929f521f3bf16b09d02566"}, + {file = "identify-2.6.5.tar.gz", hash = "sha256:c10b33f250e5bba374fae86fb57f3adcebf1161bce7cdf92031915fd480c13bc"}, ] [package.extras] @@ -506,13 +493,13 @@ files = [ [[package]] name = "jinja2" -version = "3.1.4" +version = "3.1.5" description = "A very fast and expressive template engine." optional = false python-versions = ">=3.7" files = [ - {file = "jinja2-3.1.4-py3-none-any.whl", hash = "sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d"}, - {file = "jinja2-3.1.4.tar.gz", hash = "sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369"}, + {file = "jinja2-3.1.5-py3-none-any.whl", hash = "sha256:aba0f4dc9ed8013c424088f68a5c226f7d6097ed89b246d7749c2ec4175c6adb"}, + {file = "jinja2-3.1.5.tar.gz", hash = "sha256:8fefff8dc3034e27bb80d67c671eb8a9bc424c0ef4c0826edbff304cceff43bb"}, ] [package.dependencies] @@ -748,13 +735,13 @@ python-legacy = ["mkdocstrings-python-legacy (>=0.2.1)"] [[package]] name = "mkdocstrings-python" -version = "1.12.2" +version = "1.13.0" description = "A Python handler for mkdocstrings." optional = false python-versions = ">=3.9" files = [ - {file = "mkdocstrings_python-1.12.2-py3-none-any.whl", hash = "sha256:7f7d40d6db3cb1f5d19dbcd80e3efe4d0ba32b073272c0c0de9de2e604eda62a"}, - {file = "mkdocstrings_python-1.12.2.tar.gz", hash = "sha256:7a1760941c0b52a2cd87b960a9e21112ffe52e7df9d0b9583d04d47ed2e186f3"}, + {file = "mkdocstrings_python-1.13.0-py3-none-any.whl", hash = "sha256:b88bbb207bab4086434743849f8e796788b373bd32e7bfefbf8560ac45d88f97"}, + {file = "mkdocstrings_python-1.13.0.tar.gz", hash = "sha256:2dbd5757e8375b9720e81db16f52f1856bf59905428fd7ef88005d1370e2f64c"}, ] [package.dependencies] @@ -868,43 +855,49 @@ typing-extensions = {version = ">=4.1.0", markers = "python_version < \"3.11\""} [[package]] name = "mypy" -version = "1.14.0" +version = "1.14.1" description = "Optional static typing for Python" optional = false python-versions = ">=3.8" files = [ - {file = "mypy-1.14.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e971c1c667007f9f2b397ffa80fa8e1e0adccff336e5e77e74cb5f22868bee87"}, - {file = "mypy-1.14.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e86aaeaa3221a278c66d3d673b297232947d873773d61ca3ee0e28b2ff027179"}, - {file = "mypy-1.14.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1628c5c3ce823d296e41e2984ff88c5861499041cb416a8809615d0c1f41740e"}, - {file = "mypy-1.14.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:7fadb29b77fc14a0dd81304ed73c828c3e5cde0016c7e668a86a3e0dfc9f3af3"}, - {file = "mypy-1.14.0-cp310-cp310-win_amd64.whl", hash = "sha256:3fa76988dc760da377c1e5069200a50d9eaaccf34f4ea18428a3337034ab5a44"}, - {file = "mypy-1.14.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6e73c8a154eed31db3445fe28f63ad2d97b674b911c00191416cf7f6459fd49a"}, - {file = "mypy-1.14.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:273e70fcb2e38c5405a188425aa60b984ffdcef65d6c746ea5813024b68c73dc"}, - {file = "mypy-1.14.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1daca283d732943731a6a9f20fdbcaa927f160bc51602b1d4ef880a6fb252015"}, - {file = "mypy-1.14.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:7e68047bedb04c1c25bba9901ea46ff60d5eaac2d71b1f2161f33107e2b368eb"}, - {file = "mypy-1.14.0-cp311-cp311-win_amd64.whl", hash = "sha256:7a52f26b9c9b1664a60d87675f3bae00b5c7f2806e0c2800545a32c325920bcc"}, - {file = "mypy-1.14.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d5326ab70a6db8e856d59ad4cb72741124950cbbf32e7b70e30166ba7bbf61dd"}, - {file = "mypy-1.14.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bf4ec4980bec1e0e24e5075f449d014011527ae0055884c7e3abc6a99cd2c7f1"}, - {file = "mypy-1.14.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:390dfb898239c25289495500f12fa73aa7f24a4c6d90ccdc165762462b998d63"}, - {file = "mypy-1.14.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7e026d55ddcd76e29e87865c08cbe2d0104e2b3153a523c529de584759379d3d"}, - {file = "mypy-1.14.0-cp312-cp312-win_amd64.whl", hash = "sha256:585ed36031d0b3ee362e5107ef449a8b5dfd4e9c90ccbe36414ee405ee6b32ba"}, - {file = "mypy-1.14.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e9f6f4c0b27401d14c483c622bc5105eff3911634d576bbdf6695b9a7c1ba741"}, - {file = "mypy-1.14.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:56b2280cedcb312c7a79f5001ae5325582d0d339bce684e4a529069d0e7ca1e7"}, - {file = "mypy-1.14.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:342de51c48bab326bfc77ce056ba08c076d82ce4f5a86621f972ed39970f94d8"}, - {file = "mypy-1.14.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:00df23b42e533e02a6f0055e54de9a6ed491cd8b7ea738647364fd3a39ea7efc"}, - {file = "mypy-1.14.0-cp313-cp313-win_amd64.whl", hash = "sha256:e8c8387e5d9dff80e7daf961df357c80e694e942d9755f3ad77d69b0957b8e3f"}, - {file = "mypy-1.14.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0b16738b1d80ec4334654e89e798eb705ac0c36c8a5c4798496cd3623aa02286"}, - {file = "mypy-1.14.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:10065fcebb7c66df04b05fc799a854b1ae24d9963c8bb27e9064a9bdb43aa8ad"}, - {file = "mypy-1.14.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fbb7d683fa6bdecaa106e8368aa973ecc0ddb79a9eaeb4b821591ecd07e9e03c"}, - {file = "mypy-1.14.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:3498cb55448dc5533e438cd13d6ddd28654559c8c4d1fd4b5ca57a31b81bac01"}, - {file = "mypy-1.14.0-cp38-cp38-win_amd64.whl", hash = "sha256:c7b243408ea43755f3a21a0a08e5c5ae30eddb4c58a80f415ca6b118816e60aa"}, - {file = "mypy-1.14.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:14117b9da3305b39860d0aa34b8f1ff74d209a368829a584eb77524389a9c13e"}, - {file = "mypy-1.14.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:af98c5a958f9c37404bd4eef2f920b94874507e146ed6ee559f185b8809c44cc"}, - {file = "mypy-1.14.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f0b343a1d3989547024377c2ba0dca9c74a2428ad6ed24283c213af8dbb0710b"}, - {file = "mypy-1.14.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:cdb5563c1726c85fb201be383168f8c866032db95e1095600806625b3a648cb7"}, - {file = "mypy-1.14.0-cp39-cp39-win_amd64.whl", hash = "sha256:74e925649c1ee0a79aa7448baf2668d81cc287dc5782cff6a04ee93f40fb8d3f"}, - {file = "mypy-1.14.0-py3-none-any.whl", hash = "sha256:2238d7f93fc4027ed1efc944507683df3ba406445a2b6c96e79666a045aadfab"}, - {file = "mypy-1.14.0.tar.gz", hash = "sha256:822dbd184d4a9804df5a7d5335a68cf7662930e70b8c1bc976645d1509f9a9d6"}, + {file = "mypy-1.14.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:52686e37cf13d559f668aa398dd7ddf1f92c5d613e4f8cb262be2fb4fedb0fcb"}, + {file = "mypy-1.14.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1fb545ca340537d4b45d3eecdb3def05e913299ca72c290326be19b3804b39c0"}, + {file = "mypy-1.14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:90716d8b2d1f4cd503309788e51366f07c56635a3309b0f6a32547eaaa36a64d"}, + {file = "mypy-1.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2ae753f5c9fef278bcf12e1a564351764f2a6da579d4a81347e1d5a15819997b"}, + {file = "mypy-1.14.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e0fe0f5feaafcb04505bcf439e991c6d8f1bf8b15f12b05feeed96e9e7bf1427"}, + {file = "mypy-1.14.1-cp310-cp310-win_amd64.whl", hash = "sha256:7d54bd85b925e501c555a3227f3ec0cfc54ee8b6930bd6141ec872d1c572f81f"}, + {file = "mypy-1.14.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f995e511de847791c3b11ed90084a7a0aafdc074ab88c5a9711622fe4751138c"}, + {file = "mypy-1.14.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d64169ec3b8461311f8ce2fd2eb5d33e2d0f2c7b49116259c51d0d96edee48d1"}, + {file = "mypy-1.14.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ba24549de7b89b6381b91fbc068d798192b1b5201987070319889e93038967a8"}, + {file = "mypy-1.14.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:183cf0a45457d28ff9d758730cd0210419ac27d4d3f285beda038c9083363b1f"}, + {file = "mypy-1.14.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f2a0ecc86378f45347f586e4163d1769dd81c5a223d577fe351f26b179e148b1"}, + {file = "mypy-1.14.1-cp311-cp311-win_amd64.whl", hash = "sha256:ad3301ebebec9e8ee7135d8e3109ca76c23752bac1e717bc84cd3836b4bf3eae"}, + {file = "mypy-1.14.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:30ff5ef8519bbc2e18b3b54521ec319513a26f1bba19a7582e7b1f58a6e69f14"}, + {file = "mypy-1.14.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:cb9f255c18052343c70234907e2e532bc7e55a62565d64536dbc7706a20b78b9"}, + {file = "mypy-1.14.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8b4e3413e0bddea671012b063e27591b953d653209e7a4fa5e48759cda77ca11"}, + {file = "mypy-1.14.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:553c293b1fbdebb6c3c4030589dab9fafb6dfa768995a453d8a5d3b23784af2e"}, + {file = "mypy-1.14.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fad79bfe3b65fe6a1efaed97b445c3d37f7be9fdc348bdb2d7cac75579607c89"}, + {file = "mypy-1.14.1-cp312-cp312-win_amd64.whl", hash = "sha256:8fa2220e54d2946e94ab6dbb3ba0a992795bd68b16dc852db33028df2b00191b"}, + {file = "mypy-1.14.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:92c3ed5afb06c3a8e188cb5da4984cab9ec9a77ba956ee419c68a388b4595255"}, + {file = "mypy-1.14.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:dbec574648b3e25f43d23577309b16534431db4ddc09fda50841f1e34e64ed34"}, + {file = "mypy-1.14.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8c6d94b16d62eb3e947281aa7347d78236688e21081f11de976376cf010eb31a"}, + {file = "mypy-1.14.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d4b19b03fdf54f3c5b2fa474c56b4c13c9dbfb9a2db4370ede7ec11a2c5927d9"}, + {file = "mypy-1.14.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:0c911fde686394753fff899c409fd4e16e9b294c24bfd5e1ea4675deae1ac6fd"}, + {file = "mypy-1.14.1-cp313-cp313-win_amd64.whl", hash = "sha256:8b21525cb51671219f5307be85f7e646a153e5acc656e5cebf64bfa076c50107"}, + {file = "mypy-1.14.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7084fb8f1128c76cd9cf68fe5971b37072598e7c31b2f9f95586b65c741a9d31"}, + {file = "mypy-1.14.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:8f845a00b4f420f693f870eaee5f3e2692fa84cc8514496114649cfa8fd5e2c6"}, + {file = "mypy-1.14.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:44bf464499f0e3a2d14d58b54674dee25c031703b2ffc35064bd0df2e0fac319"}, + {file = "mypy-1.14.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c99f27732c0b7dc847adb21c9d47ce57eb48fa33a17bc6d7d5c5e9f9e7ae5bac"}, + {file = "mypy-1.14.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:bce23c7377b43602baa0bd22ea3265c49b9ff0b76eb315d6c34721af4cdf1d9b"}, + {file = "mypy-1.14.1-cp38-cp38-win_amd64.whl", hash = "sha256:8edc07eeade7ebc771ff9cf6b211b9a7d93687ff892150cb5692e4f4272b0837"}, + {file = "mypy-1.14.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3888a1816d69f7ab92092f785a462944b3ca16d7c470d564165fe703b0970c35"}, + {file = "mypy-1.14.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:46c756a444117c43ee984bd055db99e498bc613a70bbbc120272bd13ca579fbc"}, + {file = "mypy-1.14.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:27fc248022907e72abfd8e22ab1f10e903915ff69961174784a3900a8cba9ad9"}, + {file = "mypy-1.14.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:499d6a72fb7e5de92218db961f1a66d5f11783f9ae549d214617edab5d4dbdbb"}, + {file = "mypy-1.14.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:57961db9795eb566dc1d1b4e9139ebc4c6b0cb6e7254ecde69d1552bf7613f60"}, + {file = "mypy-1.14.1-cp39-cp39-win_amd64.whl", hash = "sha256:07ba89fdcc9451f2ebb02853deb6aaaa3d2239a236669a63ab3801bbf923ef5c"}, + {file = "mypy-1.14.1-py3-none-any.whl", hash = "sha256:b66a60cc4073aeb8ae00057f9c1f64d49e90f918fbcef9a977eb121da8b8f1d1"}, + {file = "mypy-1.14.1.tar.gz", hash = "sha256:7ec88144fe9b510e8475ec2f5f251992690fcf89ccb4500b214b4226abcd32d6"}, ] [package.dependencies] @@ -1022,13 +1015,13 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "poethepoet" -version = "0.31.1" +version = "0.32.0" description = "A task runner that works well with poetry." optional = false python-versions = ">=3.9" files = [ - {file = "poethepoet-0.31.1-py3-none-any.whl", hash = "sha256:7fdfa0ac6074be9936723e7231b5bfaad2923e96c674a9857e81d326cf8ccdc2"}, - {file = "poethepoet-0.31.1.tar.gz", hash = "sha256:d6b66074edf85daf115bb916eae0afd6387d19e1562e1c9ef7d61d5c585696aa"}, + {file = "poethepoet-0.32.0-py3-none-any.whl", hash = "sha256:fba84c72d923feac228d1ea7734c5a54701f2e71fad42845f027c0fbf998a073"}, + {file = "poethepoet-0.32.0.tar.gz", hash = "sha256:a700be02e932e1a8907ae630928fc769ea9a77986189ba6867e6e3fd8f60e5b7"}, ] [package.dependencies] @@ -1090,13 +1083,13 @@ files = [ [[package]] name = "pygments" -version = "2.18.0" +version = "2.19.0" description = "Pygments is a syntax highlighting package written in Python." optional = false python-versions = ">=3.8" files = [ - {file = "pygments-2.18.0-py3-none-any.whl", hash = "sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a"}, - {file = "pygments-2.18.0.tar.gz", hash = "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199"}, + {file = "pygments-2.19.0-py3-none-any.whl", hash = "sha256:4755e6e64d22161d5b61432c0600c923c5927214e7c956e31c23923c89251a9b"}, + {file = "pygments-2.19.0.tar.gz", hash = "sha256:afc4146269910d4bdfabcd27c24923137a74d562a23a320a41a55ad303e19783"}, ] [package.extras] @@ -1104,13 +1097,13 @@ windows-terminal = ["colorama (>=0.4.6)"] [[package]] name = "pymdown-extensions" -version = "10.12" +version = "10.13" description = "Extension pack for Python Markdown." optional = false python-versions = ">=3.8" files = [ - {file = "pymdown_extensions-10.12-py3-none-any.whl", hash = "sha256:49f81412242d3527b8b4967b990df395c89563043bc51a3d2d7d500e52123b77"}, - {file = "pymdown_extensions-10.12.tar.gz", hash = "sha256:b0ee1e0b2bef1071a47891ab17003bfe5bf824a398e13f49f8ed653b699369a7"}, + {file = "pymdown_extensions-10.13-py3-none-any.whl", hash = "sha256:80bc33d715eec68e683e04298946d47d78c7739e79d808203df278ee8ef89428"}, + {file = "pymdown_extensions-10.13.tar.gz", hash = "sha256:e0b351494dc0d8d14a1f52b39b1499a00ef1566b4ba23dc74f1eba75c736f5dd"}, ] [package.dependencies] @@ -1387,23 +1380,23 @@ files = [ [[package]] name = "setuptools" -version = "75.6.0" +version = "75.7.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.9" files = [ - {file = "setuptools-75.6.0-py3-none-any.whl", hash = "sha256:ce74b49e8f7110f9bf04883b730f4765b774ef3ef28f722cce7c273d253aaf7d"}, - {file = "setuptools-75.6.0.tar.gz", hash = "sha256:8199222558df7c86216af4f84c30e9b34a61d8ba19366cc914424cdbd28252f6"}, + {file = "setuptools-75.7.0-py3-none-any.whl", hash = "sha256:84fb203f278ebcf5cd08f97d3fb96d3fbed4b629d500b29ad60d11e00769b183"}, + {file = "setuptools-75.7.0.tar.gz", hash = "sha256:886ff7b16cd342f1d1defc16fc98c9ce3fde69e087a4e1983d7ab634e5f41f4f"}, ] [package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)", "ruff (>=0.7.0)"] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)", "ruff (>=0.8.0)"] core = ["importlib_metadata (>=6)", "jaraco.collections", "jaraco.functools (>=4)", "jaraco.text (>=3.7)", "more_itertools", "more_itertools (>=8.8)", "packaging", "packaging (>=24.2)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"] enabler = ["pytest-enabler (>=2.2)"] -test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test (>=5.5)", "packaging (>=24.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] -type = ["importlib_metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (>=1.12,<1.14)", "pytest-mypy"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.7.2)", "jaraco.test (>=5.5)", "packaging (>=24.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] +type = ["importlib_metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (==1.14.*)", "pytest-mypy"] [[package]] name = "six" @@ -1481,13 +1474,13 @@ files = [ [[package]] name = "urllib3" -version = "2.2.3" +version = "2.3.0" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"}, - {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"}, + {file = "urllib3-2.3.0-py3-none-any.whl", hash = "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df"}, + {file = "urllib3-2.3.0.tar.gz", hash = "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d"}, ] [package.extras] @@ -1498,13 +1491,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "virtualenv" -version = "20.28.0" +version = "20.28.1" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.8" files = [ - {file = "virtualenv-20.28.0-py3-none-any.whl", hash = "sha256:23eae1b4516ecd610481eda647f3a7c09aea295055337331bb4e6892ecce47b0"}, - {file = "virtualenv-20.28.0.tar.gz", hash = "sha256:2c9c3262bb8e7b87ea801d715fae4495e6032450c71d2309be9550e7364049aa"}, + {file = "virtualenv-20.28.1-py3-none-any.whl", hash = "sha256:412773c85d4dab0409b83ec36f7a6499e72eaf08c80e81e9576bca61831c71cb"}, + {file = "virtualenv-20.28.1.tar.gz", hash = "sha256:5d34ab240fdb5d21549b76f9e8ff3af28252f5499fb6d6f031adac4e5a8c5329"}, ] [package.dependencies] diff --git a/pyproject.toml b/pyproject.toml index 3ac68055..6765daff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -102,13 +102,13 @@ cmd = "ruff check src tests" help = "Check the code with the Ruff linter" [tool.poe.tasks.generate_lib] -cmd = """ -protoc - --plugin=protoc-gen-custom=src/betterproto2_compiler/plugin/main.py - --custom_opt=INCLUDE_GOOGLE - --custom_out=src/betterproto/lib/std - -I /usr/local/include/ - /usr/local/include/google/protobuf/**/*.proto +shell = """ +protoc \ + --plugin=protoc-gen-custom=src/betterproto2_compiler/plugin/main.py \ + --custom_opt=INCLUDE_GOOGLE \ + --custom_out=src/betterproto2_compiler/lib \ + -I /usr/include/ \ + /usr/include/google/protobuf/**/*.proto """ help = "Regenerate the types in betterproto.lib.std.google" diff --git a/src/betterproto2_compiler/lib/google/protobuf/compiler/__init__.py b/src/betterproto2_compiler/lib/google/protobuf/compiler/__init__.py index 89ac5943..da6f5df0 100644 --- a/src/betterproto2_compiler/lib/google/protobuf/compiler/__init__.py +++ b/src/betterproto2_compiler/lib/google/protobuf/compiler/__init__.py @@ -1,197 +1,229 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: google/protobuf/compiler/plugin.proto +# sources: plugin.proto # plugin: python-betterproto2 # This file has been @generated +__all__ = ( + "CodeGeneratorResponseFeature", + "CodeGeneratorRequest", + "CodeGeneratorResponse", + "CodeGeneratorResponseFile", + "Version", +) + + from dataclasses import dataclass -from typing import List +from typing import ( + TYPE_CHECKING, + List, + Optional, +) import betterproto2 -import betterproto2_compiler.lib.google.protobuf as betterproto_lib_google_protobuf +if TYPE_CHECKING: + pass + +betterproto2.check_compiler_version("0.1.0") class CodeGeneratorResponseFeature(betterproto2.Enum): - """Sync with code_generator.h.""" + """ + Sync with code_generator.h. + """ FEATURE_NONE = 0 + FEATURE_PROTO3_OPTIONAL = 1 + FEATURE_SUPPORTS_EDITIONS = 2 @dataclass(eq=False, repr=False) -class Version(betterproto2.Message): - """The version number of protocol compiler.""" - - major: int = betterproto2.int32_field(1) - minor: int = betterproto2.int32_field(2) - patch: int = betterproto2.int32_field(3) - suffix: str = betterproto2.string_field(4) - """ - A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should - be empty for mainline stable releases. +class CodeGeneratorRequest(betterproto2.Message): """ + An encoded CodeGeneratorRequest is written to the plugin's stdin. + """ -@dataclass(eq=False, repr=False) -class CodeGeneratorRequest(betterproto2.Message): - """An encoded CodeGeneratorRequest is written to the plugin's stdin.""" - - file_to_generate: List[str] = betterproto2.string_field(1, repeated=True) + file_to_generate: "List[str]" = betterproto2.field(1, betterproto2.TYPE_STRING, repeated=True) """ The .proto files that were explicitly listed on the command-line. The - code generator should generate code only for these files. Each file's - descriptor will be included in proto_file, below. + code generator should generate code only for these files. Each file's + descriptor will be included in proto_file, below. """ - - parameter: str = betterproto2.string_field(2) - """The generator parameter passed on the command-line.""" - - proto_file: List["betterproto_lib_google_protobuf.FileDescriptorProto"] = betterproto2.message_field( - 15, repeated=True + parameter: "str" = betterproto2.field(2, betterproto2.TYPE_STRING) + """ + The generator parameter passed on the command-line. + """ + proto_file: "List[betterproto2_lib_google_protobuf.FileDescriptorProto]" = betterproto2.field( + 15, betterproto2.TYPE_MESSAGE, repeated=True ) """ FileDescriptorProtos for all files in files_to_generate and everything - they import. The files will appear in topological order, so each file - appears before any file that imports it. - - Note: the files listed in files_to_generate will include runtime-retention - options only, but all other files will include source-retention options. - The source_file_descriptors field below is available in case you need - source-retention options for files_to_generate. - - protoc guarantees that all proto_files will be written after - the fields above, even though this is not technically guaranteed by the - protobuf wire format. This theoretically could allow a plugin to stream - in the FileDescriptorProtos and handle them one by one rather than read - the entire set into memory at once. However, as of this writing, this - is not similarly optimized on protoc's end -- it will store all fields in - memory at once before sending them to the plugin. - - Type names of fields and extensions in the FileDescriptorProto are always - fully qualified. - """ - - source_file_descriptors: List["betterproto_lib_google_protobuf.FileDescriptorProto"] = betterproto2.message_field( - 17, repeated=True + they import. The files will appear in topological order, so each file + appears before any file that imports it. + + Note: the files listed in files_to_generate will include runtime-retention + options only, but all other files will include source-retention options. + The source_file_descriptors field below is available in case you need + source-retention options for files_to_generate. + + protoc guarantees that all proto_files will be written after + the fields above, even though this is not technically guaranteed by the + protobuf wire format. This theoretically could allow a plugin to stream + in the FileDescriptorProtos and handle them one by one rather than read + the entire set into memory at once. However, as of this writing, this + is not similarly optimized on protoc's end -- it will store all fields in + memory at once before sending them to the plugin. + + Type names of fields and extensions in the FileDescriptorProto are always + fully qualified. + """ + source_file_descriptors: "List[betterproto2_lib_google_protobuf.FileDescriptorProto]" = betterproto2.field( + 17, betterproto2.TYPE_MESSAGE, repeated=True ) """ File descriptors with all options, including source-retention options. - These descriptors are only provided for the files listed in - files_to_generate. + These descriptors are only provided for the files listed in + files_to_generate. + """ + compiler_version: "Optional[Version]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, optional=True) + """ + The version number of protocol compiler. """ - - compiler_version: "Version" = betterproto2.message_field(3) - """The version number of protocol compiler.""" @dataclass(eq=False, repr=False) class CodeGeneratorResponse(betterproto2.Message): - """The plugin writes an encoded CodeGeneratorResponse to stdout.""" + """ + The plugin writes an encoded CodeGeneratorResponse to stdout. - error: str = betterproto2.string_field(1) """ - Error message. If non-empty, code generation failed. The plugin process - should exit with status code zero even if it reports an error in this way. - - This should be used to indicate errors in .proto files which prevent the - code generator from generating correct code. Errors which indicate a - problem in protoc itself -- such as the input CodeGeneratorRequest being - unparseable -- should be reported by writing a message to stderr and - exiting with a non-zero status code. + + error: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) """ + Error message. If non-empty, code generation failed. The plugin process + should exit with status code zero even if it reports an error in this way. - supported_features: int = betterproto2.uint64_field(2) + This should be used to indicate errors in .proto files which prevent the + code generator from generating correct code. Errors which indicate a + problem in protoc itself -- such as the input CodeGeneratorRequest being + unparseable -- should be reported by writing a message to stderr and + exiting with a non-zero status code. + """ + supported_features: "int" = betterproto2.field(2, betterproto2.TYPE_UINT64) """ A bitmask of supported features that the code generator supports. - This is a bitwise "or" of values from the Feature enum. + This is a bitwise "or" of values from the Feature enum. """ - - minimum_edition: int = betterproto2.int32_field(3) + minimum_edition: "int" = betterproto2.field(3, betterproto2.TYPE_INT32) """ The minimum edition this plugin supports. This will be treated as an - Edition enum, but we want to allow unknown values. It should be specified - according the edition enum value, *not* the edition number. Only takes - effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. + Edition enum, but we want to allow unknown values. It should be specified + according the edition enum value, *not* the edition number. Only takes + effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. """ - - maximum_edition: int = betterproto2.int32_field(4) + maximum_edition: "int" = betterproto2.field(4, betterproto2.TYPE_INT32) """ The maximum edition this plugin supports. This will be treated as an - Edition enum, but we want to allow unknown values. It should be specified - according the edition enum value, *not* the edition number. Only takes - effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. + Edition enum, but we want to allow unknown values. It should be specified + according the edition enum value, *not* the edition number. Only takes + effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. """ - - file: List["CodeGeneratorResponseFile"] = betterproto2.message_field(15, repeated=True) + file: "List[CodeGeneratorResponseFile]" = betterproto2.field(15, betterproto2.TYPE_MESSAGE, repeated=True) @dataclass(eq=False, repr=False) class CodeGeneratorResponseFile(betterproto2.Message): - """Represents a single generated file.""" + """ + Represents a single generated file. - name: str = betterproto2.string_field(1) """ - The file name, relative to the output directory. The name must not - contain "." or ".." components and must be relative, not be absolute (so, - the file cannot lie outside the output directory). "/" must be used as - the path separator, not "\". - - If the name is omitted, the content will be appended to the previous - file. This allows the generator to break large files into small chunks, - and allows the generated text to be streamed back to protoc so that large - files need not reside completely in memory at one time. Note that as of - this writing protoc does not optimize for this -- it will read the entire - CodeGeneratorResponse before writing files to disk. + + name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) """ + The file name, relative to the output directory. The name must not + contain "." or ".." components and must be relative, not be absolute (so, + the file cannot lie outside the output directory). "/" must be used as + the path separator, not "\". - insertion_point: str = betterproto2.string_field(2) + If the name is omitted, the content will be appended to the previous + file. This allows the generator to break large files into small chunks, + and allows the generated text to be streamed back to protoc so that large + files need not reside completely in memory at one time. Note that as of + this writing protoc does not optimize for this -- it will read the entire + CodeGeneratorResponse before writing files to disk. + """ + insertion_point: "str" = betterproto2.field(2, betterproto2.TYPE_STRING) """ If non-empty, indicates that the named file should already exist, and the - content here is to be inserted into that file at a defined insertion - point. This feature allows a code generator to extend the output - produced by another code generator. The original generator may provide - insertion points by placing special annotations in the file that look - like: - @@protoc_insertion_point(NAME) - The annotation can have arbitrary text before and after it on the line, - which allows it to be placed in a comment. NAME should be replaced with - an identifier naming the point -- this is what other generators will use - as the insertion_point. Code inserted at this point will be placed - immediately above the line containing the insertion point (thus multiple - insertions to the same point will come out in the order they were added). - The double-@ is intended to make it unlikely that the generated code - could contain things that look like insertion points by accident. - - For example, the C++ code generator places the following line in the - .pb.h files that it generates: - // @@protoc_insertion_point(namespace_scope) - This line appears within the scope of the file's package namespace, but - outside of any particular class. Another plugin can then specify the - insertion_point "namespace_scope" to generate additional classes or - other declarations that should be placed in this scope. - - Note that if the line containing the insertion point begins with - whitespace, the same whitespace will be added to every line of the - inserted text. This is useful for languages like Python, where - indentation matters. In these languages, the insertion point comment - should be indented the same amount as any inserted code will need to be - in order to work correctly in that context. - - The code generator that generates the initial file and the one which - inserts into it must both run as part of a single invocation of protoc. - Code generators are executed in the order in which they appear on the - command line. - - If |insertion_point| is present, |name| must also be present. - """ - - content: str = betterproto2.string_field(15) - """The file contents.""" - - generated_code_info: "betterproto_lib_google_protobuf.GeneratedCodeInfo" = betterproto2.message_field(16) + content here is to be inserted into that file at a defined insertion + point. This feature allows a code generator to extend the output + produced by another code generator. The original generator may provide + insertion points by placing special annotations in the file that look + like: + @@protoc_insertion_point(NAME) + The annotation can have arbitrary text before and after it on the line, + which allows it to be placed in a comment. NAME should be replaced with + an identifier naming the point -- this is what other generators will use + as the insertion_point. Code inserted at this point will be placed + immediately above the line containing the insertion point (thus multiple + insertions to the same point will come out in the order they were added). + The double-@ is intended to make it unlikely that the generated code + could contain things that look like insertion points by accident. + + For example, the C++ code generator places the following line in the + .pb.h files that it generates: + // @@protoc_insertion_point(namespace_scope) + This line appears within the scope of the file's package namespace, but + outside of any particular class. Another plugin can then specify the + insertion_point "namespace_scope" to generate additional classes or + other declarations that should be placed in this scope. + + Note that if the line containing the insertion point begins with + whitespace, the same whitespace will be added to every line of the + inserted text. This is useful for languages like Python, where + indentation matters. In these languages, the insertion point comment + should be indented the same amount as any inserted code will need to be + in order to work correctly in that context. + + The code generator that generates the initial file and the one which + inserts into it must both run as part of a single invocation of protoc. + Code generators are executed in the order in which they appear on the + command line. + + If |insertion_point| is present, |name| must also be present. + """ + content: "str" = betterproto2.field(15, betterproto2.TYPE_STRING) + """ + The file contents. + """ + generated_code_info: "Optional[betterproto2_lib_google_protobuf.GeneratedCodeInfo]" = betterproto2.field( + 16, betterproto2.TYPE_MESSAGE, optional=True + ) """ Information describing the file content being inserted. If an insertion - point is used, this information will be appropriately offset and inserted - into the code generation metadata for the generated files. + point is used, this information will be appropriately offset and inserted + into the code generation metadata for the generated files. """ + + +@dataclass(eq=False, repr=False) +class Version(betterproto2.Message): + """ + The version number of protocol compiler. + + """ + + major: "int" = betterproto2.field(1, betterproto2.TYPE_INT32) + minor: "int" = betterproto2.field(2, betterproto2.TYPE_INT32) + patch: "int" = betterproto2.field(3, betterproto2.TYPE_INT32) + suffix: "str" = betterproto2.field(4, betterproto2.TYPE_STRING) + """ + A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should + be empty for mainline stable releases. + """ + + +import betterproto2.lib.google.protobuf as betterproto2_lib_google_protobuf From 4508d040568a50481821be25e189b9daf7690bff Mon Sep 17 00:00:00 2001 From: Adrien Vannson Date: Mon, 6 Jan 2025 11:45:54 +0100 Subject: [PATCH 03/10] Update betterproto --- poetry.lock | 9 ++++----- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/poetry.lock b/poetry.lock index 0388a599..fcb4acc1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -45,13 +45,13 @@ dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] [[package]] name = "betterproto2" -version = "0.0.2" +version = "0.1.0" description = "A better Protobuf / gRPC generator & library" optional = false python-versions = "<4.0,>=3.8" files = [ - {file = "betterproto2-0.0.2-py3-none-any.whl", hash = "sha256:540d87a9ee30f12852827f9dc69483da7aeb9d17f46864c3b391f7f7fdb5ec07"}, - {file = "betterproto2-0.0.2.tar.gz", hash = "sha256:f55b9069256e199d61b49230516baf850fe928256e57e2b4d3b9034162d72e14"}, + {file = "betterproto2-0.1.0-py3-none-any.whl", hash = "sha256:9f1e51b896f499f53a183577a7aa00e1888fd1490b5dfd83f81c725fe0226341"}, + {file = "betterproto2-0.1.0.tar.gz", hash = "sha256:ea493987d491721d53709d616bd9542d35a884485f4ee0ab38d4d2d04870d87d"}, ] [package.dependencies] @@ -60,7 +60,6 @@ python-dateutil = ">=2.8,<3.0" typing-extensions = ">=4.7.1,<5.0.0" [package.extras] -compiler = ["jinja2 (>=3.0.3)", "ruff (>=0.7.4,<0.8.0)"] rust-codec = ["betterproto-rust-codec (==0.1.1)"] [[package]] @@ -1554,4 +1553,4 @@ watchmedo = ["PyYAML (>=3.10)"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "14f7a0419039f53a2db6c2b86bde16273912439556d9b5fa52ac51fe03121eea" +content-hash = "884a45f57359d3969df38d1fa7d96643450cfd44233f8016ffe2f6899d957bfa" diff --git a/pyproject.toml b/pyproject.toml index 6765daff..4981fc41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ packages = [ [tool.poetry.dependencies] python = "^3.10" -betterproto2 = "0.0.2" +betterproto2 = "^0.1.0" # The Ruff version is pinned. To update it, also update it in .pre-commit-config.yaml ruff = "~0.7.4" grpclib = "^0.4.1" From ad3c1dcad7567b58b0c7bffd607c5610f0f39c9b Mon Sep 17 00:00:00 2001 From: Adrien Vannson Date: Mon, 6 Jan 2025 11:51:19 +0100 Subject: [PATCH 04/10] Fix optional --- src/betterproto2_compiler/lib/google/protobuf/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/betterproto2_compiler/lib/google/protobuf/__init__.py b/src/betterproto2_compiler/lib/google/protobuf/__init__.py index 13bfb6ef..f3a3f383 100644 --- a/src/betterproto2_compiler/lib/google/protobuf/__init__.py +++ b/src/betterproto2_compiler/lib/google/protobuf/__init__.py @@ -971,7 +971,7 @@ class Field(betterproto2.Message): The field type URL, without the scheme, for message or enumeration types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. """ - oneof_index: "int" = betterproto2.field(7, betterproto2.TYPE_INT32) + oneof_index: "Optional[int]" = betterproto2.field(7, betterproto2.TYPE_INT32, optional=True) """ The index of the field type in `Type.oneofs`, for message or enumeration types. The first type has index 1; zero means the type is not in the list. @@ -1034,7 +1034,7 @@ class FieldDescriptorProto(betterproto2.Message): For bytes, contains the C escaped value. All bytes >= 128 are escaped. TODO(kenton): Base-64 encode? """ - oneof_index: "int" = betterproto2.field(9, betterproto2.TYPE_INT32) + oneof_index: "Optional[int]" = betterproto2.field(9, betterproto2.TYPE_INT32, optional=True) """ If set, gives the index of a oneof in the containing type's oneof_decl list. This field is a member of that oneof. From c50a84d7b5ef3650d983f53dc4df65c60efe74f6 Mon Sep 17 00:00:00 2001 From: Adrien Vannson Date: Mon, 6 Jan 2025 12:10:51 +0100 Subject: [PATCH 05/10] Use lib from betterproto2 --- .../compile/importing.py | 3 +- .../lib/google/protobuf/__init__.py | 2471 ----------------- src/betterproto2_compiler/plugin/models.py | 14 +- src/betterproto2_compiler/plugin/parser.py | 3 +- 4 files changed, 11 insertions(+), 2480 deletions(-) diff --git a/src/betterproto2_compiler/compile/importing.py b/src/betterproto2_compiler/compile/importing.py index d4b3ac78..266193e8 100644 --- a/src/betterproto2_compiler/compile/importing.py +++ b/src/betterproto2_compiler/compile/importing.py @@ -5,8 +5,9 @@ TYPE_CHECKING, ) +from betterproto2.lib.google import protobuf as google_protobuf + from ..casing import safe_snake_case -from ..lib.google import protobuf as google_protobuf from .naming import pythonize_class_name if TYPE_CHECKING: diff --git a/src/betterproto2_compiler/lib/google/protobuf/__init__.py b/src/betterproto2_compiler/lib/google/protobuf/__init__.py index f3a3f383..e69de29b 100644 --- a/src/betterproto2_compiler/lib/google/protobuf/__init__.py +++ b/src/betterproto2_compiler/lib/google/protobuf/__init__.py @@ -1,2471 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: google/protobuf/any.proto, google/protobuf/api.proto, google/protobuf/descriptor.proto, google/protobuf/duration.proto, google/protobuf/empty.proto, google/protobuf/field_mask.proto, google/protobuf/source_context.proto, google/protobuf/struct.proto, google/protobuf/timestamp.proto, google/protobuf/type.proto, google/protobuf/wrappers.proto -# plugin: python-betterproto2 -# This file has been @generated - -__all__ = ( - "FieldCardinality", - "FieldKind", - "FieldDescriptorProtoLabel", - "FieldDescriptorProtoType", - "FieldOptionsCType", - "FieldOptionsJsType", - "FileOptionsOptimizeMode", - "MethodOptionsIdempotencyLevel", - "NullValue", - "Syntax", - "Any", - "Api", - "BoolValue", - "BytesValue", - "DescriptorProto", - "DescriptorProtoExtensionRange", - "DescriptorProtoReservedRange", - "DoubleValue", - "Duration", - "Empty", - "Enum", - "EnumDescriptorProto", - "EnumDescriptorProtoEnumReservedRange", - "EnumOptions", - "EnumValue", - "EnumValueDescriptorProto", - "EnumValueOptions", - "ExtensionRangeOptions", - "Field", - "FieldDescriptorProto", - "FieldMask", - "FieldOptions", - "FileDescriptorProto", - "FileDescriptorSet", - "FileOptions", - "FloatValue", - "GeneratedCodeInfo", - "GeneratedCodeInfoAnnotation", - "Int32Value", - "Int64Value", - "ListValue", - "MessageOptions", - "Method", - "MethodDescriptorProto", - "MethodOptions", - "Mixin", - "OneofDescriptorProto", - "OneofOptions", - "Option", - "ServiceDescriptorProto", - "ServiceOptions", - "SourceCodeInfo", - "SourceCodeInfoLocation", - "SourceContext", - "StringValue", - "Struct", - "Timestamp", - "Type", - "UInt32Value", - "UInt64Value", - "UninterpretedOption", - "UninterpretedOptionNamePart", - "Value", -) - -import warnings -from dataclasses import dataclass -from typing import ( - TYPE_CHECKING, - Dict, - List, - Optional, -) - -import betterproto2 - -if TYPE_CHECKING: - pass - -betterproto2.check_compiler_version("0.1.0") - - -class FieldCardinality(betterproto2.Enum): - """ - Whether a field is optional, required, or repeated. - """ - - CARDINALITY_UNKNOWN = 0 - """ - For fields with unknown cardinality. - """ - - CARDINALITY_OPTIONAL = 1 - """ - For optional fields. - """ - - CARDINALITY_REQUIRED = 2 - """ - For required fields. Proto2 syntax only. - """ - - CARDINALITY_REPEATED = 3 - """ - For repeated fields. - """ - - -class FieldKind(betterproto2.Enum): - """ - Basic field types. - """ - - TYPE_UNKNOWN = 0 - """ - Field type unknown. - """ - - TYPE_DOUBLE = 1 - """ - Field type double. - """ - - TYPE_FLOAT = 2 - """ - Field type float. - """ - - TYPE_INT64 = 3 - """ - Field type int64. - """ - - TYPE_UINT64 = 4 - """ - Field type uint64. - """ - - TYPE_INT32 = 5 - """ - Field type int32. - """ - - TYPE_FIXED64 = 6 - """ - Field type fixed64. - """ - - TYPE_FIXED32 = 7 - """ - Field type fixed32. - """ - - TYPE_BOOL = 8 - """ - Field type bool. - """ - - TYPE_STRING = 9 - """ - Field type string. - """ - - TYPE_GROUP = 10 - """ - Field type group. Proto2 syntax only, and deprecated. - """ - - TYPE_MESSAGE = 11 - """ - Field type message. - """ - - TYPE_BYTES = 12 - """ - Field type bytes. - """ - - TYPE_UINT32 = 13 - """ - Field type uint32. - """ - - TYPE_ENUM = 14 - """ - Field type enum. - """ - - TYPE_SFIXED32 = 15 - """ - Field type sfixed32. - """ - - TYPE_SFIXED64 = 16 - """ - Field type sfixed64. - """ - - TYPE_SINT32 = 17 - """ - Field type sint32. - """ - - TYPE_SINT64 = 18 - """ - Field type sint64. - """ - - -class FieldDescriptorProtoLabel(betterproto2.Enum): - LABEL_OPTIONAL = 1 - """ - 0 is reserved for errors - """ - - LABEL_REQUIRED = 2 - - LABEL_REPEATED = 3 - - -class FieldDescriptorProtoType(betterproto2.Enum): - TYPE_DOUBLE = 1 - """ - 0 is reserved for errors. - Order is weird for historical reasons. - """ - - TYPE_FLOAT = 2 - - TYPE_INT64 = 3 - """ - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - negative values are likely. - """ - - TYPE_UINT64 = 4 - - TYPE_INT32 = 5 - """ - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - negative values are likely. - """ - - TYPE_FIXED64 = 6 - - TYPE_FIXED32 = 7 - - TYPE_BOOL = 8 - - TYPE_STRING = 9 - - TYPE_GROUP = 10 - """ - Tag-delimited aggregate. - Group type is deprecated and not supported in proto3. However, Proto3 - implementations should still be able to parse the group wire format and - treat group fields as unknown fields. - """ - - TYPE_MESSAGE = 11 - """ - Length-delimited aggregate. - """ - - TYPE_BYTES = 12 - """ - New in version 2. - """ - - TYPE_UINT32 = 13 - - TYPE_ENUM = 14 - - TYPE_SFIXED32 = 15 - - TYPE_SFIXED64 = 16 - - TYPE_SINT32 = 17 - """ - Uses ZigZag encoding. - """ - - TYPE_SINT64 = 18 - """ - Uses ZigZag encoding. - """ - - -class FieldOptionsCType(betterproto2.Enum): - STRING = 0 - """ - Default mode. - """ - - CORD = 1 - - STRING_PIECE = 2 - - -class FieldOptionsJsType(betterproto2.Enum): - JS_NORMAL = 0 - """ - Use the default type. - """ - - JS_STRING = 1 - """ - Use JavaScript strings. - """ - - JS_NUMBER = 2 - """ - Use JavaScript numbers. - """ - - -class FileOptionsOptimizeMode(betterproto2.Enum): - """ - Generated classes can be optimized for speed or code size. - """ - - SPEED = 1 - """ - Generate complete code for parsing, serialization, - """ - - CODE_SIZE = 2 - """ - etc. - - Use ReflectionOps to implement these methods. - """ - - LITE_RUNTIME = 3 - """ - Generate code using MessageLite and the lite runtime. - """ - - -class MethodOptionsIdempotencyLevel(betterproto2.Enum): - """ - Is this method side-effect-free (or safe in HTTP parlance), or idempotent, - or neither? HTTP based RPC implementation may choose GET verb for safe - methods, and PUT verb for idempotent methods instead of the default POST. - """ - - IDEMPOTENCY_UNKNOWN = 0 - - NO_SIDE_EFFECTS = 1 - """ - implies idempotent - """ - - IDEMPOTENT = 2 - """ - idempotent, but may have side effects - """ - - -class NullValue(betterproto2.Enum): - """ - `NullValue` is a singleton enumeration to represent the null value for the - `Value` type union. - - The JSON representation for `NullValue` is JSON `null`. - """ - - _ = 0 - """ - Null value. - """ - - -class Syntax(betterproto2.Enum): - """ - The syntax in which a protocol buffer element is defined. - """ - - PROTO2 = 0 - """ - Syntax `proto2`. - """ - - PROTO3 = 1 - """ - Syntax `proto3`. - """ - - -@dataclass(eq=False, repr=False) -class Any(betterproto2.Message): - """ - `Any` contains an arbitrary serialized protocol buffer message along with a - URL that describes the type of the serialized message. - - Protobuf library provides support to pack/unpack Any values in the form - of utility functions or additional generated methods of the Any type. - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - 'type.googleapis.com/full.type.name' as the type URL and the unpack - methods only use the fully qualified type name after the last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". - - JSON - ==== - The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a field - `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - - """ - - type_url: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - """ - A URL/resource name that uniquely identifies the type of the serialized - protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must represent - the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a canonical form - (e.g., leading "." is not accepted). - - In practice, teams usually precompile into the binary all types that they - expect it to use in the context of Any. However, for URLs which use the - scheme `http`, `https`, or no scheme, one can optionally set up a type - server that maps type URLs to message definitions as follows: - - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the official - protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. - - Schemes other than `http`, `https` (or the empty scheme) might be - used with implementation specific semantics. - """ - value: "bytes" = betterproto2.field(2, betterproto2.TYPE_BYTES) - """ - Must be a valid serialized protocol buffer of the above specified type. - """ - - -@dataclass(eq=False, repr=False) -class Api(betterproto2.Message): - """ - Api is a light-weight descriptor for an API Interface. - - Interfaces are also described as "protocol buffer services" in some contexts, - such as by the "service" keyword in a .proto file, but they are different - from API Services, which represent a concrete implementation of an interface - as opposed to simply a description of methods and bindings. They are also - sometimes simply referred to as "APIs" in other contexts, such as the name of - this message itself. See https://cloud.google.com/apis/design/glossary for - detailed terminology. - - """ - - name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - """ - The fully qualified name of this interface, including package name - followed by the interface's simple name. - """ - methods: "List[Method]" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, repeated=True) - """ - The methods of this interface, in unspecified order. - """ - options: "List[Option]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, repeated=True) - """ - Any metadata attached to the interface. - """ - version: "str" = betterproto2.field(4, betterproto2.TYPE_STRING) - """ - A version string for this interface. If specified, must have the form - `major-version.minor-version`, as in `1.10`. If the minor version is - omitted, it defaults to zero. If the entire version field is empty, the - major version is derived from the package name, as outlined below. If the - field is not empty, the version in the package name will be verified to be - consistent with what is provided here. - - The versioning schema uses [semantic - versioning](http://semver.org) where the major version number - indicates a breaking change and the minor version an additive, - non-breaking change. Both version numbers are signals to users - what to expect from different versions, and should be carefully - chosen based on the product plan. - - The major version is also reflected in the package name of the - interface, which must end in `v`, as in - `google.feature.v1`. For major versions 0 and 1, the suffix can - be omitted. Zero major versions must only be used for - experimental, non-GA interfaces. - """ - source_context: "Optional[SourceContext]" = betterproto2.field(5, betterproto2.TYPE_MESSAGE, optional=True) - """ - Source context for the protocol buffer service represented by this - message. - """ - mixins: "List[Mixin]" = betterproto2.field(6, betterproto2.TYPE_MESSAGE, repeated=True) - """ - Included interfaces. See [Mixin][]. - """ - syntax: "Syntax" = betterproto2.field(7, betterproto2.TYPE_ENUM, default_factory=lambda: Syntax.try_value(0)) - """ - The source syntax of the service. - """ - - -@dataclass(eq=False, repr=False) -class BoolValue(betterproto2.Message): - """ - Wrapper message for `bool`. - - The JSON representation for `BoolValue` is JSON `true` and `false`. - - """ - - value: "bool" = betterproto2.field(1, betterproto2.TYPE_BOOL) - """ - The bool value. - """ - - -@dataclass(eq=False, repr=False) -class BytesValue(betterproto2.Message): - """ - Wrapper message for `bytes`. - - The JSON representation for `BytesValue` is JSON string. - - """ - - value: "bytes" = betterproto2.field(1, betterproto2.TYPE_BYTES) - """ - The bytes value. - """ - - -@dataclass(eq=False, repr=False) -class DescriptorProto(betterproto2.Message): - """ - Describes a message type. - - """ - - name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - field: "List[FieldDescriptorProto]" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, repeated=True) - extension: "List[FieldDescriptorProto]" = betterproto2.field(6, betterproto2.TYPE_MESSAGE, repeated=True) - nested_type: "List[DescriptorProto]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, repeated=True) - enum_type: "List[EnumDescriptorProto]" = betterproto2.field(4, betterproto2.TYPE_MESSAGE, repeated=True) - extension_range: "List[DescriptorProtoExtensionRange]" = betterproto2.field( - 5, betterproto2.TYPE_MESSAGE, repeated=True - ) - oneof_decl: "List[OneofDescriptorProto]" = betterproto2.field(8, betterproto2.TYPE_MESSAGE, repeated=True) - options: "Optional[MessageOptions]" = betterproto2.field(7, betterproto2.TYPE_MESSAGE, optional=True) - reserved_range: "List[DescriptorProtoReservedRange]" = betterproto2.field( - 9, betterproto2.TYPE_MESSAGE, repeated=True - ) - reserved_name: "List[str]" = betterproto2.field(10, betterproto2.TYPE_STRING, repeated=True) - """ - Reserved field names, which may not be used by fields in the same message. - A given name may only be reserved once. - """ - - -@dataclass(eq=False, repr=False) -class DescriptorProtoExtensionRange(betterproto2.Message): - start: "int" = betterproto2.field(1, betterproto2.TYPE_INT32) - """ - Inclusive. - """ - end: "int" = betterproto2.field(2, betterproto2.TYPE_INT32) - """ - Exclusive. - """ - options: "Optional[ExtensionRangeOptions]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, optional=True) - - -@dataclass(eq=False, repr=False) -class DescriptorProtoReservedRange(betterproto2.Message): - """ - Range of reserved tag numbers. Reserved tag numbers may not be used by - fields or extension ranges in the same message. Reserved ranges may - not overlap. - - """ - - start: "int" = betterproto2.field(1, betterproto2.TYPE_INT32) - """ - Inclusive. - """ - end: "int" = betterproto2.field(2, betterproto2.TYPE_INT32) - """ - Exclusive. - """ - - -@dataclass(eq=False, repr=False) -class DoubleValue(betterproto2.Message): - """ - Wrapper message for `double`. - - The JSON representation for `DoubleValue` is JSON number. - - """ - - value: "float" = betterproto2.field(1, betterproto2.TYPE_DOUBLE) - """ - The double value. - """ - - -@dataclass(eq=False, repr=False) -class Duration(betterproto2.Message): - """ - A Duration represents a signed, fixed-length span of time represented - as a count of seconds and fractions of seconds at nanosecond - resolution. It is independent of any calendar and concepts like "day" - or "month". It is related to Timestamp in that the difference between - two Timestamp values is a Duration and it can be added or subtracted - from a Timestamp. Range is approximately +-10,000 years. - - # Examples - - Example 1: Compute Duration from two Timestamps in pseudo code. - - Timestamp start = ...; - Timestamp end = ...; - Duration duration = ...; - - duration.seconds = end.seconds - start.seconds; - duration.nanos = end.nanos - start.nanos; - - if (duration.seconds < 0 && duration.nanos > 0) { - duration.seconds += 1; - duration.nanos -= 1000000000; - } else if (duration.seconds > 0 && duration.nanos < 0) { - duration.seconds -= 1; - duration.nanos += 1000000000; - } - - Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - - Timestamp start = ...; - Duration duration = ...; - Timestamp end = ...; - - end.seconds = start.seconds + duration.seconds; - end.nanos = start.nanos + duration.nanos; - - if (end.nanos < 0) { - end.seconds -= 1; - end.nanos += 1000000000; - } else if (end.nanos >= 1000000000) { - end.seconds += 1; - end.nanos -= 1000000000; - } - - Example 3: Compute Duration from datetime.timedelta in Python. - - td = datetime.timedelta(days=3, minutes=10) - duration = Duration() - duration.FromTimedelta(td) - - # JSON Mapping - - In JSON format, the Duration type is encoded as a string rather than an - object, where the string ends in the suffix "s" (indicating seconds) and - is preceded by the number of seconds, with nanoseconds expressed as - fractional seconds. For example, 3 seconds with 0 nanoseconds should be - encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - microsecond should be expressed in JSON format as "3.000001s". - - """ - - seconds: "int" = betterproto2.field(1, betterproto2.TYPE_INT64) - """ - Signed seconds of the span of time. Must be from -315,576,000,000 - to +315,576,000,000 inclusive. Note: these bounds are computed from: - 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - """ - nanos: "int" = betterproto2.field(2, betterproto2.TYPE_INT32) - """ - Signed fractions of a second at nanosecond resolution of the span - of time. Durations less than one second are represented with a 0 - `seconds` field and a positive or negative `nanos` field. For durations - of one second or more, a non-zero value for the `nanos` field must be - of the same sign as the `seconds` field. Must be from -999,999,999 - to +999,999,999 inclusive. - """ - - -@dataclass(eq=False, repr=False) -class Empty(betterproto2.Message): - """ - A generic empty message that you can re-use to avoid defining duplicated - empty messages in your APIs. A typical example is to use it as the request - or the response type of an API method. For instance: - - service Foo { - rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - } - - The JSON representation for `Empty` is empty JSON object `{}`. - - """ - - pass - - -@dataclass(eq=False, repr=False) -class Enum(betterproto2.Message): - """ - Enum type definition. - - """ - - name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - """ - Enum type name. - """ - enumvalue: "List[EnumValue]" = betterproto2.field( - 2, betterproto2.TYPE_MESSAGE, wraps=betterproto2.TYPE_ENUM, repeated=True - ) - """ - Enum value definitions. - """ - options: "List[Option]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, repeated=True) - """ - Protocol buffer options. - """ - source_context: "Optional[SourceContext]" = betterproto2.field(4, betterproto2.TYPE_MESSAGE, optional=True) - """ - The source context. - """ - syntax: "Syntax" = betterproto2.field(5, betterproto2.TYPE_ENUM, default_factory=lambda: Syntax.try_value(0)) - """ - The source syntax. - """ - - -@dataclass(eq=False, repr=False) -class EnumDescriptorProto(betterproto2.Message): - """ - Describes an enum type. - - """ - - name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - value: "List[EnumValueDescriptorProto]" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, repeated=True) - options: "Optional[EnumOptions]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, optional=True) - reserved_range: "List[EnumDescriptorProtoEnumReservedRange]" = betterproto2.field( - 4, betterproto2.TYPE_MESSAGE, repeated=True - ) - """ - Range of reserved numeric values. Reserved numeric values may not be used - by enum values in the same enum declaration. Reserved ranges may not - overlap. - """ - reserved_name: "List[str]" = betterproto2.field(5, betterproto2.TYPE_STRING, repeated=True) - """ - Reserved enum value names, which may not be reused. A given name may only - be reserved once. - """ - - -@dataclass(eq=False, repr=False) -class EnumDescriptorProtoEnumReservedRange(betterproto2.Message): - """ - Range of reserved numeric values. Reserved values may not be used by - entries in the same enum. Reserved ranges may not overlap. - - Note that this is distinct from DescriptorProto.ReservedRange in that it - is inclusive such that it can appropriately represent the entire int32 - domain. - - """ - - start: "int" = betterproto2.field(1, betterproto2.TYPE_INT32) - """ - Inclusive. - """ - end: "int" = betterproto2.field(2, betterproto2.TYPE_INT32) - """ - Inclusive. - """ - - -@dataclass(eq=False, repr=False) -class EnumOptions(betterproto2.Message): - allow_alias: "bool" = betterproto2.field(2, betterproto2.TYPE_BOOL) - """ - Set this option to true to allow mapping different tag names to the same - value. - """ - deprecated: "bool" = betterproto2.field(3, betterproto2.TYPE_BOOL) - """ - Is this enum deprecated? - Depending on the target platform, this can emit Deprecated annotations - for the enum, or it will be completely ignored; in the very least, this - is a formalization for deprecating enums. - """ - uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( - 999, betterproto2.TYPE_MESSAGE, repeated=True - ) - """ - The parser stores options it doesn't recognize here. See above. - """ - - -@dataclass(eq=False, repr=False) -class EnumValue(betterproto2.Message): - """ - Enum value definition. - - """ - - name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - """ - Enum value name. - """ - number: "int" = betterproto2.field(2, betterproto2.TYPE_INT32) - """ - Enum value number. - """ - options: "List[Option]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, repeated=True) - """ - Protocol buffer options. - """ - - -@dataclass(eq=False, repr=False) -class EnumValueDescriptorProto(betterproto2.Message): - """ - Describes a value within an enum. - - """ - - name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - number: "int" = betterproto2.field(2, betterproto2.TYPE_INT32) - options: "Optional[EnumValueOptions]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, optional=True) - - -@dataclass(eq=False, repr=False) -class EnumValueOptions(betterproto2.Message): - deprecated: "bool" = betterproto2.field(1, betterproto2.TYPE_BOOL) - """ - Is this enum value deprecated? - Depending on the target platform, this can emit Deprecated annotations - for the enum value, or it will be completely ignored; in the very least, - this is a formalization for deprecating enum values. - """ - uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( - 999, betterproto2.TYPE_MESSAGE, repeated=True - ) - """ - The parser stores options it doesn't recognize here. See above. - """ - - -@dataclass(eq=False, repr=False) -class ExtensionRangeOptions(betterproto2.Message): - uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( - 999, betterproto2.TYPE_MESSAGE, repeated=True - ) - """ - The parser stores options it doesn't recognize here. See above. - """ - - -@dataclass(eq=False, repr=False) -class Field(betterproto2.Message): - """ - A single field of a message type. - - """ - - kind: "FieldKind" = betterproto2.field(1, betterproto2.TYPE_ENUM, default_factory=lambda: FieldKind.try_value(0)) - """ - The field type. - """ - cardinality: "FieldCardinality" = betterproto2.field( - 2, betterproto2.TYPE_ENUM, default_factory=lambda: FieldCardinality.try_value(0) - ) - """ - The field cardinality. - """ - number: "int" = betterproto2.field(3, betterproto2.TYPE_INT32) - """ - The field number. - """ - name: "str" = betterproto2.field(4, betterproto2.TYPE_STRING) - """ - The field name. - """ - type_url: "str" = betterproto2.field(6, betterproto2.TYPE_STRING) - """ - The field type URL, without the scheme, for message or enumeration - types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. - """ - oneof_index: "Optional[int]" = betterproto2.field(7, betterproto2.TYPE_INT32, optional=True) - """ - The index of the field type in `Type.oneofs`, for message or enumeration - types. The first type has index 1; zero means the type is not in the list. - """ - packed: "bool" = betterproto2.field(8, betterproto2.TYPE_BOOL) - """ - Whether to use alternative packed wire representation. - """ - options: "List[Option]" = betterproto2.field(9, betterproto2.TYPE_MESSAGE, repeated=True) - """ - The protocol buffer options. - """ - json_name: "str" = betterproto2.field(10, betterproto2.TYPE_STRING) - """ - The field JSON name. - """ - default_value: "str" = betterproto2.field(11, betterproto2.TYPE_STRING) - """ - The string value of the default value of this field. Proto2 syntax only. - """ - - -@dataclass(eq=False, repr=False) -class FieldDescriptorProto(betterproto2.Message): - """ - Describes a field within a message. - - """ - - name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - number: "int" = betterproto2.field(3, betterproto2.TYPE_INT32) - label: "FieldDescriptorProtoLabel" = betterproto2.field( - 4, betterproto2.TYPE_ENUM, default_factory=lambda: FieldDescriptorProtoLabel.try_value(0) - ) - type: "FieldDescriptorProtoType" = betterproto2.field( - 5, betterproto2.TYPE_ENUM, default_factory=lambda: FieldDescriptorProtoType.try_value(0) - ) - """ - If type_name is set, this need not be set. If both this and type_name - are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - """ - type_name: "str" = betterproto2.field(6, betterproto2.TYPE_STRING) - """ - For message and enum types, this is the name of the type. If the name - starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - rules are used to find the type (i.e. first the nested types within this - message are searched, then within the parent, on up to the root - namespace). - """ - extendee: "str" = betterproto2.field(2, betterproto2.TYPE_STRING) - """ - For extensions, this is the name of the type being extended. It is - resolved in the same manner as type_name. - """ - default_value: "str" = betterproto2.field(7, betterproto2.TYPE_STRING) - """ - For numeric types, contains the original text representation of the value. - For booleans, "true" or "false". - For strings, contains the default text contents (not escaped in any way). - For bytes, contains the C escaped value. All bytes >= 128 are escaped. - TODO(kenton): Base-64 encode? - """ - oneof_index: "Optional[int]" = betterproto2.field(9, betterproto2.TYPE_INT32, optional=True) - """ - If set, gives the index of a oneof in the containing type's oneof_decl - list. This field is a member of that oneof. - """ - json_name: "str" = betterproto2.field(10, betterproto2.TYPE_STRING) - """ - JSON name of this field. The value is set by protocol compiler. If the - user has set a "json_name" option on this field, that option's value - will be used. Otherwise, it's deduced from the field's name by converting - it to camelCase. - """ - options: "Optional[FieldOptions]" = betterproto2.field(8, betterproto2.TYPE_MESSAGE, optional=True) - proto3_optional: "bool" = betterproto2.field(17, betterproto2.TYPE_BOOL) - """ - If true, this is a proto3 "optional". When a proto3 field is optional, it - tracks presence regardless of field type. - - When proto3_optional is true, this field must be belong to a oneof to - signal to old proto3 clients that presence is tracked for this field. This - oneof is known as a "synthetic" oneof, and this field must be its sole - member (each proto3 optional field gets its own synthetic oneof). Synthetic - oneofs exist in the descriptor only, and do not generate any API. Synthetic - oneofs must be ordered after all "real" oneofs. - - For message fields, proto3_optional doesn't create any semantic change, - since non-repeated message fields always track presence. However it still - indicates the semantic detail of whether the user wrote "optional" or not. - This can be useful for round-tripping the .proto file. For consistency we - give message fields a synthetic oneof also, even though it is not required - to track presence. This is especially important because the parser can't - tell if a field is a message or an enum, so it must always create a - synthetic oneof. - - Proto2 optional fields do not set this flag, because they already indicate - optional with `LABEL_OPTIONAL`. - """ - - -@dataclass(eq=False, repr=False) -class FieldMask(betterproto2.Message): - """ - `FieldMask` represents a set of symbolic field paths, for example: - - paths: "f.a" - paths: "f.b.d" - - Here `f` represents a field in some root message, `a` and `b` - fields in the message found in `f`, and `d` a field found in the - message in `f.b`. - - Field masks are used to specify a subset of fields that should be - returned by a get operation or modified by an update operation. - Field masks also have a custom JSON encoding (see below). - - # Field Masks in Projections - - When used in the context of a projection, a response message or - sub-message is filtered by the API to only contain those fields as - specified in the mask. For example, if the mask in the previous - example is applied to a response message as follows: - - f { - a : 22 - b { - d : 1 - x : 2 - } - y : 13 - } - z: 8 - - The result will not contain specific values for fields x,y and z - (their value will be set to the default, and omitted in proto text - output): - - f { - a : 22 - b { - d : 1 - } - } - - A repeated field is not allowed except at the last position of a - paths string. - - If a FieldMask object is not present in a get operation, the - operation applies to all fields (as if a FieldMask of all fields - had been specified). - - Note that a field mask does not necessarily apply to the - top-level response message. In case of a REST get operation, the - field mask applies directly to the response, but in case of a REST - list operation, the mask instead applies to each individual message - in the returned resource list. In case of a REST custom method, - other definitions may be used. Where the mask applies will be - clearly documented together with its declaration in the API. In - any case, the effect on the returned resource/resources is required - behavior for APIs. - - # Field Masks in Update Operations - - A field mask in update operations specifies which fields of the - targeted resource are going to be updated. The API is required - to only change the values of the fields as specified in the mask - and leave the others untouched. If a resource is passed in to - describe the updated values, the API ignores the values of all - fields not covered by the mask. - - If a repeated field is specified for an update operation, new values will - be appended to the existing repeated field in the target resource. Note that - a repeated field is only allowed in the last position of a `paths` string. - - If a sub-message is specified in the last position of the field mask for an - update operation, then new value will be merged into the existing sub-message - in the target resource. - - For example, given the target message: - - f { - b { - d: 1 - x: 2 - } - c: [1] - } - - And an update message: - - f { - b { - d: 10 - } - c: [2] - } - - then if the field mask is: - - paths: ["f.b", "f.c"] - - then the result will be: - - f { - b { - d: 10 - x: 2 - } - c: [1, 2] - } - - An implementation may provide options to override this default behavior for - repeated and message fields. - - In order to reset a field's value to the default, the field must - be in the mask and set to the default value in the provided resource. - Hence, in order to reset all fields of a resource, provide a default - instance of the resource and set all fields in the mask, or do - not provide a mask as described below. - - If a field mask is not present on update, the operation applies to - all fields (as if a field mask of all fields has been specified). - Note that in the presence of schema evolution, this may mean that - fields the client does not know and has therefore not filled into - the request will be reset to their default. If this is unwanted - behavior, a specific service may require a client to always specify - a field mask, producing an error if not. - - As with get operations, the location of the resource which - describes the updated values in the request message depends on the - operation kind. In any case, the effect of the field mask is - required to be honored by the API. - - ## Considerations for HTTP REST - - The HTTP kind of an update operation which uses a field mask must - be set to PATCH instead of PUT in order to satisfy HTTP semantics - (PUT must only be used for full updates). - - # JSON Encoding of Field Masks - - In JSON, a field mask is encoded as a single string where paths are - separated by a comma. Fields name in each path are converted - to/from lower-camel naming conventions. - - As an example, consider the following message declarations: - - message Profile { - User user = 1; - Photo photo = 2; - } - message User { - string display_name = 1; - string address = 2; - } - - In proto a field mask for `Profile` may look as such: - - mask { - paths: "user.display_name" - paths: "photo" - } - - In JSON, the same mask is represented as below: - - { - mask: "user.displayName,photo" - } - - # Field Masks and Oneof Fields - - Field masks treat fields in oneofs just as regular fields. Consider the - following message: - - message SampleMessage { - oneof test_oneof { - string name = 4; - SubMessage sub_message = 9; - } - } - - The field mask can be: - - mask { - paths: "name" - } - - Or: - - mask { - paths: "sub_message" - } - - Note that oneof type names ("test_oneof" in this case) cannot be used in - paths. - - ## Field Mask Verification - - The implementation of any API method which has a FieldMask type field in the - request should verify the included field paths, and return an - `INVALID_ARGUMENT` error if any path is unmappable. - - """ - - paths: "List[str]" = betterproto2.field(1, betterproto2.TYPE_STRING, repeated=True) - """ - The set of field mask paths. - """ - - -@dataclass(eq=False, repr=False) -class FieldOptions(betterproto2.Message): - ctype: "FieldOptionsCType" = betterproto2.field( - 1, betterproto2.TYPE_ENUM, default_factory=lambda: FieldOptionsCType.try_value(0) - ) - """ - The ctype option instructs the C++ code generator to use a different - representation of the field than it normally would. See the specific - options below. This option is not yet implemented in the open source - release -- sorry, we'll try to include it in a future version! - """ - packed: "bool" = betterproto2.field(2, betterproto2.TYPE_BOOL) - """ - The packed option can be enabled for repeated primitive fields to enable - a more efficient representation on the wire. Rather than repeatedly - writing the tag and type for each element, the entire array is encoded as - a single length-delimited blob. In proto3, only explicit setting it to - false will avoid using packed encoding. - """ - jstype: "FieldOptionsJsType" = betterproto2.field( - 6, betterproto2.TYPE_ENUM, default_factory=lambda: FieldOptionsJsType.try_value(0) - ) - """ - The jstype option determines the JavaScript type used for values of the - field. The option is permitted only for 64 bit integral and fixed types - (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - is represented as JavaScript string, which avoids loss of precision that - can happen when a large value is converted to a floating point JavaScript. - Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - use the JavaScript "number" type. The behavior of the default option - JS_NORMAL is implementation dependent. - - This option is an enum to permit additional types to be added, e.g. - goog.math.Integer. - """ - lazy: "bool" = betterproto2.field(5, betterproto2.TYPE_BOOL) - """ - Should this field be parsed lazily? Lazy applies only to message-type - fields. It means that when the outer message is initially parsed, the - inner message's contents will not be parsed but instead stored in encoded - form. The inner message will actually be parsed when it is first accessed. - - This is only a hint. Implementations are free to choose whether to use - eager or lazy parsing regardless of the value of this option. However, - setting this option true suggests that the protocol author believes that - using lazy parsing on this field is worth the additional bookkeeping - overhead typically needed to implement it. - - This option does not affect the public interface of any generated code; - all method signatures remain the same. Furthermore, thread-safety of the - interface is not affected by this option; const methods remain safe to - call from multiple threads concurrently, while non-const methods continue - to require exclusive access. - - Note that implementations may choose not to check required fields within - a lazy sub-message. That is, calling IsInitialized() on the outer message - may return true even if the inner message has missing required fields. - This is necessary because otherwise the inner message would have to be - parsed in order to perform the check, defeating the purpose of lazy - parsing. An implementation which chooses not to check required fields - must be consistent about it. That is, for any particular sub-message, the - implementation must either *always* check its required fields, or *never* - check its required fields, regardless of whether or not the message has - been parsed. - """ - deprecated: "bool" = betterproto2.field(3, betterproto2.TYPE_BOOL) - """ - Is this field deprecated? - Depending on the target platform, this can emit Deprecated annotations - for accessors, or it will be completely ignored; in the very least, this - is a formalization for deprecating fields. - """ - weak: "bool" = betterproto2.field(10, betterproto2.TYPE_BOOL) - """ - For Google-internal migration only. Do not use. - """ - uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( - 999, betterproto2.TYPE_MESSAGE, repeated=True - ) - """ - The parser stores options it doesn't recognize here. See above. - """ - - -@dataclass(eq=False, repr=False) -class FileDescriptorProto(betterproto2.Message): - """ - Describes a complete .proto file. - - """ - - name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - """ - file name, relative to root of source tree - """ - package: "str" = betterproto2.field(2, betterproto2.TYPE_STRING) - """ - e.g. "foo", "foo.bar", etc. - """ - dependency: "List[str]" = betterproto2.field(3, betterproto2.TYPE_STRING, repeated=True) - """ - Names of files imported by this file. - """ - public_dependency: "List[int]" = betterproto2.field(10, betterproto2.TYPE_INT32, repeated=True) - """ - Indexes of the public imported files in the dependency list above. - """ - weak_dependency: "List[int]" = betterproto2.field(11, betterproto2.TYPE_INT32, repeated=True) - """ - Indexes of the weak imported files in the dependency list. - For Google-internal migration only. Do not use. - """ - message_type: "List[DescriptorProto]" = betterproto2.field(4, betterproto2.TYPE_MESSAGE, repeated=True) - """ - All top-level definitions in this file. - """ - enum_type: "List[EnumDescriptorProto]" = betterproto2.field(5, betterproto2.TYPE_MESSAGE, repeated=True) - service: "List[ServiceDescriptorProto]" = betterproto2.field(6, betterproto2.TYPE_MESSAGE, repeated=True) - extension: "List[FieldDescriptorProto]" = betterproto2.field(7, betterproto2.TYPE_MESSAGE, repeated=True) - options: "Optional[FileOptions]" = betterproto2.field(8, betterproto2.TYPE_MESSAGE, optional=True) - source_code_info: "Optional[SourceCodeInfo]" = betterproto2.field(9, betterproto2.TYPE_MESSAGE, optional=True) - """ - This field contains optional information about the original source code. - You may safely remove this entire field without harming runtime - functionality of the descriptors -- the information is needed only by - development tools. - """ - syntax: "str" = betterproto2.field(12, betterproto2.TYPE_STRING) - """ - The syntax of the proto file. - The supported values are "proto2" and "proto3". - """ - - -@dataclass(eq=False, repr=False) -class FileDescriptorSet(betterproto2.Message): - """ - The protocol compiler can output a FileDescriptorSet containing the .proto - files it parses. - - """ - - file: "List[FileDescriptorProto]" = betterproto2.field(1, betterproto2.TYPE_MESSAGE, repeated=True) - - -@dataclass(eq=False, repr=False) -class FileOptions(betterproto2.Message): - """ - =================================================================== - Options - - Each of the definitions above may have "options" attached. These are - just annotations which may cause code to be generated slightly differently - or may contain hints for code that manipulates protocol messages. - - Clients may define custom options as extensions of the *Options messages. - These extensions may not yet be known at parsing time, so the parser cannot - store the values in them. Instead it stores them in a field in the *Options - message called uninterpreted_option. This field must have the same name - across all *Options messages. We then use this field to populate the - extensions when we build a descriptor, at which point all protos have been - parsed and so all extensions are known. - - Extension numbers for custom options may be chosen as follows: - * For options which will only be used within a single application or - organization, or for experimental options, use field numbers 50000 - through 99999. It is up to you to ensure that you do not use the - same number for multiple options. - * For options which will be published and used publicly by multiple - independent entities, e-mail protobuf-global-extension-registry@google.com - to reserve extension numbers. Simply provide your project name (e.g. - Objective-C plugin) and your project website (if available) -- there's no - need to explain how you intend to use them. Usually you only need one - extension number. You can declare multiple options with only one extension - number by putting them in a sub-message. See the Custom Options section of - the docs for examples: - https://developers.google.com/protocol-buffers/docs/proto#options - If this turns out to be popular, a web service will be set up - to automatically assign option numbers. - - """ - - java_package: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - """ - Sets the Java package where classes generated from this .proto will be - placed. By default, the proto package is used, but this is often - inappropriate because proto packages do not normally start with backwards - domain names. - """ - java_outer_classname: "str" = betterproto2.field(8, betterproto2.TYPE_STRING) - """ - If set, all the classes from the .proto file are wrapped in a single - outer class with the given name. This applies to both Proto1 - (equivalent to the old "--one_java_file" option) and Proto2 (where - a .proto always translates to a single class, but you may want to - explicitly choose the class name). - """ - java_multiple_files: "bool" = betterproto2.field(10, betterproto2.TYPE_BOOL) - """ - If set true, then the Java code generator will generate a separate .java - file for each top-level message, enum, and service defined in the .proto - file. Thus, these types will *not* be nested inside the outer class - named by java_outer_classname. However, the outer class will still be - generated to contain the file's getDescriptor() method as well as any - top-level extensions defined in the file. - """ - java_generate_equals_and_hash: "bool" = betterproto2.field(20, betterproto2.TYPE_BOOL) - """ - This option does nothing. - """ - java_string_check_utf8: "bool" = betterproto2.field(27, betterproto2.TYPE_BOOL) - """ - If set true, then the Java2 code generator will generate code that - throws an exception whenever an attempt is made to assign a non-UTF-8 - byte sequence to a string field. - Message reflection will do the same. - However, an extension field still accepts non-UTF-8 byte sequences. - This option has no effect on when used with the lite runtime. - """ - optimize_for: "FileOptionsOptimizeMode" = betterproto2.field( - 9, betterproto2.TYPE_ENUM, default_factory=lambda: FileOptionsOptimizeMode.try_value(0) - ) - go_package: "str" = betterproto2.field(11, betterproto2.TYPE_STRING) - """ - Sets the Go package where structs generated from this .proto will be - placed. If omitted, the Go package will be derived from the following: - - The basename of the package import path, if provided. - - Otherwise, the package statement in the .proto file, if present. - - Otherwise, the basename of the .proto file, without extension. - """ - cc_generic_services: "bool" = betterproto2.field(16, betterproto2.TYPE_BOOL) - """ - Should generic services be generated in each language? "Generic" services - are not specific to any particular RPC system. They are generated by the - main code generators in each language (without additional plugins). - Generic services were the only kind of service generation supported by - early versions of google.protobuf. - - Generic services are now considered deprecated in favor of using plugins - that generate code specific to your particular RPC system. Therefore, - these default to false. Old code which depends on generic services should - explicitly set them to true. - """ - java_generic_services: "bool" = betterproto2.field(17, betterproto2.TYPE_BOOL) - py_generic_services: "bool" = betterproto2.field(18, betterproto2.TYPE_BOOL) - php_generic_services: "bool" = betterproto2.field(42, betterproto2.TYPE_BOOL) - deprecated: "bool" = betterproto2.field(23, betterproto2.TYPE_BOOL) - """ - Is this file deprecated? - Depending on the target platform, this can emit Deprecated annotations - for everything in the file, or it will be completely ignored; in the very - least, this is a formalization for deprecating files. - """ - cc_enable_arenas: "bool" = betterproto2.field(31, betterproto2.TYPE_BOOL) - """ - Enables the use of arenas for the proto messages in this file. This applies - only to generated classes for C++. - """ - objc_class_prefix: "str" = betterproto2.field(36, betterproto2.TYPE_STRING) - """ - Sets the objective c class prefix which is prepended to all objective c - generated classes from this .proto. There is no default. - """ - csharp_namespace: "str" = betterproto2.field(37, betterproto2.TYPE_STRING) - """ - Namespace for generated classes; defaults to the package. - """ - swift_prefix: "str" = betterproto2.field(39, betterproto2.TYPE_STRING) - """ - By default Swift generators will take the proto package and CamelCase it - replacing '.' with underscore and use that to prefix the types/symbols - defined. When this options is provided, they will use this value instead - to prefix the types/symbols defined. - """ - php_class_prefix: "str" = betterproto2.field(40, betterproto2.TYPE_STRING) - """ - Sets the php class prefix which is prepended to all php generated classes - from this .proto. Default is empty. - """ - php_namespace: "str" = betterproto2.field(41, betterproto2.TYPE_STRING) - """ - Use this option to change the namespace of php generated classes. Default - is empty. When this option is empty, the package name will be used for - determining the namespace. - """ - php_metadata_namespace: "str" = betterproto2.field(44, betterproto2.TYPE_STRING) - """ - Use this option to change the namespace of php generated metadata classes. - Default is empty. When this option is empty, the proto file name will be - used for determining the namespace. - """ - ruby_package: "str" = betterproto2.field(45, betterproto2.TYPE_STRING) - """ - Use this option to change the package of ruby generated classes. Default - is empty. When this option is not set, the package name will be used for - determining the ruby package. - """ - uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( - 999, betterproto2.TYPE_MESSAGE, repeated=True - ) - """ - The parser stores options it doesn't recognize here. - See the documentation for the "Options" section above. - """ - - def __post_init__(self) -> None: - super().__post_init__() - if self.is_set("java_generate_equals_and_hash"): - warnings.warn("FileOptions.java_generate_equals_and_hash is deprecated", DeprecationWarning) - - -@dataclass(eq=False, repr=False) -class FloatValue(betterproto2.Message): - """ - Wrapper message for `float`. - - The JSON representation for `FloatValue` is JSON number. - - """ - - value: "float" = betterproto2.field(1, betterproto2.TYPE_FLOAT) - """ - The float value. - """ - - -@dataclass(eq=False, repr=False) -class GeneratedCodeInfo(betterproto2.Message): - """ - Describes the relationship between generated code and its original source - file. A GeneratedCodeInfo message is associated with only one generated - source file, but may contain references to different source .proto files. - - """ - - annotation: "List[GeneratedCodeInfoAnnotation]" = betterproto2.field(1, betterproto2.TYPE_MESSAGE, repeated=True) - """ - An Annotation connects some span of text in generated code to an element - of its generating .proto file. - """ - - -@dataclass(eq=False, repr=False) -class GeneratedCodeInfoAnnotation(betterproto2.Message): - path: "List[int]" = betterproto2.field(1, betterproto2.TYPE_INT32, repeated=True) - """ - Identifies the element in the original source .proto file. This field - is formatted the same as SourceCodeInfo.Location.path. - """ - source_file: "str" = betterproto2.field(2, betterproto2.TYPE_STRING) - """ - Identifies the filesystem path to the original source .proto. - """ - begin: "int" = betterproto2.field(3, betterproto2.TYPE_INT32) - """ - Identifies the starting offset in bytes in the generated code - that relates to the identified object. - """ - end: "int" = betterproto2.field(4, betterproto2.TYPE_INT32) - """ - Identifies the ending offset in bytes in the generated code that - relates to the identified offset. The end offset should be one past - the last relevant byte (so the length of the text = end - begin). - """ - - -@dataclass(eq=False, repr=False) -class Int32Value(betterproto2.Message): - """ - Wrapper message for `int32`. - - The JSON representation for `Int32Value` is JSON number. - - """ - - value: "int" = betterproto2.field(1, betterproto2.TYPE_INT32) - """ - The int32 value. - """ - - -@dataclass(eq=False, repr=False) -class Int64Value(betterproto2.Message): - """ - Wrapper message for `int64`. - - The JSON representation for `Int64Value` is JSON string. - - """ - - value: "int" = betterproto2.field(1, betterproto2.TYPE_INT64) - """ - The int64 value. - """ - - -@dataclass(eq=False, repr=False) -class ListValue(betterproto2.Message): - """ - `ListValue` is a wrapper around a repeated field of values. - - The JSON representation for `ListValue` is JSON array. - - """ - - values: "List[Value]" = betterproto2.field(1, betterproto2.TYPE_MESSAGE, repeated=True) - """ - Repeated field of dynamically typed values. - """ - - -@dataclass(eq=False, repr=False) -class MessageOptions(betterproto2.Message): - message_set_wire_format: "bool" = betterproto2.field(1, betterproto2.TYPE_BOOL) - """ - Set true to use the old proto1 MessageSet wire format for extensions. - This is provided for backwards-compatibility with the MessageSet wire - format. You should not use this for any other reason: It's less - efficient, has fewer features, and is more complicated. - - The message must be defined exactly as follows: - message Foo { - option message_set_wire_format = true; - extensions 4 to max; - } - Note that the message cannot have any defined fields; MessageSets only - have extensions. - - All extensions of your type must be singular messages; e.g. they cannot - be int32s, enums, or repeated messages. - - Because this is an option, the above two restrictions are not enforced by - the protocol compiler. - """ - no_standard_descriptor_accessor: "bool" = betterproto2.field(2, betterproto2.TYPE_BOOL) - """ - Disables the generation of the standard "descriptor()" accessor, which can - conflict with a field of the same name. This is meant to make migration - from proto1 easier; new code should avoid fields named "descriptor". - """ - deprecated: "bool" = betterproto2.field(3, betterproto2.TYPE_BOOL) - """ - Is this message deprecated? - Depending on the target platform, this can emit Deprecated annotations - for the message, or it will be completely ignored; in the very least, - this is a formalization for deprecating messages. - """ - map_entry: "bool" = betterproto2.field(7, betterproto2.TYPE_BOOL) - """ - Whether the message is an automatically generated map entry type for the - maps field. - - For maps fields: - map map_field = 1; - The parsed descriptor looks like: - message MapFieldEntry { - option map_entry = true; - optional KeyType key = 1; - optional ValueType value = 2; - } - repeated MapFieldEntry map_field = 1; - - Implementations may choose not to generate the map_entry=true message, but - use a native map in the target language to hold the keys and values. - The reflection APIs in such implementations still need to work as - if the field is a repeated message field. - - NOTE: Do not set the option in .proto files. Always use the maps syntax - instead. The option should only be implicitly set by the proto compiler - parser. - """ - uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( - 999, betterproto2.TYPE_MESSAGE, repeated=True - ) - """ - The parser stores options it doesn't recognize here. See above. - """ - - -@dataclass(eq=False, repr=False) -class Method(betterproto2.Message): - """ - Method represents a method of an API interface. - - """ - - name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - """ - The simple name of this method. - """ - request_type_url: "str" = betterproto2.field(2, betterproto2.TYPE_STRING) - """ - A URL of the input message type. - """ - request_streaming: "bool" = betterproto2.field(3, betterproto2.TYPE_BOOL) - """ - If true, the request is streamed. - """ - response_type_url: "str" = betterproto2.field(4, betterproto2.TYPE_STRING) - """ - The URL of the output message type. - """ - response_streaming: "bool" = betterproto2.field(5, betterproto2.TYPE_BOOL) - """ - If true, the response is streamed. - """ - options: "List[Option]" = betterproto2.field(6, betterproto2.TYPE_MESSAGE, repeated=True) - """ - Any metadata attached to the method. - """ - syntax: "Syntax" = betterproto2.field(7, betterproto2.TYPE_ENUM, default_factory=lambda: Syntax.try_value(0)) - """ - The source syntax of this method. - """ - - -@dataclass(eq=False, repr=False) -class MethodDescriptorProto(betterproto2.Message): - """ - Describes a method of a service. - - """ - - name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - input_type: "str" = betterproto2.field(2, betterproto2.TYPE_STRING) - """ - Input and output type names. These are resolved in the same way as - FieldDescriptorProto.type_name, but must refer to a message type. - """ - output_type: "str" = betterproto2.field(3, betterproto2.TYPE_STRING) - options: "Optional[MethodOptions]" = betterproto2.field(4, betterproto2.TYPE_MESSAGE, optional=True) - client_streaming: "bool" = betterproto2.field(5, betterproto2.TYPE_BOOL) - """ - Identifies if client streams multiple client messages - """ - server_streaming: "bool" = betterproto2.field(6, betterproto2.TYPE_BOOL) - """ - Identifies if server streams multiple server messages - """ - - -@dataclass(eq=False, repr=False) -class MethodOptions(betterproto2.Message): - deprecated: "bool" = betterproto2.field(33, betterproto2.TYPE_BOOL) - """ - Note: Field numbers 1 through 32 are reserved for Google's internal RPC - framework. We apologize for hoarding these numbers to ourselves, but - we were already using them long before we decided to release Protocol - Buffers. - - Is this method deprecated? - Depending on the target platform, this can emit Deprecated annotations - for the method, or it will be completely ignored; in the very least, - this is a formalization for deprecating methods. - """ - idempotency_level: "MethodOptionsIdempotencyLevel" = betterproto2.field( - 34, betterproto2.TYPE_ENUM, default_factory=lambda: MethodOptionsIdempotencyLevel.try_value(0) - ) - uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( - 999, betterproto2.TYPE_MESSAGE, repeated=True - ) - """ - The parser stores options it doesn't recognize here. See above. - """ - - -@dataclass(eq=False, repr=False) -class Mixin(betterproto2.Message): - """ - Declares an API Interface to be included in this interface. The including - interface must redeclare all the methods from the included interface, but - documentation and options are inherited as follows: - - - If after comment and whitespace stripping, the documentation - string of the redeclared method is empty, it will be inherited - from the original method. - - - Each annotation belonging to the service config (http, - visibility) which is not set in the redeclared method will be - inherited. - - - If an http annotation is inherited, the path pattern will be - modified as follows. Any version prefix will be replaced by the - version of the including interface plus the [root][] path if - specified. - - Example of a simple mixin: - - package google.acl.v1; - service AccessControl { - // Get the underlying ACL object. - rpc GetAcl(GetAclRequest) returns (Acl) { - option (google.api.http).get = "/v1/{resource=**}:getAcl"; - } - } - - package google.storage.v2; - service Storage { - rpc GetAcl(GetAclRequest) returns (Acl); - - // Get a data record. - rpc GetData(GetDataRequest) returns (Data) { - option (google.api.http).get = "/v2/{resource=**}"; - } - } - - Example of a mixin configuration: - - apis: - - name: google.storage.v2.Storage - mixins: - - name: google.acl.v1.AccessControl - - The mixin construct implies that all methods in `AccessControl` are - also declared with same name and request/response types in - `Storage`. A documentation generator or annotation processor will - see the effective `Storage.GetAcl` method after inherting - documentation and annotations as follows: - - service Storage { - // Get the underlying ACL object. - rpc GetAcl(GetAclRequest) returns (Acl) { - option (google.api.http).get = "/v2/{resource=**}:getAcl"; - } - ... - } - - Note how the version in the path pattern changed from `v1` to `v2`. - - If the `root` field in the mixin is specified, it should be a - relative path under which inherited HTTP paths are placed. Example: - - apis: - - name: google.storage.v2.Storage - mixins: - - name: google.acl.v1.AccessControl - root: acls - - This implies the following inherited HTTP annotation: - - service Storage { - // Get the underlying ACL object. - rpc GetAcl(GetAclRequest) returns (Acl) { - option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; - } - ... - } - - """ - - name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - """ - The fully qualified name of the interface which is included. - """ - root: "str" = betterproto2.field(2, betterproto2.TYPE_STRING) - """ - If non-empty specifies a path under which inherited HTTP paths - are rooted. - """ - - -@dataclass(eq=False, repr=False) -class OneofDescriptorProto(betterproto2.Message): - """ - Describes a oneof. - - """ - - name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - options: "Optional[OneofOptions]" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, optional=True) - - -@dataclass(eq=False, repr=False) -class OneofOptions(betterproto2.Message): - uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( - 999, betterproto2.TYPE_MESSAGE, repeated=True - ) - """ - The parser stores options it doesn't recognize here. See above. - """ - - -@dataclass(eq=False, repr=False) -class Option(betterproto2.Message): - """ - A protocol buffer option, which can be attached to a message, field, - enumeration, etc. - - """ - - name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - """ - The option's name. For protobuf built-in options (options defined in - descriptor.proto), this is the short name. For example, `"map_entry"`. - For custom options, it should be the fully-qualified name. For example, - `"google.api.http"`. - """ - value: "Optional[Any]" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, optional=True) - """ - The option's value packed in an Any message. If the value is a primitive, - the corresponding wrapper type defined in google/protobuf/wrappers.proto - should be used. If the value is an enum, it should be stored as an int32 - value using the google.protobuf.Int32Value type. - """ - - -@dataclass(eq=False, repr=False) -class ServiceDescriptorProto(betterproto2.Message): - """ - Describes a service. - - """ - - name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - method: "List[MethodDescriptorProto]" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, repeated=True) - options: "Optional[ServiceOptions]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, optional=True) - - -@dataclass(eq=False, repr=False) -class ServiceOptions(betterproto2.Message): - deprecated: "bool" = betterproto2.field(33, betterproto2.TYPE_BOOL) - """ - Note: Field numbers 1 through 32 are reserved for Google's internal RPC - framework. We apologize for hoarding these numbers to ourselves, but - we were already using them long before we decided to release Protocol - Buffers. - - Is this service deprecated? - Depending on the target platform, this can emit Deprecated annotations - for the service, or it will be completely ignored; in the very least, - this is a formalization for deprecating services. - """ - uninterpreted_option: "List[UninterpretedOption]" = betterproto2.field( - 999, betterproto2.TYPE_MESSAGE, repeated=True - ) - """ - The parser stores options it doesn't recognize here. See above. - """ - - -@dataclass(eq=False, repr=False) -class SourceCodeInfo(betterproto2.Message): - """ - =================================================================== - Optional source code info - - Encapsulates information about the original source file from which a - FileDescriptorProto was generated. - - """ - - location: "List[SourceCodeInfoLocation]" = betterproto2.field(1, betterproto2.TYPE_MESSAGE, repeated=True) - """ - A Location identifies a piece of source code in a .proto file which - corresponds to a particular definition. This information is intended - to be useful to IDEs, code indexers, documentation generators, and similar - tools. - - For example, say we have a file like: - message Foo { - optional string foo = 1; - } - Let's look at just the field definition: - optional string foo = 1; - ^ ^^ ^^ ^ ^^^ - a bc de f ghi - We have the following locations: - span path represents - [a,i) [ 4, 0, 2, 0 ] The whole field definition. - [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - - Notes: - - A location may refer to a repeated field itself (i.e. not to any - particular index within it). This is used whenever a set of elements are - logically enclosed in a single code segment. For example, an entire - extend block (possibly containing multiple extension definitions) will - have an outer location whose path refers to the "extensions" repeated - field without an index. - - Multiple locations may have the same path. This happens when a single - logical declaration is spread out across multiple places. The most - obvious example is the "extend" block again -- there may be multiple - extend blocks in the same scope, each of which will have the same path. - - A location's span is not always a subset of its parent's span. For - example, the "extendee" of an extension declaration appears at the - beginning of the "extend" block and is shared by all extensions within - the block. - - Just because a location's span is a subset of some other location's span - does not mean that it is a descendant. For example, a "group" defines - both a type and a field in a single declaration. Thus, the locations - corresponding to the type and field and their components will overlap. - - Code which tries to interpret locations should probably be designed to - ignore those that it doesn't understand, as more types of locations could - be recorded in the future. - """ - - -@dataclass(eq=False, repr=False) -class SourceCodeInfoLocation(betterproto2.Message): - path: "List[int]" = betterproto2.field(1, betterproto2.TYPE_INT32, repeated=True) - """ - Identifies which part of the FileDescriptorProto was defined at this - location. - - Each element is a field number or an index. They form a path from - the root FileDescriptorProto to the place where the definition. For - example, this path: - [ 4, 3, 2, 7, 1 ] - refers to: - file.message_type(3) // 4, 3 - .field(7) // 2, 7 - .name() // 1 - This is because FileDescriptorProto.message_type has field number 4: - repeated DescriptorProto message_type = 4; - and DescriptorProto.field has field number 2: - repeated FieldDescriptorProto field = 2; - and FieldDescriptorProto.name has field number 1: - optional string name = 1; - - Thus, the above path gives the location of a field name. If we removed - the last element: - [ 4, 3, 2, 7 ] - this path refers to the whole field declaration (from the beginning - of the label to the terminating semicolon). - """ - span: "List[int]" = betterproto2.field(2, betterproto2.TYPE_INT32, repeated=True) - """ - Always has exactly three or four elements: start line, start column, - end line (optional, otherwise assumed same as start line), end column. - These are packed into a single field for efficiency. Note that line - and column numbers are zero-based -- typically you will want to add - 1 to each before displaying to a user. - """ - leading_comments: "str" = betterproto2.field(3, betterproto2.TYPE_STRING) - """ - If this SourceCodeInfo represents a complete declaration, these are any - comments appearing before and after the declaration which appear to be - attached to the declaration. - - A series of line comments appearing on consecutive lines, with no other - tokens appearing on those lines, will be treated as a single comment. - - leading_detached_comments will keep paragraphs of comments that appear - before (but not connected to) the current element. Each paragraph, - separated by empty lines, will be one comment element in the repeated - field. - - Only the comment content is provided; comment markers (e.g. //) are - stripped out. For block comments, leading whitespace and an asterisk - will be stripped from the beginning of each line other than the first. - Newlines are included in the output. - - Examples: - - optional int32 foo = 1; // Comment attached to foo. - // Comment attached to bar. - optional int32 bar = 2; - - optional string baz = 3; - // Comment attached to baz. - // Another line attached to baz. - - // Comment attached to qux. - // - // Another line attached to qux. - optional double qux = 4; - - // Detached comment for corge. This is not leading or trailing comments - // to qux or corge because there are blank lines separating it from - // both. - - // Detached comment for corge paragraph 2. - - optional string corge = 5; - /* Block comment attached - * to corge. Leading asterisks - * will be removed. */ - /* Block comment attached to - * grault. */ - optional int32 grault = 6; - - // ignored detached comments. - """ - trailing_comments: "str" = betterproto2.field(4, betterproto2.TYPE_STRING) - leading_detached_comments: "List[str]" = betterproto2.field(6, betterproto2.TYPE_STRING, repeated=True) - - -@dataclass(eq=False, repr=False) -class SourceContext(betterproto2.Message): - """ - `SourceContext` represents information about the source of a - protobuf element, like the file in which it is defined. - - """ - - file_name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - """ - The path-qualified name of the .proto file that contained the associated - protobuf element. For example: `"google/protobuf/source_context.proto"`. - """ - - -@dataclass(eq=False, repr=False) -class StringValue(betterproto2.Message): - """ - Wrapper message for `string`. - - The JSON representation for `StringValue` is JSON string. - - """ - - value: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - """ - The string value. - """ - - -@dataclass(eq=False, repr=False) -class Struct(betterproto2.Message): - """ - `Struct` represents a structured data value, consisting of fields - which map to dynamically typed values. In some languages, `Struct` - might be supported by a native representation. For example, in - scripting languages like JS a struct is represented as an - object. The details of that representation are described together - with the proto support for the language. - - The JSON representation for `Struct` is JSON object. - - """ - - fields: "Dict[str, Value]" = betterproto2.field( - 1, betterproto2.TYPE_MAP, map_types=(betterproto2.TYPE_STRING, betterproto2.TYPE_MESSAGE) - ) - """ - Unordered map of dynamically typed values. - """ - - -@dataclass(eq=False, repr=False) -class Timestamp(betterproto2.Message): - """ - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at - nanosecond resolution. The count is relative to an epoch at UTC midnight on - January 1, 1970, in the proleptic Gregorian calendar which extends the - Gregorian calendar backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a [24-hour linear - smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from [RFC - 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - where {year} is always expressed using four digits while {month}, {day}, - {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - is required. A proto3 JSON serializer should always use UTC (as indicated by - "Z") when printing the Timestamp type and a proto3 JSON parser should be - able to accept both UTC and other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - 01:30 UTC on January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the - standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted - to this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - the Joda Time's [`ISODateTimeFormat.dateTime()`]( - http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - ) to obtain a formatter capable of generating timestamps in this format. - - """ - - seconds: "int" = betterproto2.field(1, betterproto2.TYPE_INT64) - """ - Represents seconds of UTC time since Unix epoch - 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - 9999-12-31T23:59:59Z inclusive. - """ - nanos: "int" = betterproto2.field(2, betterproto2.TYPE_INT32) - """ - Non-negative fractions of a second at nanosecond resolution. Negative - second values with fractions must still have non-negative nanos values - that count forward in time. Must be from 0 to 999,999,999 - inclusive. - """ - - -@dataclass(eq=False, repr=False) -class Type(betterproto2.Message): - """ - A protocol buffer message type. - - """ - - name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - """ - The fully qualified message name. - """ - fields: "List[Field]" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, repeated=True) - """ - The list of fields. - """ - oneofs: "List[str]" = betterproto2.field(3, betterproto2.TYPE_STRING, repeated=True) - """ - The list of types appearing in `oneof` definitions in this type. - """ - options: "List[Option]" = betterproto2.field(4, betterproto2.TYPE_MESSAGE, repeated=True) - """ - The protocol buffer options. - """ - source_context: "Optional[SourceContext]" = betterproto2.field(5, betterproto2.TYPE_MESSAGE, optional=True) - """ - The source context. - """ - syntax: "Syntax" = betterproto2.field(6, betterproto2.TYPE_ENUM, default_factory=lambda: Syntax.try_value(0)) - """ - The source syntax. - """ - - -@dataclass(eq=False, repr=False) -class UInt32Value(betterproto2.Message): - """ - Wrapper message for `uint32`. - - The JSON representation for `UInt32Value` is JSON number. - - """ - - value: "int" = betterproto2.field(1, betterproto2.TYPE_UINT32) - """ - The uint32 value. - """ - - -@dataclass(eq=False, repr=False) -class UInt64Value(betterproto2.Message): - """ - Wrapper message for `uint64`. - - The JSON representation for `UInt64Value` is JSON string. - - """ - - value: "int" = betterproto2.field(1, betterproto2.TYPE_UINT64) - """ - The uint64 value. - """ - - -@dataclass(eq=False, repr=False) -class UninterpretedOption(betterproto2.Message): - """ - A message representing a option the parser does not recognize. This only - appears in options protos created by the compiler::Parser class. - DescriptorPool resolves these when building Descriptor objects. Therefore, - options protos in descriptor objects (e.g. returned by Descriptor::options(), - or produced by Descriptor::CopyTo()) will never have UninterpretedOptions - in them. - - """ - - name: "List[UninterpretedOptionNamePart]" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, repeated=True) - identifier_value: "str" = betterproto2.field(3, betterproto2.TYPE_STRING) - """ - The value of the uninterpreted option, in whatever type the tokenizer - identified it as during parsing. Exactly one of these should be set. - """ - positive_int_value: "int" = betterproto2.field(4, betterproto2.TYPE_UINT64) - negative_int_value: "int" = betterproto2.field(5, betterproto2.TYPE_INT64) - double_value: "float" = betterproto2.field(6, betterproto2.TYPE_DOUBLE) - string_value: "bytes" = betterproto2.field(7, betterproto2.TYPE_BYTES) - aggregate_value: "str" = betterproto2.field(8, betterproto2.TYPE_STRING) - - -@dataclass(eq=False, repr=False) -class UninterpretedOptionNamePart(betterproto2.Message): - """ - The name of the uninterpreted option. Each string represents a segment in - a dot-separated name. is_extension is true iff a segment represents an - extension (denoted with parentheses in options specs in .proto files). - E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents - "foo.(bar.baz).qux". - - """ - - name_part: "str" = betterproto2.field(1, betterproto2.TYPE_STRING) - is_extension: "bool" = betterproto2.field(2, betterproto2.TYPE_BOOL) - - -@dataclass(eq=False, repr=False) -class Value(betterproto2.Message): - """ - `Value` represents a dynamically typed value which can be either - null, a number, a string, a boolean, a recursive struct value, or a - list of values. A producer of value is expected to set one of that - variants, absence of any variant indicates an error. - - The JSON representation for `Value` is JSON value. - - Oneofs: - - kind: The kind of value. - """ - - null_value: "Optional[NullValue]" = betterproto2.field( - 1, betterproto2.TYPE_ENUM, optional=True, default_factory=lambda: NullValue.try_value(0), group="kind" - ) - """ - Represents a null value. - """ - number_value: "Optional[float]" = betterproto2.field(2, betterproto2.TYPE_DOUBLE, optional=True, group="kind") - """ - Represents a double value. - """ - string_value: "Optional[str]" = betterproto2.field(3, betterproto2.TYPE_STRING, optional=True, group="kind") - """ - Represents a string value. - """ - bool_value: "Optional[bool]" = betterproto2.field(4, betterproto2.TYPE_BOOL, optional=True, group="kind") - """ - Represents a boolean value. - """ - struct_value: "Optional[Struct]" = betterproto2.field(5, betterproto2.TYPE_MESSAGE, optional=True, group="kind") - """ - Represents a structured value. - """ - list_value: "Optional[ListValue]" = betterproto2.field(6, betterproto2.TYPE_MESSAGE, optional=True, group="kind") - """ - Represents a repeated `Value`. - """ diff --git a/src/betterproto2_compiler/plugin/models.py b/src/betterproto2_compiler/plugin/models.py index 0f95ae08..aa328384 100644 --- a/src/betterproto2_compiler/plugin/models.py +++ b/src/betterproto2_compiler/plugin/models.py @@ -41,13 +41,7 @@ ) import betterproto2 - -from betterproto2_compiler.compile.naming import ( - pythonize_class_name, - pythonize_field_name, - pythonize_method_name, -) -from betterproto2_compiler.lib.google.protobuf import ( +from betterproto2.lib.google.protobuf import ( DescriptorProto, EnumDescriptorProto, FieldDescriptorProto, @@ -58,6 +52,12 @@ MethodDescriptorProto, OneofDescriptorProto, ) + +from betterproto2_compiler.compile.naming import ( + pythonize_class_name, + pythonize_field_name, + pythonize_method_name, +) from betterproto2_compiler.lib.google.protobuf.compiler import CodeGeneratorRequest from ..compile.importing import get_type_reference, parse_source_type_name diff --git a/src/betterproto2_compiler/plugin/parser.py b/src/betterproto2_compiler/plugin/parser.py index 740374f6..45dd0a92 100644 --- a/src/betterproto2_compiler/plugin/parser.py +++ b/src/betterproto2_compiler/plugin/parser.py @@ -2,13 +2,14 @@ import sys from collections.abc import Generator -from betterproto2_compiler.lib.google.protobuf import ( +from betterproto2.lib.google.protobuf import ( DescriptorProto, EnumDescriptorProto, FieldDescriptorProto, FileDescriptorProto, ServiceDescriptorProto, ) + from betterproto2_compiler.lib.google.protobuf.compiler import ( CodeGeneratorRequest, CodeGeneratorResponse, From 58fb099bbce2511d219dcfdb1453fbadb5e9499c Mon Sep 17 00:00:00 2001 From: Adrien Vannson Date: Mon, 6 Jan 2025 12:37:45 +0100 Subject: [PATCH 06/10] Remove useless code --- src/betterproto2_compiler/plugin/models.py | 22 ---------------------- src/betterproto2_compiler/plugin/parser.py | 17 ----------------- 2 files changed, 39 deletions(-) diff --git a/src/betterproto2_compiler/plugin/models.py b/src/betterproto2_compiler/plugin/models.py index aa328384..42ccb975 100644 --- a/src/betterproto2_compiler/plugin/models.py +++ b/src/betterproto2_compiler/plugin/models.py @@ -118,28 +118,6 @@ ) -# TODO patch again to make field optional -# def monkey_patch_oneof_index(): -# """ -# The compiler message types are written for proto2, but we read them as proto3. -# For this to work in the case of the oneof_index fields, which depend on being able -# to tell whether they were set, we have to treat them as oneof fields. This method -# monkey patches the generated classes after the fact to force this behaviour. -# """ -# object.__setattr__( -# FieldDescriptorProto.__dataclass_fields__["oneof_index"].metadata[ -# "betterproto" -# ], -# "group", -# "oneof_index", -# ) -# object.__setattr__( -# Field.__dataclass_fields__["oneof_index"].metadata["betterproto"], -# "group", -# "oneof_index", -# ) - - def get_comment( proto_file: "FileDescriptorProto", path: list[int], diff --git a/src/betterproto2_compiler/plugin/parser.py b/src/betterproto2_compiler/plugin/parser.py index 45dd0a92..0b6f0b3d 100644 --- a/src/betterproto2_compiler/plugin/parser.py +++ b/src/betterproto2_compiler/plugin/parser.py @@ -5,7 +5,6 @@ from betterproto2.lib.google.protobuf import ( DescriptorProto, EnumDescriptorProto, - FieldDescriptorProto, FileDescriptorProto, ServiceDescriptorProto, ) @@ -175,22 +174,6 @@ def generate_code(request: CodeGeneratorRequest) -> CodeGeneratorResponse: return response -def _make_one_of_field_compiler( - output_package: OutputTemplate, - source_file: "FileDescriptorProto", - parent: MessageCompiler, - proto_obj: "FieldDescriptorProto", - path: list[int], -) -> FieldCompiler: - return OneOfFieldCompiler( - source_file=source_file, - parent=parent, - proto_obj=proto_obj, - path=path, - typing_compiler=output_package.typing_compiler, - ) - - def read_protobuf_type( item: DescriptorProto, path: list[int], From 9f3f198dfdfbe263f277d91e3e169e53e2006588 Mon Sep 17 00:00:00 2001 From: Adrien Vannson Date: Mon, 6 Jan 2025 12:38:20 +0100 Subject: [PATCH 07/10] Update betterproto --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index fcb4acc1..bee128d9 100644 --- a/poetry.lock +++ b/poetry.lock @@ -45,13 +45,13 @@ dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] [[package]] name = "betterproto2" -version = "0.1.0" +version = "0.1.1" description = "A better Protobuf / gRPC generator & library" optional = false python-versions = "<4.0,>=3.8" files = [ - {file = "betterproto2-0.1.0-py3-none-any.whl", hash = "sha256:9f1e51b896f499f53a183577a7aa00e1888fd1490b5dfd83f81c725fe0226341"}, - {file = "betterproto2-0.1.0.tar.gz", hash = "sha256:ea493987d491721d53709d616bd9542d35a884485f4ee0ab38d4d2d04870d87d"}, + {file = "betterproto2-0.1.1-py3-none-any.whl", hash = "sha256:c00cf0a0567ddbd32f2bbc52abb49eb1473179ec74fff524c73a29c915d35936"}, + {file = "betterproto2-0.1.1.tar.gz", hash = "sha256:ff53a796907b24d7ed3433f0b2c9c356a0eda2867ea266d2791f5f5bb3925f33"}, ] [package.dependencies] @@ -1553,4 +1553,4 @@ watchmedo = ["PyYAML (>=3.10)"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "884a45f57359d3969df38d1fa7d96643450cfd44233f8016ffe2f6899d957bfa" +content-hash = "060e31d81903103c44371d08d4da79f6c072cfa6971734f6dd9e1bb370c048b4" diff --git a/pyproject.toml b/pyproject.toml index 4981fc41..3bb54b50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ packages = [ [tool.poetry.dependencies] python = "^3.10" -betterproto2 = "^0.1.0" +betterproto2 = "^0.1.1" # The Ruff version is pinned. To update it, also update it in .pre-commit-config.yaml ruff = "~0.7.4" grpclib = "^0.4.1" From df9810088bb8788755379a41e8e385498d7ffb41 Mon Sep 17 00:00:00 2001 From: Adrien Vannson Date: Mon, 6 Jan 2025 13:00:12 +0100 Subject: [PATCH 08/10] Document how to recompile proto files --- docs/development.md | 25 +++++++++++++++++++++++++ mkdocs.yml | 1 + 2 files changed, 26 insertions(+) create mode 100644 docs/development.md diff --git a/docs/development.md b/docs/development.md new file mode 100644 index 00000000..c3c2151e --- /dev/null +++ b/docs/development.md @@ -0,0 +1,25 @@ +# Development + +## Recompiling the lib proto files + +After some updates in the compiler, it might be useful to recompile the standard Google proto files. As the proto files +are distributed with `protoc`, their path might depend on your installation. + +```bash +mkdir lib +protoc \ + --python_betterproto2_opt=INCLUDE_GOOGLE \ + --python_betterproto2_out=lib \ + -I /usr/include/ \ + /usr/include/google/protobuf/*.proto +``` + +The generated files should be distributed in the `betterproto2` package. + +!!! warning + These proto files are written with the `proto2` syntax, which is not supported by betterproto. For the compiler to + work, you need to manually patch the generated file to mark the field `oneof_index` in `Field` and + `FieldDescriptorProto` optional. + +In the compiler, you also need to compile the [plugin.proto](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/compiler/plugin.proto) +file in `src/betterproto2_compiler/lib/google.protobug/compiler/__init__.py`. diff --git a/mkdocs.yml b/mkdocs.yml index 86192e02..a3c276c3 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -14,6 +14,7 @@ nav: - Betterproto2 compiler: - index.md - Getting started: getting-started.md + - Development: development.md plugins: - mkdocstrings From 5d325116474b75adaf79f95f69ad43100a4a7cb6 Mon Sep 17 00:00:00 2001 From: Adrien Vannson Date: Mon, 6 Jan 2025 13:03:04 +0100 Subject: [PATCH 09/10] Fix import path --- tests/test_module_validation.py | 3 ++- tests/test_typing_compiler.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_module_validation.py b/tests/test_module_validation.py index 6995a590..5a68f54b 100644 --- a/tests/test_module_validation.py +++ b/tests/test_module_validation.py @@ -1,5 +1,6 @@ import pytest -from betterproto2.plugin.module_validation import ModuleValidator + +from betterproto2_compiler.plugin.module_validation import ModuleValidator @pytest.mark.parametrize( diff --git a/tests/test_typing_compiler.py b/tests/test_typing_compiler.py index 1f8a2c66..470b6e54 100644 --- a/tests/test_typing_compiler.py +++ b/tests/test_typing_compiler.py @@ -1,4 +1,4 @@ -from betterproto2.plugin.typing_compiler import ( +from betterproto2_compiler.plugin.typing_compiler import ( DirectImportTypingCompiler, NoTyping310TypingCompiler, TypingImportTypingCompiler, From 2e16ec101644ab6d9b18664d19f8e8fa546c47f8 Mon Sep 17 00:00:00 2001 From: Adrien Vannson Date: Mon, 6 Jan 2025 13:05:40 +0100 Subject: [PATCH 10/10] Update version number --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3bb54b50..4d0f2751 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "betterproto2_compiler" -version = "0.1.0" +version = "0.1.1" description = "Compiler for betterproto2" authors = ["Adrien Vannson ", "Daniel G. Taylor "] readme = "README.md"