Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion infrahub_sdk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def logger(self) -> InfrahubLoggers:
# When using structlog the logger doesn't expose the expected methods by looking at the
# object to pydantic rejects them. This is a workaround to allow structlog to be used
# as a logger
return self.log # type: ignore
return self.log # type: ignore[return-value]

@model_validator(mode="before")
@classmethod
Expand Down
4 changes: 2 additions & 2 deletions infrahub_sdk/query_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ async def update_group(self) -> None:
return

# Calculate how many nodes should be deleted
self.unused_member_ids = set(existing_group.members.peer_ids) - set(members) # type: ignore
self.unused_member_ids = list(set(existing_group.members.peer_ids) - set(members)) # type: ignore[union-attr]

if not self.delete_unused_nodes:
return
Expand Down Expand Up @@ -262,7 +262,7 @@ def update_group(self) -> None:
return

# Calculate how many nodes should be deleted
self.unused_member_ids = set(existing_group.members.peer_ids) - set(members) # type: ignore
self.unused_member_ids = list(set(existing_group.members.peer_ids) - set(members)) # type: ignore[union-attr]

if not self.delete_unused_nodes:
return
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ ignore = [
# Rules below needs to be Investigated #
##################################################################################################
"PT", # flake8-pytest-style
"PGH", # pygrep-hooks
"ERA", # eradicate commented-out code
"SLF001", # flake8-self
"EM", # flake8-errmsg
Expand Down
4 changes: 2 additions & 2 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
from rich import inspect as rinspect
from rich import print as rprint

builtins.rprint = rprint # type: ignore
builtins.rinspect = rinspect # type: ignore
builtins.rprint = rprint # type: ignore[attr-defined]
builtins.rinspect = rinspect # type: ignore[attr-defined]
2 changes: 1 addition & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
# },
# ],
# }
# return NodeSchema(**data) # type: ignore
# return NodeSchema(**data)


# @pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from rich import print as rprint

builtins.rprint = rprint # type: ignore
builtins.rprint = rprint # type: ignore[attr-defined]
26 changes: 13 additions & 13 deletions tests/unit/sdk/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async def location_schema() -> NodeSchemaAPI:
},
],
}
return NodeSchema(**data).convert_api() # type: ignore
return NodeSchema(**data).convert_api()


@pytest.fixture
Expand Down Expand Up @@ -216,7 +216,7 @@ async def location_schema_with_dropdown() -> NodeSchemaAPI:
},
],
}
return NodeSchema(**data).convert_api() # type: ignore
return NodeSchema(**data).convert_api()


@pytest.fixture
Expand Down Expand Up @@ -281,7 +281,7 @@ async def schema_with_hfid() -> dict[str, NodeSchemaAPI]:
],
},
}
return {k: NodeSchema(**v).convert_api() for k, v in data.items()} # type: ignore
return {k: NodeSchema(**v).convert_api() for k, v in data.items()}


@pytest.fixture
Expand All @@ -295,7 +295,7 @@ async def std_group_schema() -> NodeSchemaAPI:
{"name": "description", "kind": "String", "optional": True},
],
}
return NodeSchema(**data).convert_api() # type: ignore
return NodeSchema(**data).convert_api()


@pytest.fixture
Expand Down Expand Up @@ -679,7 +679,7 @@ async def tag_schema() -> NodeSchemaAPI:
{"name": "description", "kind": "Text", "optional": True},
],
}
return NodeSchema(**data).convert_api() # type: ignore
return NodeSchema(**data).convert_api()


@pytest.fixture
Expand Down Expand Up @@ -917,7 +917,7 @@ async def ipaddress_schema() -> NodeSchemaAPI:
}
],
}
return NodeSchema(**data).convert_api() # type: ignore
return NodeSchema(**data).convert_api()


@pytest.fixture
Expand All @@ -941,7 +941,7 @@ async def ipnetwork_schema() -> NodeSchemaAPI:
}
],
}
return NodeSchema(**data).convert_api() # type: ignore
return NodeSchema(**data).convert_api()


@pytest.fixture
Expand All @@ -954,7 +954,7 @@ async def ipam_ipprefix_schema() -> NodeSchemaAPI:
"order_by": ["prefix_value"],
"inherit_from": ["BuiltinIPAddress"],
}
return NodeSchema(**data).convert_api() # type: ignore
return NodeSchema(**data).convert_api()


@pytest.fixture
Expand Down Expand Up @@ -986,7 +986,7 @@ async def simple_device_schema() -> NodeSchemaAPI:
},
],
}
return NodeSchema(**data).convert_api() # type: ignore
return NodeSchema(**data).convert_api()


@pytest.fixture
Expand Down Expand Up @@ -1106,7 +1106,7 @@ async def ipaddress_pool_schema() -> NodeSchemaAPI:
},
],
}
return NodeSchema(**data).convert_api() # type: ignore
return NodeSchema(**data).convert_api()


@pytest.fixture
Expand Down Expand Up @@ -1165,7 +1165,7 @@ async def ipprefix_pool_schema() -> NodeSchemaAPI:
},
],
}
return NodeSchema(**data).convert_api() # type: ignore
return NodeSchema(**data).convert_api()


@pytest.fixture
Expand Down Expand Up @@ -1274,7 +1274,7 @@ async def device_schema() -> NodeSchemaAPI:
{"name": "artifacts", "peer": "CoreArtifact", "optional": True, "cardinality": "many", "kind": "Generic"},
],
}
return NodeSchema(**data).convert_api() # type: ignore
return NodeSchema(**data).convert_api()


@pytest.fixture
Expand Down Expand Up @@ -1448,7 +1448,7 @@ async def artifact_definition_schema() -> NodeSchemaAPI:
{"name": "artifact_name", "kind": "Text"},
],
}
return NodeSchema(**data).convert_api() # type: ignore
return NodeSchema(**data).convert_api()


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/sdk/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ async def test_render_string_errors(test_case: JinjaTestCaseFailing) -> None:
name="top-level template code",
),
syntax=Syntax(
code="<html>\n<body>\n<ul>\n{% for server in servers %}\n <li>{{server.name}}: {{ server.ip.primary }}</li>\n{% endfor %}\n</ul>\n\n</body>\n\n</html>\n", # noqa E501
code="<html>\n<body>\n<ul>\n{% for server in servers %}\n <li>{{server.name}}: {{ server.ip.primary }}</li>\n{% endfor %}\n</ul>\n\n</body>\n\n</html>\n", # noqa: E501
lexer="",
),
)
Expand Down