-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
269 lines (250 loc) · 7.31 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
[project]
name = "mkdocs-mknodes"
authors = [
{ name = "Philipp Temminghoff", email = "[email protected]" },
]
description = "Don't write docs. Code them."
readme = "README.md"
dynamic = ["version"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development :: Documentation",
"Topic :: Software Development :: User Interfaces",
"Topic :: Documentation",
"Topic :: Internet",
"Topic :: Text Processing :: Markup :: Markdown",
]
keywords = [
"framework",
"docs",
"docstrings",
"documentation",
"internet",
"markdown",
]
requires-python = ">=3.12"
dependencies = [
# MkDocs
"mkdocs >=1.5",
"pathspec",
"mknodes",
# CLI
"rich",
"typer",
# Tools
"jinja2",
"jinjarope",
"yamling",
"universal_pathlib",
"pydantic",
"logfire[requests,aiohttp,system-metrics]==2.6.0",
"opentelemetry-instrumentation-urllib3",
# "opentelemetry-instrumentation-sqlite3",
"opentelemetry-instrumentation-urllib",
"opentelemetry-instrumentation-jinja2",
"yarl>=1.17.1",
]
license = "MIT"
[project.scripts]
mknodes = "mkdocs_mknodes.cli:cli"
[project.entry-points."mkdocs.plugins"]
mknodes = "mkdocs_mknodes.plugin:MkNodesPlugin"
[project.urls]
Documentation = "https://phil65.github.io/mkdocs-mknodes/"
Source = "https://github.com/phil65/mkdocs_mknodes"
Gitter = "https://app.gitter.im/#/room/#mknodes:gitter.im"
[build-system]
requires = ["hatchling", "hatch-regex-commit"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "regex_commit"
commit_extra_args = ["-e"]
path = "mkdocs_mknodes/__init__.py"
[tool.hatch.metadata]
allow-direct-references = true
[tool.uv]
dev-dependencies = [
# lint
"ruff",
"mypy[faster-cache]",
# test
"pytest",
"pytest-cov",
# docs
"mkdocs-material >= 9.5",
"pymdown-extensions",
"mkdocstrings[python]",
"griffe-fieldz",
# dev
"pyreadline3",
"pyinstrument",
"devtools",
# used for formatting signature
"black",
"pygments",
# Material Social addon
"cairosvg",
"pillow",
]
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["tests"]
log_cli = true
# log_cli_level = "DEBUG"
log_format = "%(asctime)s %(levelname)s %(message)s"
log_date_format = "%Y-%m-%d %H:%M:%S"
addopts = "--cov=mkdocs_mknodes/ --cov-report=term-missing"
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"@overload",
"except ImportError",
'if __name__ == "__main__":',
]
[tool.mypy]
python_version = "3.12"
disable_error_code = ["assignment", "misc", "import", "has-type"]
pretty = true
plugins = ["pydantic.mypy"]
[tool.ruff]
line-length = 90
extend-exclude = ['docs']
target-version = "py312"
[tool.ruff.lint]
select = [
"A", # Flake8-builtins
# "ANN", # Flake8-Annotations
# "ASYNC", # Flake8-Async
# "ARG", # # Flake8-Unused-Arguments
"B", # flake8-bugbear
"BLE", # Flake8-blind-except
"C",
"C4", # flake8-comprehensions
# "C90", # MCCabe
"COM", # Flake8-commas
# "CPY", # Copyright-related rules
"D", # PyDocStyle
# "DTZ", # Flake8- Datetimez
"E", # PyCodeStyle Error
"EM", # flake8-errmsg
# "ERA", # Eradicate
"EXE", # flake8-executable
"F", # PyFlakes
"FA", # flake8-future-annotations
# "FBT", # flake8-boolean-trap
# "FIX", # flake8-fixme
"FLY", # flynt
"G", # flake8-logging-format
"I", # ISort
"ICN", # Flake8-import-conventions
"INP", # flake8-no-pep420
"INT", # flake8-gettext
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming
# "NPY", # numpy-specific rules
# "PD", # pandas-vet
"PERF", # perflint
# "PGH", # pygrep-hooks
"PIE", # flake8-pie
"PLE", # PyLint Error
"PLC", # PyLint convention
# "PLW", # PyLint Warning
"PLR", # PyLint refactor
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # ruff-specific rules
# "S", # flake8-bandit
"SIM", # flake8-simplify
"SLF", # flake8-self
"SLOT", # flake8-slots
# "T",
# "TD", # flake8-todos
"T10", # flake8-debugger
# "T20", # flake8-print
# "TC", # flake8-type-checking
"TID", # flake8-tidy-imports
"TRY", # tryceratops
"UP", # PyUpgrade
"W", # PyCodeStyle warning
"YTT", # flake8-2020
]
ignore = [
"C408", # Unnecessary {obj_type} call (rewrite as a literal)
"B905", # zip() without an explicit strict= parameter
"C901", # {name} is too complex ({complexity} > {max_complexity})
# "CPY001", # Missing copyright notice at top of file
"COM812",
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in __init__
"D203", # 1 blank line required before class docstring
"D204", # 1 blank line required after class docstring
"D213", # Multi-line docstring summary should start at the second line
"D215", # Section underline is over-indented ("{name}")
"D400", # First line should end with a period
"D401", # First line of docstring should be in imperative mood: "{first_line}"
"D404", # First word of the docstring should not be "This"
"D406", # Section name should end with a newline ("{name}")
"D407", # Missing dashed underline after section ("{name}")
"D408", # Section underline should be in the line following the section's name ("{name}")
"D409", # Section underline should match the length of its name ("{name}")
"D413", # Missing blank line after last section ("{name}")
"ISC001",
"PLR0912", # Too many branches
"PLR0913", # Too many arguments to function call
"PLR0915", # Too many statements
"SLF001", # Private member accessed
"TRY003", # Avoid specifying long messages outside the exception class
]
[tool.ruff.format]
# Enable preview style formatting.
preview = true
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.lint.isort]
lines-after-imports = 2
# lines-between-types = 1
# atomic = true
force-sort-within-sections = true
combine-as-imports = true
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402", "I001"]
[tool.pyright]
pythonVersion = "3.12"
pythonPlatform = "All"
deprecateTypingAliases = true
reportUnusedCallResult = false
reportUnknownVariableType = false
reportImplicitOverride = false
reportAny = false
reportUnannotatedClassAttribute = false
reportExplicitAny = false
reportImplicitStringConcatenation = false
[tool.mknodes]
allowed-commit-types = [
"fix",
"feat",
"refactor",
"docs",
"test",
"build",
"chore",
]
docstring-style = "google"