Skip to content

Commit d921135

Browse files
committed
Merge branch 'main' into fix/expression-parentheses
2 parents 86d7ef5 + 0a05186 commit d921135

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/_griffe/agents/nodes/exports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def _extract_binop(node: ast.BinOp, parent: Module) -> list[str | ExprName]:
4141

4242

4343
def _extract_constant(node: ast.Constant, parent: Module) -> list[str | ExprName]:
44-
return [node.value]
44+
return [node.value] # type: ignore[list-item]
4545

4646

4747
def _extract_name(node: ast.Name, parent: Module) -> list[str | ExprName]:

src/_griffe/expressions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ def _build_constant(
11481148
)
11491149
else:
11501150
return _build(parsed.body, parent, **kwargs) # type: ignore[attr-defined]
1151-
return {type(...): lambda _: "..."}.get(type(node.value), repr)(node.value)
1151+
return {type(...): lambda _: "..."}.get(type(node.value), repr)(node.value) # type: ignore[arg-type]
11521152

11531153

11541154
def _build_dict(node: ast.Dict, parent: Module | Class, **kwargs: Any) -> Expr:

src/_griffe/finder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def _handle_editable_module(path: Path) -> list[_SP]:
496496
else:
497497
continue
498498
if isinstance(target, ast.Name) and target.id == "MAPPING" and isinstance(node.value, ast.Dict):
499-
return [_SP(Path(cst.value).parent) for cst in node.value.values if isinstance(cst, ast.Constant)]
499+
return [_SP(Path(cst.value).parent) for cst in node.value.values if isinstance(cst, ast.Constant)] # type: ignore[arg-type]
500500
if _match_pattern(path.name, _editable_meson_python_patterns):
501501
# Support for how 'meson-python' writes these files:
502502
# example line: `install({'package', 'module1'}, '/media/data/dev/griffe/build/cp311', ["path"], False)`.
@@ -510,7 +510,7 @@ def _handle_editable_module(path: Path) -> list[_SP]:
510510
and node.value.func.id == "install"
511511
and isinstance(node.value.args[1], ast.Constant)
512512
):
513-
build_path = Path(node.value.args[1].value, "src")
513+
build_path = Path(node.value.args[1].value, "src") # type: ignore[arg-type]
514514
# NOTE: What if there are multiple packages?
515515
pkg_name = next(build_path.iterdir()).name
516516
return [_SP(build_path, always_scan_for=pkg_name)]

0 commit comments

Comments
 (0)