-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpyproject.toml
More file actions
131 lines (112 loc) · 2.92 KB
/
pyproject.toml
File metadata and controls
131 lines (112 loc) · 2.92 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
[build-system]
requires = ["setuptools>=61", "setuptools_scm[toml]>=7"]
build-backend = "setuptools.build_meta"
[project]
name = "docstub"
authors = [
{name = "Lars Grüter"},
]
description = "Generate Python stub files (PYI) from docstrings"
readme = "README.md"
license.file = "LICENSE"
requires-python = ">=3.12"
classifiers = [
"Development Status :: 1 - Planning",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
"Typing :: Typed",
]
dynamic = ["version"]
dependencies = [
"numpydoc >=1.7.0",
"click >=8.1.7",
"libcst >=1.3.1",
"lark >=1.1.9",
]
[project.optional-dependencies]
optional = [
"black >=24.4.2",
"isort >=5.13.2",
]
dev = [
"pre-commit >=3.7",
"ipython",
]
test = [
"pytest >=5.0.0",
"pytest-cov >= 5.0.0",
"mypy",
]
[project.urls]
Home = "https://github.com/lagru/docstub"
[project.scripts]
docstub = "docstub.__main__:cli"
[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
"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.pytest.ini_options]
addopts = "--doctest-modules"
testpaths = [
"src",
"tests",
]
[tool.coverage]
run.source = ["docstub"]
[tool.docstub.types]
Path = "pathlib"
[tool.docstub.type_prefixes]
cst = "libcst"
lark = "lark"
numpydoc = "numpydoc"
[tool.mypy]
strict = true
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