Skip to content

Commit

Permalink
Style, change gen code style
Browse files Browse the repository at this point in the history
  • Loading branch information
so1n committed Mar 30, 2024
1 parent b8d7d25 commit 3860842
Show file tree
Hide file tree
Showing 38 changed files with 90 additions and 107 deletions.
2 changes: 1 addition & 1 deletion example/proto_3_20_pydanticv1/demo_gen_code.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 1.10.7
import typing
Expand Down
2 changes: 1 addition & 1 deletion example/proto_3_20_pydanticv1/demo_gen_code_by_p2p.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 1.10.7
import typing
Expand Down
2 changes: 1 addition & 1 deletion example/proto_3_20_pydanticv1/demo_gen_code_by_pgv.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 1.10.7
import typing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 1.10.7
import typing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 1.10.7
import typing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 1.10.7
from enum import IntEnum
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 1.10.7
import typing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 1.10.7
import typing
Expand Down Expand Up @@ -638,7 +638,6 @@ class MessageIgnoredTest(BaseModel):
class OneOfTest(BaseModel):
_one_of_dict = {"OneOfTest.id": {"fields": {"x", "y"}, "required": True}}
one_of_validator = root_validator(pre=True, allow_reuse=True)(check_one_of)

header: str = Field(default="")
x: str = Field(default="")
y: int = Field(default=0)
Expand All @@ -647,7 +646,6 @@ class OneOfTest(BaseModel):
class OneOfNotTest(BaseModel):
_one_of_dict = {"OneOfNotTest.id": {"fields": {"x", "y"}}}
one_of_validator = root_validator(pre=True, allow_reuse=True)(check_one_of)

header: str = Field(default="")
x: str = Field(default="")
y: int = Field(default=0)
Expand All @@ -656,7 +654,6 @@ class OneOfNotTest(BaseModel):
class OneOfOptionalTest(BaseModel):
_one_of_dict = {"OneOfOptionalTest.id": {"fields": {"x", "y", "z"}, "required": True}}
one_of_validator = root_validator(pre=True, allow_reuse=True)(check_one_of)

header: str = Field(default="")
x: typing.Optional[str] = Field(default="")
y: typing.Optional[int] = Field(default=0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 1.10.7
import typing
Expand Down Expand Up @@ -397,7 +397,6 @@ class MessageIgnoredTest(BaseModel):
class OneOfTest(BaseModel):
_one_of_dict = {"OneOfTest.id": {"fields": {"x", "y"}, "required": True}}
one_of_validator = root_validator(pre=True, allow_reuse=True)(check_one_of)

header: str = Field(default="")
x: str = Field(default="")
y: int = Field(default=0)
Expand All @@ -406,7 +405,6 @@ class OneOfTest(BaseModel):
class OneOfNotTest(BaseModel):
_one_of_dict = {"OneOfNotTest.id": {"fields": {"x", "y"}}}
one_of_validator = root_validator(pre=True, allow_reuse=True)(check_one_of)

header: str = Field(default="")
x: str = Field(default="")
y: int = Field(default=0)
Expand Down
2 changes: 1 addition & 1 deletion example/proto_3_20_pydanticv2/demo_gen_code.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 2.5.3
import typing
Expand Down
2 changes: 1 addition & 1 deletion example/proto_3_20_pydanticv2/demo_gen_code_by_p2p.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 2.5.3
import typing
Expand Down
2 changes: 1 addition & 1 deletion example/proto_3_20_pydanticv2/demo_gen_code_by_pgv.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 2.5.3
import typing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 2.5.3
import typing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 2.5.3
import typing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 2.5.3
from enum import IntEnum
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 2.5.3
import typing
Expand Down Expand Up @@ -35,7 +35,6 @@ class StructMessage(BaseModel):

class FieldMaskMessage(BaseModel):
model_config = ConfigDict(arbitrary_types_allowed=True)

field_mask: typing.Optional[FieldMask] = Field(default_factory=FieldMask)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 2.5.3
import typing
Expand Down Expand Up @@ -538,7 +538,6 @@ class RepeatedTest(BaseModel):

class AnyTest(BaseModel):
model_config = ConfigDict(arbitrary_types_allowed=True)

required_test: Any = Field()
not_in_test: Any = Field(
default_factory=Any,
Expand Down Expand Up @@ -702,7 +701,6 @@ class MessageIgnoredTest(BaseModel):
class OneOfTest(BaseModel):
_one_of_dict = {"OneOfTest.id": {"fields": {"x", "y"}, "required": True}}
one_of_validator = model_validator(mode="before")(check_one_of)

header: str = Field(default="")
x: str = Field(default="")
y: int = Field(default=0)
Expand All @@ -711,7 +709,6 @@ class OneOfTest(BaseModel):
class OneOfNotTest(BaseModel):
_one_of_dict = {"OneOfNotTest.id": {"fields": {"x", "y"}}}
one_of_validator = model_validator(mode="before")(check_one_of)

header: str = Field(default="")
x: str = Field(default="")
y: int = Field(default=0)
Expand All @@ -720,7 +717,6 @@ class OneOfNotTest(BaseModel):
class OneOfOptionalTest(BaseModel):
_one_of_dict = {"OneOfOptionalTest.id": {"fields": {"x", "y", "z"}, "required": True}}
one_of_validator = model_validator(mode="before")(check_one_of)

header: str = Field(default="")
x: typing.Optional[str] = Field(default="")
y: typing.Optional[int] = Field(default=0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 3.20.3
# Pydantic Version: 2.5.3
import typing
Expand Down Expand Up @@ -325,7 +325,6 @@ class RepeatedTest(BaseModel):

class AnyTest(BaseModel):
model_config = ConfigDict(arbitrary_types_allowed=True)

required_test: Any = Field()
not_in_test: Any = Field(
default_factory=Any,
Expand Down Expand Up @@ -446,7 +445,6 @@ class MessageIgnoredTest(BaseModel):
class OneOfTest(BaseModel):
_one_of_dict = {"OneOfTest.id": {"fields": {"x", "y"}, "required": True}}
one_of_validator = model_validator(mode="before")(check_one_of)

header: str = Field(default="")
x: str = Field(default="")
y: int = Field(default=0)
Expand All @@ -455,7 +453,6 @@ class OneOfTest(BaseModel):
class OneOfNotTest(BaseModel):
_one_of_dict = {"OneOfNotTest.id": {"fields": {"x", "y"}}}
one_of_validator = model_validator(mode="before")(check_one_of)

header: str = Field(default="")
x: str = Field(default="")
y: int = Field(default=0)
Expand Down
2 changes: 1 addition & 1 deletion example/proto_pydanticv1/demo_gen_code.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 4.24.4
# Pydantic Version: 1.10.7
import typing
Expand Down
2 changes: 1 addition & 1 deletion example/proto_pydanticv1/demo_gen_code_by_p2p.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 4.24.4
# Pydantic Version: 1.10.7
import typing
Expand Down
2 changes: 1 addition & 1 deletion example/proto_pydanticv1/demo_gen_code_by_pgv.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 4.24.4
# Pydantic Version: 1.10.7
import typing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 4.24.4
# Pydantic Version: 1.10.7
import typing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 4.24.4
# Pydantic Version: 1.10.7
import typing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 4.24.4
# Pydantic Version: 1.10.7
from enum import IntEnum
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 4.24.4
# Pydantic Version: 1.10.7
import typing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 4.24.4
# Pydantic Version: 1.10.7
import typing
Expand Down Expand Up @@ -638,7 +638,6 @@ class MessageIgnoredTest(BaseModel):
class OneOfTest(BaseModel):
_one_of_dict = {"OneOfTest.id": {"fields": {"x", "y"}, "required": True}}
one_of_validator = root_validator(pre=True, allow_reuse=True)(check_one_of)

header: str = Field(default="")
x: str = Field(default="")
y: int = Field(default=0)
Expand All @@ -647,7 +646,6 @@ class OneOfTest(BaseModel):
class OneOfNotTest(BaseModel):
_one_of_dict = {"OneOfNotTest.id": {"fields": {"x", "y"}}}
one_of_validator = root_validator(pre=True, allow_reuse=True)(check_one_of)

header: str = Field(default="")
x: str = Field(default="")
y: int = Field(default=0)
Expand All @@ -656,7 +654,6 @@ class OneOfNotTest(BaseModel):
class OneOfOptionalTest(BaseModel):
_one_of_dict = {"OneOfOptionalTest.id": {"fields": {"x", "y", "z"}, "required": True}}
one_of_validator = root_validator(pre=True, allow_reuse=True)(check_one_of)

header: str = Field(default="")
x: typing.Optional[str] = Field(default="")
y: typing.Optional[int] = Field(default=0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 4.24.4
# Pydantic Version: 1.10.7
import typing
Expand Down Expand Up @@ -397,7 +397,6 @@ class MessageIgnoredTest(BaseModel):
class OneOfTest(BaseModel):
_one_of_dict = {"OneOfTest.id": {"fields": {"x", "y"}, "required": True}}
one_of_validator = root_validator(pre=True, allow_reuse=True)(check_one_of)

header: str = Field(default="")
x: str = Field(default="")
y: int = Field(default=0)
Expand All @@ -406,7 +405,6 @@ class OneOfTest(BaseModel):
class OneOfNotTest(BaseModel):
_one_of_dict = {"OneOfNotTest.id": {"fields": {"x", "y"}}}
one_of_validator = root_validator(pre=True, allow_reuse=True)(check_one_of)

header: str = Field(default="")
x: str = Field(default="")
y: int = Field(default=0)
Expand Down
2 changes: 1 addition & 1 deletion example/proto_pydanticv2/demo_gen_code.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 4.24.4
# Pydantic Version: 2.5.3
import typing
Expand Down
2 changes: 1 addition & 1 deletion example/proto_pydanticv2/demo_gen_code_by_p2p.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 4.24.4
# Pydantic Version: 2.5.3
import typing
Expand Down
2 changes: 1 addition & 1 deletion example/proto_pydanticv2/demo_gen_code_by_pgv.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 4.24.4
# Pydantic Version: 2.5.3
import typing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 4.24.4
# Pydantic Version: 2.5.3
import typing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 4.24.4
# Pydantic Version: 2.5.3
import typing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 4.24.4
# Pydantic Version: 2.5.3
from enum import IntEnum
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an automatically generated file, please do not change
# gen by protobuf_to_pydantic[v0.2.5](https://github.com/so1n/protobuf_to_pydantic)
# gen by protobuf_to_pydantic[v0.2.6](https://github.com/so1n/protobuf_to_pydantic)
# Protobuf Version: 4.24.4
# Pydantic Version: 2.5.3
import typing
Expand Down Expand Up @@ -35,7 +35,6 @@ class StructMessage(BaseModel):

class FieldMaskMessage(BaseModel):
model_config = ConfigDict(arbitrary_types_allowed=True)

field_mask: typing.Optional[FieldMask] = Field(default_factory=FieldMask)


Expand Down
Loading

0 comments on commit 3860842

Please sign in to comment.