-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpyproject.toml
More file actions
271 lines (242 loc) · 7.3 KB
/
pyproject.toml
File metadata and controls
271 lines (242 loc) · 7.3 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
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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "mkdocstrings-python-xref"
description = "Enhanced mkdocstrings python handler"
readme = "README.md"
authors = [
{name = "Christopher Barber", email="Christopher.Barber@analog.com" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development :: Documentation",
"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",
]
keywords = [
"documentation-tool", "mkdocstrings", "mkdocstrings-handler", "python"
]
dynamic = ["version"]
requires-python = ">=3.9"
dependencies = [
"mkdocstrings-python >=1.16.6,<2.0",
"griffe >=1.0"
]
[project.urls]
Repository = "https://github.com/analog-garage/mkdocstrings-python-xref"
Documentation = "https://analog-garage.github.io/mkdocstrings-python-xref/"
[project.optional-dependencies]
dev = [
"build >=1.0.0", # python-build on conda
"hatchling >=1.21",
"coverage >=7.4.0",
"pytest >=8.2",
"pytest-cov >=5.0",
"mypy >=1.10",
"ruff >=0.4.10",
"beautifulsoup4 >=4.12",
"black >=23.12",
"mike >=1.1",
"mkdocs >=1.5.3,<2.0",
"mkdocs-material >=9.5.4",
"linkchecker >=10.4"
]
[tool.pixi.workspace]
name = "mkxref-dev"
channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64", "win-64"]
[tool.pixi.dependencies]
# Use conda for these in pixi
mkdocstrings-python ="*"
griffe ="*"
hatchling = "*"
python-build = "*"
coverage ="*"
pytest ="*"
pytest-cov ="*"
mypy ="*"
ruff = "*"
black = "*"
mike = "*"
mkdocs = "*"
mkdocs-material = "*"
linkchecker = "*"
[tool.pixi.pypi-dependencies]
mkdocstrings-python-xref = { path = ".", editable = true }
[tool.pixi.environments]
default = {features = ["dev"]}
[tool.hatch.version]
path = "src/mkdocstrings_handlers/python_xref/VERSION"
pattern = "\\s*(?P<version>[\\w.]*)"
[tool.hatch.build]
include = [
"src/**/*.py",
"src/mkdocstrings_handlers/python_xref/VERSION",
"src/mkdocstrings_handlers/python_xref/py.typed",
]
[tool.hatch.build.targets.wheel]
packages = [
"src/mkdocstrings_handlers",
]
[tool.mypy]
check_untyped_defs = true
mypy_path = "src"
namespace_packages = true
explicit_package_bases = true
files = [
"src/mkdocstrings_handlers",
"tests"
]
show_error_codes = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
[[tool.mypy.overrides]]
module = [
"bs4"
]
ignore_missing_imports = true
[tool.ruff.lint]
# TODO add "I" (isort)
# TODO add "RUF"
# TODO add "ARG"
# TODO add "SIM"
# TODO add "S" (bandit)
# TODO add "PT" (pytest style)
# TODO add "CPY101"
select = ["E", "F", "PL", "D", "R", "T10", "EXE"]
ignore = [
"D105", # missing doc string for dunder methods
"D200", # one line doc string
"D202", # blank lines after function docstring
"D205", # doc on first line
"D212", # doc on first line
"D410", # blank line after doc section
"D411", # blank line before doc section
"D412", # no blank lines after section header
"D415", # doc title punctuation
"E501", # line too long
"PLC0105", # covariant metatype names
"PLR0913", # too-many-argument
"PLR2004", # magic value
"PT001", # allow @pytest.fixture without parens
"RET504", # unnecessary assignment to variable before return
"S101", # use of assert - do we care?
# TODO: fix the ones below
"D403", # capitalize first word of doc string
"D102", # undocumented public method
"D104", # missing docstring in public package
"D107", # __init__ docstring
"D417", # missing argument description
]
preview = true
explicit-preview-rules = true # only preview explicitly selected rules (E.g. CPY001)
[tool.ruff.lint.per-file-ignores]
# Ignore some issues in tests
"tests/**" = [
"F401", # unused import (pytest fixture)
"F403", # wildcard import (for fixtures)
"F405", # defined from star imports (typicallky a pytest fixture)
"F811", # redefinition of unused (typically a pytest fixture)
"PLR0912", # too many branches
"PLR0915", # too many statements
"S", # bandit rules
]
[tool.ruff.lint.pylint]
#max-locals = 30
max-branches = 15
#max-attributes = 30
[tool.ruff.lint.pydocstyle]
convention = "google"
[too.ruff.format]
skip-magic-trailing-comma = false
line-ending = "lf"
[tool.pylint.main]
jobs = 0
# Minimum Python version to use for version dependent checks.
py-version = "3.8"
[tool.pylint.format]
max-line-length = 110
max-module-lines = 2000
[tool.pylint."messages control"]
disable = [
"bad-inline-option",
"c-extension-no-member",
"consider-using-from-import",
"deprecated-pragma",
"disallowed-name",
"file-ignored",
"fixme",
"import-outside-toplevel",
"invalid-characters-in-docstring",
"invalid-name",
"locally-disabled",
"multiple-statements",
"no-else-return",
"raw-checker-failed",
"superfluous-parens",
"suppressed-message",
"too-few-public-methods",
"too-many-arguments",
"too-many-branches",
"too-many-instance-attributes",
"too-many-locals",
"too-many-public-methods",
"too-many-statements",
"trailing-newlines",
"trailing-whitespace",
"unspecified-encoding",
"unused-wildcard-import",
"use-dict-literal",
"use-symbolic-message-instead",
"useless-suppression",
"wrong-import-order",
"wrong-import-position",
"wrong-spelling-in-comment",
"wrong-spelling-in-docstring",
]
[tool.pixi.tasks]
# linting tasks
mypy = "mypy"
ruff = "ruff check src/mkdocstrings_handlers tests"
lint = {depends-on = ["ruff", "mypy"]}
# testing tasks
pytest = "pytest -sv -ra tests"
test = {depends-on = ["pytest", "lint"]}
coverage = "pytest -ra --cov --cov-report=html --cov-report=term -- tests"
coverage-show = "python -m webbrowser file://$PIXI_PROJECT_ROOT/htmlcov/index.html"
# doc tasks
docs = {depends-on = ["doc"]}
show-doc = "mkdocs serve -f mkdocs.yml"
show-docs = {depends-on = ["show-doc"]}
# cleanup tasks
clean-build = "rm -rf build dist"
clean-coverage = "rm -rf .coverage .coverage.* htmlcov"
clean-docs = "rm -rf site"
clean-test = "rm -rf .pytest_cache .mypy_cache .ruff_cache"
clean = {depends-on = ["clean-build", "clean-coverage", "clean-test"]}
# build tasks
build = {depends-on = ["build-wheel", "build-sdist", "build-conda"]}
[tool.pixi.tasks.build-wheel]
env = {VERSION = "$(cat src/mkdocstrings_handlers/python_xref/VERSION)"}
cmd = "pip wheel . --no-deps --no-build-isolation -w dist"
inputs = ["pyproject.toml", "LICENSE.md", "src/**/*"]
outputs = ["dist/mkdocstrings_python_xref-$VERSION-py3-none-any.whl"]
[tool.pixi.tasks.build-sdist]
env = {VERSION = "$(cat src/mkdocstrings_handlers/python_xref/VERSION)"}
cmd = "python -m build --sdist --no-isolation --outdir dist"
inputs = ["pyproject.toml", "LICENSE.md", "src/**/*"]
outputs = ["dist/mkdocstrings_python_xref-$VERSION.tar.gz"]
[tool.pixi.tasks.build-conda]
#env = {VERSION = "$(cat src/mkdocstrings_handlers/python_xref/VERSION)"}
cmd = "whl2conda convert dist/*.whl -w dist --overwrite"
depends-on = ["build-wheel"]
inputs = ["dist/mkdocstrings_python_xref-$VERSION-py3-none-any.whl"]
[tool.pixi.tasks.doc]
cmd = "mkdocs build -f mkdocs.yml"
inputs = ["docs/*.md", "docs/*.svg", "mkdocs.yml"]
outputs = ["site/*.html"]