Skip to content

Commit 63f80ad

Browse files
authored
Reduce pyright exclusions (#14111)
1 parent 202a53c commit 63f80ad

File tree

6 files changed

+14
-22
lines changed

6 files changed

+14
-22
lines changed

pyproject.toml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -302,56 +302,45 @@ include = [
302302
"tests",
303303
"utils",
304304
]
305+
exclude = [
306+
"tests/roots",
307+
]
305308

306309
reportArgumentType = "none"
307310
reportAssignmentType = "none"
308311
reportAttributeAccessIssue = "none"
309312
reportCallIssue = "none"
310313
reportConstantRedefinition = "none"
311-
reportDeprecated = "none"
312314
reportGeneralTypeIssues = "none"
313315
reportIncompatibleMethodOverride = "none"
314316
reportIncompatibleVariableOverride = "none"
315-
reportInconsistentOverload = "none"
316317
reportIndexIssue = "none"
317-
reportInvalidTypeArguments = "none"
318318
reportInvalidTypeForm = "none"
319-
reportInvalidTypeVarUse = "none"
320319
reportMissingImports = "none"
321320
reportMissingModuleSource = "none"
322321
reportMissingParameterType = "none"
323322
reportMissingTypeArgument = "none"
324323
reportMissingTypeStubs = "none"
325324
reportOperatorIssue = "none"
326-
reportOptionalIterable = "none"
327325
reportOptionalMemberAccess = "none"
328-
reportOptionalOperand = "none"
329326
reportOptionalSubscript = "none"
330327
reportPossiblyUnboundVariable = "none"
331328
reportPrivateUsage = "none"
332329
reportRedeclaration = "none"
333330
reportReturnType = "none"
334-
reportSelfClsParameterName = "none"
335-
reportTypeCommentUsage = "none"
336-
reportTypedDictNotRequiredAccess = "none"
337-
reportUndefinedVariable = "none"
338331
reportUnknownArgumentType = "none"
339332
reportUnknownLambdaType = "none"
340333
reportUnknownMemberType = "none"
341334
reportUnknownParameterType = "none"
342335
reportUnknownVariableType = "none"
343336
reportUnnecessaryComparison = "none"
344-
reportUnnecessaryContains = "none"
345337
reportUnnecessaryIsInstance = "none"
346-
reportUnsupportedDunderAll = "none"
347338
reportUntypedBaseClass = "none"
348-
reportUntypedFunctionDecorator = "none"
349339
reportUntypedNamedTuple = "none"
350340
reportUnusedClass = "none"
351341
reportUnusedFunction = "none"
352342
reportUnusedImport = "none"
353343
reportUnusedVariable = "none"
354-
reportWildcardImportFromLibrary = "none"
355344

356345
[tool.uv]
357346
default-groups = "all"

sphinx/domains/cpp/_ast.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4459,6 +4459,7 @@ def describe_signature(
44594459
lineSpec: bool,
44604460
) -> None:
44614461
verify_description_mode(mode)
4462+
assert self.templates is not None
44624463
for t in self.templates:
44634464
t.describe_signature_as_introducer(
44644465
signode, 'lastIsName', env, symbol, lineSpec

sphinx/util/inspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ def _evaluate_forwardref(
817817
# before 3.12.4 still has the old signature).
818818
#
819819
# See: https://github.com/python/cpython/pull/118104.
820-
return ref._evaluate(
820+
return ref._evaluate( # pyright: ignore[reportDeprecated]
821821
globalns, localns, type_params=(), recursive_guard=frozenset()
822822
) # type: ignore[call-arg]
823823
return ref._evaluate(globalns, localns, recursive_guard=frozenset())

sphinx/writers/texinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ def depart_decoration(self, node: Element) -> None:
11731173

11741174
def visit_topic(self, node: Element) -> None:
11751175
# ignore TOC's since we have to have a "menu" anyway
1176-
if 'contents' in node.get('classes', ()):
1176+
if (classes := node.get('classes', ())) and 'contents' in classes:
11771177
raise nodes.SkipNode
11781178
title = cast('nodes.title', node[0])
11791179
self.visit_rubric(title)

tests/test_config/test_config.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def test_is_serializable() -> None:
5252
subject = [1, [2, {3, 'a'}], {'x': {'y': frozenset((4, 5))}}]
5353
check_is_serializable(subject, circular=False)
5454

55-
a, b = [1], [2] # type: (CircularList, CircularList)
55+
a: CircularList = [1]
56+
b: CircularList = [2]
5657
a.append(b)
5758
b.append(a)
5859
check_is_serializable(a, circular=True)
@@ -139,7 +140,8 @@ def test_config_pickle_protocol(protocol: int) -> None:
139140

140141

141142
def test_config_pickle_circular_reference_in_list():
142-
a, b = [1], [2] # type: (CircularList, CircularList)
143+
a: CircularList = [1]
144+
b: CircularList = [2]
143145
a.append(b)
144146
b.append(a)
145147

@@ -184,9 +186,9 @@ def check(
184186
u: list[list[object] | int],
185187
v: list[list[object] | int],
186188
*,
187-
counter: Counter[type, int] | None = None,
189+
counter: Counter[type] | None = None,
188190
guard: frozenset[int] = frozenset(),
189-
) -> Counter[type, int]:
191+
) -> Counter[type]:
190192
counter = Counter() if counter is None else counter
191193

192194
if id(u) in guard and id(v) in guard:
@@ -248,7 +250,7 @@ def check(
248250
u: dict[str, dict[str, object] | int],
249251
v: dict[str, dict[str, object] | int],
250252
*,
251-
counter: Counter[type, int] | None = None,
253+
counter: Counter[type] | None = None,
252254
guard: frozenset[int] = frozenset(),
253255
) -> Counter:
254256
counter = Counter() if counter is None else counter

tests/test_util/typing_test_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def f1(x: list[int]) -> List[int]:
1616
T_contra = TypeVar('T_contra', contravariant=True)
1717

1818

19-
def f2(x: List[T], y: List[T_co], z: T) -> List[T_contra]:
19+
def f2(x: List[T], y: List[T_co], z: T) -> List[T_contra]: # pyright: ignore[reportInvalidTypeVarUse]
2020
pass
2121

2222

0 commit comments

Comments
 (0)