-
Notifications
You must be signed in to change notification settings - Fork 5
/
pyproject.toml
204 lines (179 loc) · 5.49 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
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "typeshed_stats"
dynamic = ["version"]
authors = [
{ name="Alex Waygood", email="[email protected]" },
]
description = "Library and command-line tool to gather stats on typeshed packages"
license = { text = "MIT" }
readme = "README.md"
requires-python = ">=3.10"
keywords = [
"typeshed",
"typing",
"stubs",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Software Development",
"Typing :: Typed",
]
dependencies = [
"attrs>=22.2.0",
"cattrs",
"aiohttp[speedups]>=3.9.0; python_version < '3.13'",
"aiohttp>=3.9.0; python_version >= '3.13'",
"packaging",
"pathspec>=0.10.3", # needs to be py.typed
"Jinja2>=3",
"tomli; python_version < '3.11'",
]
[project.urls]
"Homepage" = "https://github.com/AlexWaygood/typeshed-stats"
"Bug Tracker" = "https://github.com/AlexWaygood/typeshed-stats/issues"
[project.scripts]
typeshed-stats = "typeshed_stats._cli:main"
[project.optional-dependencies]
rich = ["rich", "rich-argparse>=1"]
dev = [
"typeshed-stats[rich]",
"MarkDown==3.7",
"mkdocs==1.6.1",
"mkdocs-macros-plugin==1.2.0",
"mkdocs-material==9.5.39",
"mkdocstrings==0.26.1",
"mkdocstrings-python==1.11.1",
"beautifulsoup4>=4,<5",
"covdefaults==2.3.0",
"coverage==7.6.1",
"Markdown>=3,<4",
"pyright==1.1.331",
"pytest==8.3.3",
"pytest-antilru==2.0.0",
"pytest-asyncio==0.24.0",
"pytest-dependency==0.6.0",
"pytest-mock==3.14.0",
"pytest-subtests==0.13.1",
"mypy==1.11.2",
"types-beautifulsoup4==4.12.0.20240907",
"types-Markdown==3.7.0.20240822",
]
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "src/typeshed_stats/_version.py"
[tool.ruff]
fix = true
preview = true
line-length = 88
[tool.ruff.format]
docstring-code-format = true
skip-magic-trailing-comma = true
[tool.ruff.lint]
select = ["E", "F", "B", "B9", "D", "SIM", "I", "PT", "UP", "PGH", "PYI", "RUF"]
ignore = [
# These are all enforced by, or incompatible with, the ruff formatter:
"E203",
"E501",
"W291",
"W293",
# It's often necessary to compare types instead of using isinstance();
# on this code base, this check has 0 true positives and many false positives:
"E721",
# Stylistic lints with which I disagree:
"PT004",
"PT005",
"RUF005",
# Let mypy/pyright complain about blanket type ignores or implicit optional
"PGH004",
"RUF013",
# Makes code slower and more verbose
# https://github.com/astral-sh/ruff/issues/7871
"UP038",
# wants us to use typing.Self,
# but we support Python 3.10 and don't depend on typing_extensions
"PYI019"
]
unfixable = [
"F841", # unused variable. ruff keeps the call, but mostly we want to get rid of it all
"F601", # automatic fix might obscure issue
"F602", # automatic fix might obscure issue
"B018", # automatic fix might obscure issue
"RUF017" # Ruff's fix is faster, but I prefer using itertools.chain_from_iterable
]
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = [
"D", # Don't need docstrings in test methods
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.isort]
combine-as-imports = true
split-on-trailing-comma = false
[tool.codespell]
ignore-words-list = ["corus"]
[tool.mypy]
files = ['website_macros.py', 'src', 'tests', 'scripts']
show_traceback = true
pretty = true
strict = true
enable_error_code = 'ignore-without-code,redundant-expr,possibly-undefined'
warn_unreachable = true
[tool.pyright]
include = ["."]
venv = "env"
pythonVersion = "3.10"
typeCheckingMode = "strict"
# Extra strict settings
reportMissingModuleSource = "error"
reportShadowedImports = "error"
reportCallInDefaultInitializer = "error"
reportUnnecessaryTypeIgnoreComment = "error"
# Leave "type: ignore" comments to mypy
enableTypeIgnoreComments = false
# Runtime libraries used are not all py.typed
useLibraryCodeForTypes = true
# Overly strict settings with false positives
reportMissingSuperCall = "none"
reportImplicitStringConcatenation = "none"
reportUninitializedInstanceVariable = false
# Already flagged by mypy
reportMissingTypeStubs = "none"
# Extremely strict settings that result in lots of pyright: ignores everywhere
reportUnknownVariableType = false
reportUnknownArgumentType = false
reportUnknownMemberType = false
reportUnknownLambdaType = false
reportUnnecessaryIsInstance = false
[tool.pytest.ini_options]
testpaths = ["src", "tests"]
addopts = "--strict-config --strict-markers"
xfail_strict = true
asyncio_mode = "auto"
markers = ["requires_network"]
filterwarnings = [
"error",
# Ignore ResourceWarnings about unclosed sockets
'ignore:Exception ignored in:pytest.PytestUnraisableExceptionWarning',
]
[tool.coverage.run]
# Note that many settings are automatically added due to this plugin
plugins = ["covdefaults"]
source = ["src/typeshed_stats", "tests"]
[tool.coverage.report]
# This extends the lines that covdefaults already excludes
exclude_lines = ['^if typing.TYPE_CHECKING:$']
[tool.coverage.covdefaults]
subtract_omit = "*/__main__.py"