-
Notifications
You must be signed in to change notification settings - Fork 4
/
pyproject.toml
198 lines (175 loc) · 5.09 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "typeshed_stats"
dynamic = ["version"]
authors = [
{ name="Alex Waygood", email="alex.waygood@gmail.com" },
]
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",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Software Development",
"Typing :: Typed",
]
dependencies = [
"attrs>=22.2.0",
"cattrs",
"aiohttp[speedups]",
"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"]
# Include the [rich] extra in the [docs] extra
# so the CLI docs generated from --help are consistent
docs = [
"typeshed-stats[rich]",
"MarkDown==3.3.7",
"mkdocs==1.4.3",
"mkdocs-macros-plugin==1.0.1",
"mkdocs-material==9.1.18",
"mkdocstrings[python]==0.22.0",
]
pytest = [
"typeshed-stats[rich]",
"beautifulsoup4>=4,<5",
"covdefaults==2.3.0",
"coverage==6.5.0",
"Markdown>=3,<4",
"pytest==7.4.0",
"pytest-antilru==1.1.1",
"pytest-asyncio==0.21.0",
"pytest-dependency==0.5.1",
"pytest-mock==3.11.1",
"pytest-subtests==0.11.0",
]
typecheck = [
"typeshed-stats[rich,docs,pytest]",
"mypy==1.4.1",
"types-beautifulsoup4==4.12.0.5",
"types-Markdown==3.4.2.9",
]
# All of these must match .pre-commit-config.yaml
#
# Note that not all of the dependencies in the pre-commit config file are listed here.
# That's deliberate (it's not necessary to run them all locally).
# This file just lists the ones which it's convenient to have around locally.
misc-lint = [
"black==23.3.0",
"blacken-docs==1.14.0",
"pre-commit-hooks==4.4.0",
"pycln==2.1.5",
"ruff==0.0.277",
]
dev = ["typeshed-stats[rich,docs,typecheck,pytest,misc-lint]"]
[tool.hatch.version]
path = "src/typeshed_stats/__init__.py"
[tool.pycln]
all = true
disable_all_dunder_policy = true
[tool.black]
line_length = 88
skip-magic-trailing-comma = true
[tool.ruff]
fix = true
select = ["E", "F", "B", "B9", "D", "SIM", "I", "PT", "UP", "PGH"]
ignore = [
# These are all enforced by, or incompatible with, Black:
"E203",
"E501",
"W291",
"W293",
# Stylistic lints with which I disagree:
"PT004",
"PT005",
# Let mypy/pyright complain about blanket type ignores
"PGH004",
# I know when to and when not to use `eval()`
"PGH001",
]
per-file-ignores = {"tests/*.py" = ["D"]}
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
[tool.ruff.isort]
combine-as-imports = true
known-first-party = ["typeshed_stats"]
[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"