-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpyproject.toml
More file actions
216 lines (190 loc) · 7.15 KB
/
Copy pathpyproject.toml
File metadata and controls
216 lines (190 loc) · 7.15 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[dependency-groups]
dev = [
"bump-my-version",
"fixturefilehandler",
"invokelint[basic]>=0.19.0",
"pytest-resource-path",
"pyvelocity; python_version >= '3.9'",
"types-pyyaml>=6.0.12.12",
]
[project]
name = "yamldataclassconfig"
version = "2.1.0"
description = "This project helps you to import config file writen by YAML to Python data class."
readme = "README.md"
requires-python = ">=3.7"
license = {file = "LICENSE"}
keywords = ["yaml", "dataclass", "dataclasses", "config"]
authors = [
{name = "Yukihiko Shinoda", email = "yuk.hik.future@gmail.com"},
]
maintainers = [
{name = "Yukihiko Shinoda", email = "yuk.hik.future@gmail.com"},
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development",
"Topic :: Software Development :: Quality Assurance",
"Typing :: Typed",
]
dependencies = [
# To convert dictionary to model
"dataclasses-json",
# To raise multiple exceptions for validating each field of config file
"exceptiongroup; python_version < '3.11'",
# To convert yaml to dictionary
"pyyaml",
]
[project.urls]
homepage = "https://github.com/yukihiko-shinoda/yaml-dataclass-config"
# documentation = "https://readthedocs.org"
repository = "https://github.com/yukihiko-shinoda/yaml-dataclass-config"
# changelog = "https://github.com/me/spam/blob/master/CHANGELOG.md"
[tool.bandit.assert_used]
skips = ["tests/*"]
[tool.bumpversion]
current_version = "2.1.0"
commit = true
tag = true
[[tool.bumpversion.files]]
filename = "pyproject.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'
[[tool.bumpversion.files]]
filename = "yamldataclassconfig/__init__.py"
search = '__version__ = "{current_version}"'
replace = '__version__ = "{new_version}"'
[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 = ["yamldataclassconfig"]
[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]
# Since B950 in flake8-bugbear detects lines that exceed max_line_length by more than 10%:
# - PyCQA/flake8-bugbear: A plugin for Flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle.
# https://github.com/PyCQA/flake8-bugbear?tab=readme-ov-file#opinionated-warnings
# This setting follows the Black documentation in case when we use flake8-bugbear:
# - Using Black with other tools - Black 25.1.0 documentation
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#bugbear
# Set max_line_length to account for B950's 10% allowance to maintain consistency with pyvelocity
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
[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]
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",
# Since compatible with PEP257, we can check docstring style by Ruff and don't need to consider about docstring style separately:
# - Should the first line of a Python function docstring be in imperative mood? (ruff / pydocstyle D401)
# https://zenn.dev/y_shinoda/articles/pydocstyle-d401
"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",
]
[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"
[tool.setuptools]
zip-safe = false
[tool.setuptools.package-data]
"*" = ["py.typed"]
[tool.setuptools.packages.find]
include = ["yamldataclassconfig", "yamldataclassconfig.*"]