-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
191 lines (171 loc) · 6.03 KB
/
Copy pathpyproject.toml
File metadata and controls
191 lines (171 loc) · 6.03 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
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
[dependency-groups]
dev = [
"exceptiongroup; python_version <= '3.10'",
"factory_boy",
"fixturefilehandler",
"invokelint[basic]>=0.20.1",
# Currently, migration steps is difficult
"pydantic>=2.13.5",
"pytest-resource-path",
"pyvelocity",
"returns",
"typing-extensions; python_version <= '3.10'",
]
[project]
name = "zaimcsvconverter"
version = "0.1.0"
readme = "README.md"
requires-python = ">=3.10"
license = {file = "LICENSE"}
authors = [
{name = "Yukihiko Shinoda", email = "yuk.hik.future@gmail.com"},
]
maintainers = [
{name = "Yukihiko Shinoda", email = "yuk.hik.future@gmail.com"},
]
dependencies = [
# To collect error when validate input record
"errorcollector",
# To read Kami CSV
"godslayer",
# To generate table name by model class name
"inflector",
# To uniquify undefined content errors
"numpy",
# To normalize CSV data to Pydantic model
"pydantictypes",
# To manage stores and items by database (now using SQLite)
"sqlalchemy",
# To read yaml file as config
"yamldataclassconfig",
]
[tool.setuptools.packages.find]
include = ["zaimcsvconverter", "zaimcsvconverter.*"]
[tool.bandit.assert_used]
skips = ["tests/*.py"]
[tool.coverage.report]
exclude_also = [
# Assume `if TYPE_CHECKING: ... else: ...` block is covered · Issue #831 · nedbat/coveragepy
# https://github.com/nedbat/coveragepy/issues/831#issuecomment-517778185
"if TYPE_CHECKING:",
# Pylint will detect instead:
# - abstract-method / W0223 - Pylint 2.17.0-dev0 documentation
# https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/abstract-method.html
"raise NotImplementedError",
]
[tool.coverage.run]
source = ["zaimcsvconverter"]
[tool.docformatter]
recursive = true
# For compatibility with Black
# - How to Configure docformatter — docformatter 1.7.5 documentation
# https://docformatter.readthedocs.io/en/stable/configuration.html#a-note-on-options-to-control-styles
pre_summary_space = true
wrap-descriptions = 119
wrap-summaries = 119
[tool.flake8]
# @see https://github.com/psf/black/blob/master/README.md#line-length
max_line_length = 108
extend_ignore = [
# For compatibility with Black:
# - Using Black with other tools - Black 25.1.0 documentation
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#bugbear
"E203",
"E501",
"E701",
# 2025-05-24 Now openstack/hacking wasn't introduced into Ruff and sorting imports is mainly considered with isort.
"H306",
# Cohesion may be in experimental.
"H601",
]
statistics = true
show_source = true
exclude = [
".venv",
]
[tool.mypy]
strict = true
plugins = [
"pydantic.mypy",
"returns.contrib.mypy.returns_plugin",
]
[[tool.mypy.overrides]]
module = [
"factory",
"inflector",
]
ignore_missing_imports = true
[tool.pylint]
disable = [
# We check line length by flake8-bugbear B950.
"line-too-long",
]
[tool.pylint.basic]
docstring-min-length = "7"
[tool.pylint.format]
max-line-length = 119
[tool.pylint.options]
# Since this rule against single responsibility principle.
# - python - Why does Pylint want two public methods per class? - Stack Overflow
# https://stackoverflow.com/a/40258006/12721873
min-public-methods = "1"
[tool.pytest.ini_options]
log_cli = true
log_cli_level = "DEBUG"
log_format = "%(asctime)s %(process)d %(levelname)s %(name)s:%(filename)s:%(lineno)d %(message)s"
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
]
[tool.ruff]
line-length = 119
[tool.ruff.lint]
external = [
"DUO", # dlint
"H", # Openstack/hacking
]
select = [
"ALL",
# Reason: Google styleguide changes from `rather than imperative` to `or imperative` and PEP 257 says `prescribes as command`:
# - styleguide/pyguide.md at 3c5c895c68bfb108cd5d936937dc36e2dfbdbcc2 · google/styleguide
# https://github.com/google/styleguide/blob/3c5c895c68bfb108cd5d936937dc36e2dfbdbcc2/pyguide.md?plain=1#L2072-L2077
# - Project import generated by Copybara. · google/styleguide@ec302b3
# https://github.com/google/styleguide/commit/ec302b363edada1d696c476dcaf69f310755f823#diff-e1f2a5c0feebbf5a01e735ab87d79b4bec2e684f40a67d37d1b69ffa0397b60eL1985
# - PEP 257 – Docstring Conventions | peps.python.org
# https://peps.python.org/pep-0257/#one-line-docstrings
# - Does Ruff support NumPy- or Google-style docstrings? | FAQ | Ruff
# https://docs.astral.sh/ruff/faq/
"D401", # First line should be in imperative mood
]
ignore = [
# lint.pydocstyle
# Reason: Docstring may be missed since docstring-min-length is set.
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in __init__
# Reason: First line may ends with function signature for expression.
"D402", # First line should not be the function’s “signature”
# Reason: First line may ends with ":" for expression.
"D415", # First line should end with a period, question mark, or exclamation point
# Reason: `Line too long` is checked by flake8-bugbear.
"E501", # Line too long ({width} > {limit})
]
unfixable = [
# When fix `return a and b != ""` as `return a and b`, mypy will report warning:
# error: Incompatible return value type (got "Union[Literal[False], str]", expected "bool") [return-value]
"PLC1901",
# To handle mypy's bug in case when use Pydantic custom data type.
"SIM108", # Use ternary operator `extra_context = {} if extra_context is None else request.param` instead of `if`-`else`-block
]
[tool.ruff.lint.isort]
force-single-line = true
[tool.ruff.lint.mccabe]
# The default value: 10 is too loose,
# 5 is as same as the default value of Radon for A rank that we use without any problems for a decade.
max-complexity = 5
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101"]
[tool.ruff.lint.pydocstyle]
convention = "google"