-
Notifications
You must be signed in to change notification settings - Fork 8
/
pyproject.toml
195 lines (183 loc) · 5.88 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
[tool.poetry]
name = "protoletariat"
version = "3.3.8"
packages = [{ include = "protoletariat" }]
homepage = "https://github.com/cpcloud/protoletariat"
repository = "https://github.com/cpcloud/protoletariat"
description = "Python protocol buffers for the rest of us"
authors = ["Phillip Cloud <[email protected]>"]
maintainers = ["Phillip Cloud <[email protected]>"]
license = "Apache-2.0"
readme = "README.md"
classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
[tool.poetry.scripts]
protol = "protoletariat.__main__:main"
[tool.poetry.dependencies]
python = "^3.8"
astunparse = { version = ">=1.6.3,<2", python = "<3.9" }
click = ">=8,<9"
protobuf = ">=3.19.1,<6"
grpcio-tools = { version = ">=1.42.0,<2", optional = true }
[tool.poetry.dev-dependencies]
grpc-stubs = ">=1.24.7,<2"
grpcio = ">=1.42,<2"
mypy = ">=1,<2"
mypy-protobuf = ">=3,<4"
pytest = ">=8,<9"
pytest-randomly = ">=3.10.1,<4"
ruff = ">=0.6.0,<1"
types-protobuf = ">=5,<6"
[tool.poetry.extras]
grpcio-tools = ["grpcio-tools"]
[tool.pytest.ini_options]
xfail_strict = true
addopts = [
"--ignore=site-packages",
"--ignore=dist-packages",
"--ignore=.direnv",
"--strict-markers",
"--doctest-modules",
]
norecursedirs = ["site-packages", "dist-packages", ".direnv"]
[tool.poetry2conda]
name = "protoletariat"
[tool.ruff]
line-length = 88
respect-gitignore = true
exclude = [".direnv", "result-*"]
target-version = "py38"
[tool.ruff.lint]
select = [
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # comprehensions
"D", # pydocstyle
"E", # pycodestyle
"EXE", # flake8-executable
"F", # pyflakes
"FA", # flake8-future-annotations
"FLY", # flynt (format string conversion)
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420 (implicit namespace packages)
"ISC", # flake8-implicit-str-concat
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PLC", # pylint
"PLE", # pylint
"PLR", # pylint import style
"PLW", # pylint
"RET", # flake8-return
"RUF", # ruff-specific rules
"S", # flake8-bandit
"SIM", # flake8-simplify
"T10", # flake8-debugger
"T20", # flake8-print
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # pycodestyle
"YTT", # flake8-2020
]
ignore = [
"B028", # required stacklevel argument to warn
"B904", # raise from e or raise from None in exception handlers
"B905", # zip-without-explicit-strict
"C408", # dict(...) as literal
"D100", # public module
"D101", # public class
"D102", # public method
"D103", # public function
"D104", # public package
"D105", # magic methods
"D106", # nested class
"D107", # init
"D202", # blank lines after function docstring
"D203", # blank line before class docstring
"D205", # blank line between summary line and description
"D213", # Multi-line docstring summary should start at the second line
"D401", # Imperative mood
"D402", # First line should not be the function's signature
"D413", # Blank line required after last section
"D417", # Missing argument descriptions
"E501",
"E501", # line-too-long, this is automatically enforced by ruff format
"E731", # lambda-assignment
"ISC001", # single line implicit string concat, handled by ruff format
"PGH003",
"PGH003", # blanket-type-ignore
"PLC0105", # covariant type parameters should have a _co suffix
"PLR0124", # name compared with self, e.g., a == a
"PLR0911", # too many return statements
"PLR0912", # too many branches
"PLR0913", # too many arguments
"PLR0915", # too many statements
"PLR2004", # forces everything to be a constant
"PLW2901", # overwriting loop variable
"RET504",
"RET504", # unnecessary-assign, these are useful for debugging
"RET505",
"RET505", # superfluous-else-return, stylistic choice
"RET506",
"RET506", # superfluous-else-raise, stylistic choice
"RET507",
"RET507", # superfluous-else-continue, stylistic choice
"RET508",
"RET508", # superfluous-else-break, stylistic choice
"RUF005", # splat instead of concat
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"S101", # ignore "Use of `assert` detected"
"SIM102", # nested ifs
"SIM108", # convert everything to ternary operator
"SIM114", # combine `if` branches using logical `or` operator
"SIM116", # dictionary instead of `if` statements
"SIM117", # nested with statements
"SIM118", # remove .keys() calls from dictionaries
"SIM300", # yoda conditions
"UP007", # Optional[str] -> str | None
"UP038", # non-pep604-isinstance, results in slower code
]
unfixable = [
"T201", # print statements
"F401", # unused imports
"RUF100", # unused noqa comments
"F841", # unused variables
]
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.per-file-ignores]
"*test*.py" = ["D"] # ignore all docstring lints in tests
[tool.mypy]
exclude = ".+/tests/.+\\.py$"
ignore_missing_imports = true
# untyped things
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
# Any handling
disallow_any_unimported = true
disallow_any_expr = false
disallow_any_decorated = true
disallow_any_explicit = true
disallow_any_generics = true
disallow_subclassing_any = true
# None/Optional handling
no_implicit_optional = true
# show more context on failure
show_error_context = true
# show codes in case we end up needing to ignore
show_error_codes = true
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"