Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
103 lines (85 loc) · 2.53 KB
/
Copy pathpyproject.toml
File metadata and controls
103 lines (85 loc) · 2.53 KB
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
[project]
name = "experimental"
version = "0.1.0"
description = "Monorepo"
readme = "README.org"
requires-python = ">=3.11"
authors = [{ name = "Jaehyun Yeom", email = "jae.yeom@gmail.com" }]
dependencies = [
"grpcio",
"protobuf",
"protovalidate",
]
[dependency-groups]
dev = ["pytest"]
[tool.uv]
package = false
exclude-newer = "7 days"
[tool.ruff]
extend-exclude = [
"*_pb2.py", # Generated protobuf
"*_pb2_grpc.py", # Generated gRPC
"bazel-*", # Bazel
]
# PEP 8 recommends line-length 79
line-length = 79
indent-width = 4
fix = true
[tool.ruff.lint]
extend-select = ["UP", "D"]
ignore = []
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.isort]
# gen/ holds buf-generated protobuf modules imported as a local package
# (e.g. codelab/proto/gen). It is not reachable from `src`, so isort would
# otherwise sort it into the third-party block.
known-first-party = ["gen"]
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "preserve"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
docstring-code-format = true
# Set the line length limit used when formatting code snippets in
# docstrings.
docstring-code-line-length = "dynamic"
[tool.ruff.lint.pydocstyle]
# My default choice is Google style because the docstring is concise yet
# visually easy to understand.
convention = "google"
[tool.mypy]
python_version = "3.11"
strict = true
mypy_path = "codelab/proto"
files = [
"codelab/proto/client.py",
"codelab/proto/server.py",
"codelab/proto/client_test.py",
"codelab/proto/server_test.py",
"scripts/strip_pr_html_comments.py",
"scripts/strip_pr_html_comments_test.py",
]
exclude = [
"(^|/)gen/",
".*_pb2\\.py$",
".*_pb2_grpc\\.py$",
"^bazel-",
]
# Host mypy is an isolated uv tool; grpcio/pytest/protovalidate are not
# installed next to it. Generated pb2 modules build messages dynamically.
ignore_missing_imports = true
disallow_subclassing_any = false
disallow_untyped_decorators = false
[[tool.mypy.overrides]]
module = ["gen", "gen.*"]
follow_imports = "skip"