-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpyproject.toml
More file actions
174 lines (147 loc) · 4.25 KB
/
pyproject.toml
File metadata and controls
174 lines (147 loc) · 4.25 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
[build-system]
requires = ["setuptools>=61", "setuptools-scm[simple]>=8"]
build-backend = "setuptools.build_meta"
[project]
name = "docstub"
maintainers = [
{name = "Lars Grüter"},
]
description = "Generate Python stub files from docstrings"
readme = "README.md"
# Need to include license of vendored code as well
license = "BSD-3-Clause AND PSF-2.0"
license-files = ["LICENSE.txt"]
requires-python = ">=3.12"
keywords = ["typing", "stub files", "docstings", "numpydoc"]
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Code Generators",
"Topic :: Scientific/Engineering",
]
dynamic = ["version"]
dependencies = [
"numpydoc >=1.7.0",
"click >=8.1.7",
"libcst >=1.3.1",
"lark >=1.1.9",
"black >=24.4.2",
"isort >=5.13.2",
]
[project.urls]
Source = "https://github.com/lagru/docstub"
Documentation = "https://docstub.readthedocs.io"
[project.scripts]
docstub = "docstub.__main__:cli"
[dependency-groups]
test = [
"pytest >=8.4.1",
"pytest-cov >= 5.0.0",
"mypy >=1.17.0",
"basedpyright >=1.31",
]
docs = [
"sphinx",
"furo ==2025.9.25",
"numpydoc",
"myst-parser",
"sphinx-copybutton",
"setuptools-scm[simple] >=8"
]
dev = [
{include-group = "test"},
{include-group = "docs"},
"pre-commit >=4.3.0",
"ipython",
]
[tool.setuptools_scm]
write_to = "src/docstub/_version.py"
[tool.ruff]
src = ["src", "tests"]
[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"I", # isort
"C4", # flake8-comprehensions
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
"EXE", # flake8-executable
# "PYI", # flake8-pyi
]
ignore = [
"PLR09", # Too many <...>
"PLR2004", # Magic value used in comparison
"ISC001", # Conflicts with formatter
"RET504", # Assignment before `return` statement facilitates debugging
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"PTH123", # Using builtin open() instead of Path.open() is fine
"SIM108", # Terniary operator is always more readable
"SIM103", # Don't recommend returning the condition directly
]
[tool.ruff.lint.per-file-ignores]
"_cli.py" = ["PLC0415"] # Ignore imports that are not at the top-level
[tool.pytest.ini_options]
minversion = "8"
addopts = [
"-ra",
"--showlocals",
"--strict-markers",
"--strict-config",
"--doctest-modules"
]
xfail_strict = true
filterwarnings = ["error"]
log_cli_level = "info"
testpaths = ["src", "tests"]
markers = [
"slow: marks tests as slow (deselect with `-m 'not slow'`)",
]
[tool.coverage]
run.source = ["docstub"]
[tool.changelist.label_section_map]
".*enhancement.*" = "Enhancement"
".*(deprecation|API).*" = "Deprecations"
".*performance.*" = "Performance"
".*fix.*" = "Bug Fixes"
".*documentation.*" = "Documentation"
".*devops.*" = "DevOps"
".*maintenance.*" = "Maintenance"
[tool.docstub.types]
Path = "pathlib"
[tool.mypy]
strict = true
warn_unreachable = false
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
disable_error_code = ["type-arg"]
# Don't type test suite itself but check if usage makes sense with docstub's stubs
[[tool.mypy.overrides]]
module = "tests.*"
check_untyped_defs = true
allow_untyped_defs = true
disable_error_code = ["var-annotated", "union-attr"]
# NumPyDoc isn't typed?
[[tool.mypy.overrides]]
module = ["numpydoc.*"]
ignore_missing_imports = true
[tool.basedpyright]
typeCheckingMode = "standard"