-
Notifications
You must be signed in to change notification settings - Fork 9
/
pyproject.toml
140 lines (115 loc) · 3.57 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
[tool.poetry]
name = "protobuf_to_pydantic"
version = "0.0.0"
description = "Generate the `pydantic.BaseModel` class (and the corresponding source code) with parameter verification function through the Protobuf file"
authors = ["So1n <so1n897046026@gmail.com>"]
license = "Apache Software License"
readme = "./README.md"
repository = "https://github.com/so1n/protobuf_to_pydantic"
homepage = "https://github.com/so1n/protobuf_to_pydantic"
packages = [
{ include = "protobuf_to_pydantic" },
]
[tool.poetry.scripts]
protoc-gen-protobuf-to-pydantic = "protobuf_to_pydantic.plugin.main:main"
[tool.poetry.dependencies]
python = "^3.7"
pydantic = ">=1.9.2, <3.0.0"
protobuf = ">=3.20.3"
toml = {version = "^0.10.2", optional = true}
lark = { version = "^1.1.2", optional = true }
mypy-protobuf = { version = "^3.2.0", optional = true }
[tool.poetry.extras]
lark = ["lark"]
mypy-protobuf = ["mypy-protobuf"]
toml = ["toml"]
all = ["lark", "mypy-protobuf", "toml"]
[tool.poetry.dev-dependencies]
black = "^23.3.0"
mypy = "1.0.0"
pytest = "6.2.5"
isort = "5.6.4"
coverage = "5.5"
pre-commit = "2.14.0"
autoflake = "1.4"
flake8 = "3.9.2"
# if pydantic version >= 2.0.0, email-validator version must >= 2.0.0
email-validator = "2.0.0"
# fix flake8 run bug: https://stackoverflow.com/questions/73929564/entrypoints-object-has-no-attribute-get-digital-ocean
importlib-metadata = "4.11.4"
grpcio-tools = ">=1.40.0"
mypy-protobuf = "3.2.0"
[tool.poetry.group.dev.dependencies]
pytest = "6.2.5"
[tool.protobuf-to-pydantic.format]
black = true
isort = true
autoflake = true
[tool.black]
line-length = 120
target-version = ['py37', 'py38', 'py39', 'py310']
[tool.isort]
profile = "black"
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
line_length = 120
[tool.autoflake]
in-place = true
remove-all-unused-imports = true
remove-unused-variables = true
[tool.mypy]
disallow_untyped_defs = true
python_executable = ".venv/bin/python"
exclude = [
"^example/python_example_proto_code/example_proto",
"^protobuf_to_pydantic/_pydantic_adapter.py",
"^protobuf_to_pydantic/customer_validator/__init__.py",
"^protobuf_to_pydantic/customer_validator/v1.py",
"^protobuf_to_pydantic/customer_validator/v2.py",
"^protobuf_to_pydantic/customer_con_type/__init__.py",
"^protobuf_to_pydantic/customer_con_type/v1.py",
"^protobuf_to_pydantic/customer_con_type/v2.py",
]
[tool.pytest]
testpaths = "tests"
[tool.coverage.run]
branch = true
source = ["protobuf_to_pydantic"]
omit = [
"protobuf_to_pydantic/contrib/proto_parser.py",
# The plugin cannot be tested,
# only by checking the running result of the generated code to judge whether the plugin is executed successfully
"protobuf_to_pydantic/plugin/*",
]
[tool.coverage.report]
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain about missing debug-only code:
"def __repr__",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",
"continue",
# type hints
"if TYPE_CHECKING:",
"pass",
# error
"except ImportError:",
"except ModuleNotFoundError:"
]
[tool.poetry-dynamic-versioning]
enable = true
metadata=false
vcs = "git"
# format = "v{base}-{stage}.{revision}"
format = "v{base}"
[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"