This repository has been archived by the owner on Jul 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
289 lines (256 loc) · 8.09 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0"]
[tool.poetry]
authors = ["Nate Landau <github@natenate.org>"]
description = "Make batch updates to Obsidian metadata"
homepage = "https://github.com/natelandau/obsidian-metadata"
keywords = ["obsidian"]
license = "GNU AFFERO"
name = "obsidian-metadata"
readme = "README.md"
repository = "https://github.com/natelandau/obsidian-metadata"
version = "0.12.1"
[tool.poetry.scripts] # https://python-poetry.org/docs/pyproject/#scripts
obsidian-metadata = "obsidian_metadata.cli:app"
[tool.poetry.dependencies]
charset-normalizer = "^3.2.0"
emoji = "^2.8.0"
loguru = "^0.7.0"
python = "^3.10"
questionary = "^1.10.0"
regex = "^2023.8.8"
rich = "^13.5.2"
ruamel-yaml = "^0.17.32"
shellingham = "^1.5.3"
tomlkit = "^0.12.1"
typer = "^0.9.0"
[tool.poetry.group.test.dependencies]
pytest = "^7.4.0"
pytest-clarity = "^1.0.1"
pytest-mock = "^3.11.1"
pytest-pretty-terminal = "^1.1.0"
pytest-xdist = "^3.3.1"
[tool.poetry.group.dev.dependencies]
black = "^23.7.0"
commitizen = "^3.7.0"
coverage = "^7.3.0"
interrogate = "^1.5.0"
mypy = "^1.8.0"
pdoc = "^14.0.0"
poethepoet = "^0.22.0"
pre-commit = "^3.3.3"
ruff = "^0.1.13"
sh = "^2.0.6"
types-python-dateutil = "^2.8.19.14"
typos = "^1.17.1"
vulture = "^2.9.1"
[tool.black]
line-length = 100
[tool.commitizen]
bump_message = "bump(release): v$current_version → v$new_version"
changelog_incremental = true
tag_format = "v$version"
update_changelog_on_bump = true
version = "0.12.1"
version_files = ["pyproject.toml:version", "src/obsidian_metadata/__version__.py:__version__"]
[tool.coverage.report] # https://coverage.readthedocs.io/en/latest/config.html#report
exclude_lines = [
'def __repr__',
'except [\w\s\._]+ as .*:',
'log\.critical',
'log\.debug',
'log\.error',
'log\.exception',
'log\.info',
'log\.success',
'log\.trace',
'log\.warning',
'pragma: no cover',
'raise Abort',
'raise Exit',
'raise typer\.Exit',
]
fail_under = 50
precision = 1
show_missing = true
skip_covered = true
[tool.coverage.run]
branch = true
command_line = "--module pytest"
data_file = "reports/.coverage"
source = ["src"]
[tool.coverage.xml]
output = "reports/coverage.xml"
[tool.interrogate]
exclude = ["build", "docs", "tests"]
fail-under = 90
ignore-init-method = true
verbose = 2
[tool.mypy] # https://mypy.readthedocs.io/en/latest/config_file.html
disallow_any_unimported = false
disallow_subclassing_any = false
disallow_untyped_decorators = false
disallow_untyped_defs = true
exclude = [
'tests/', # TOML literal string (single-quotes, regex okay, no escaping necessary)
]
follow_imports = "normal"
ignore_missing_imports = true
junit_xml = "reports/mypy.xml"
no_implicit_optional = true
pretty = false
show_column_numbers = true
show_error_codes = true
show_error_context = true
strict_optional = false
warn_redundant_casts = true
warn_unreachable = true
warn_unused_ignores = true
[tool.pytest.ini_options]
addopts = "--color=yes --doctest-modules --exitfirst --failed-first --strict-config --strict-markers --verbosity=2 --junitxml=reports/pytest.xml"
filterwarnings = ["error", "ignore::DeprecationWarning"]
testpaths = ["src", "tests"]
xfail_strict = true
[tool.ruff] # https://github.com/charliermarsh/ruff
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
# Avoiding flagging (and removing) `V101` from any `# noqa`
# directives, despite Ruff's lack of support for `vulture`.
external = ["V101"]
fix = true
ignore = [
"B006",
"B008",
"D107",
"D203",
"D204",
"D213",
"D215",
"D404",
"D406",
"D407",
"D408",
"D409",
"D413",
"E501",
"N805",
"PGH001",
"PGH003",
"UP007",
]
ignore-init-module-imports = true
line-length = 100
per-file-ignores = { "cli.py" = [
"PLR0912",
"PLR0913",
], "tests/*.py" = [
"PLR0913",
"PLR2004",
"S101",
] }
select = [
"A", # flake8-builtins
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"BLE", # flake8-blind-exception
"C40", # flake8-comprehensions
"C90", # McCabe
"D", # pydocstyle
"E", # pycodestyle Errors
"ERA", # flake8-eradicate
"EXE", # flake8-executable
"F", # pyflakes
"I", # iSort
"N", # Pep8-naming
"PGH", # pygrep-hooks
"PLC", # pylint Convention
"PLE", # pylint Error
"PLR", # pylint Refactor
"PLW", # pylint Warning
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"Q", # flake8-quotes
"RET", # flake8-return
"RUF", # Ruff-specific rules
"S", # flake8-bandit
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # pycodestyle Warnings
"YTT", # flake8-2020
]
src = ["src", "tests"]
target-version = "py310"
unfixable = ["ERA001", "F401", "F841", "UP007"]
[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.pylint]
max-args = 6
[tool.vulture] # https://pypi.org/project/vulture/
# exclude = ["file*.py", "dir/"]
# ignore_decorators = ["@app.route", "@require_*"]
ignore_names = ["args", "cls", "indentless", "kwargs", "request", "version"]
# make_whitelist = true
min_confidence = 80
paths = ["src", "tests"]
sort_by_size = true
verbose = false
[tool.poe.tasks]
[tool.poe.tasks.docs]
cmd = """
pdoc
--docformat google
--output-directory docs
src/obsidian_metadata
"""
help = "Generate this package's docs"
[tool.poe.tasks.lint]
help = "Lint this package"
[[tool.poe.tasks.lint.sequence]]
shell = "ruff src/ --no-fix"
[[tool.poe.tasks.lint.sequence]]
shell = "black --check src/ tests/"
[[tool.poe.tasks.lint.sequence]]
shell = "poetry check"
[[tool.poe.tasks.lint.sequence]]
shell = "mypy --config-file pyproject.toml src/"
[[tool.poe.tasks.lint.sequence]]
shell = "vulture src/ tests/"
[[tool.poe.tasks.lint.sequence]]
shell = "yamllint ."
[[tool.poe.tasks.lint.sequence]]
shell = "typos"
[[tool.poe.tasks.lint.sequence]]
shell = "interrogate -c pyproject.toml ."
[tool.poe.tasks.test]
help = "Test this package"
[[tool.poe.tasks.test.sequence]]
cmd = "coverage run"
[[tool.poe.tasks.test.sequence]]
cmd = "coverage report"
[[tool.poe.tasks.test.sequence]]
cmd = "coverage xml"