Skip to content

Commit 422d133

Browse files
committed
ruff check fixes
1 parent bd0efe8 commit 422d133

File tree

6 files changed

+16
-12
lines changed

6 files changed

+16
-12
lines changed

scripts/spdx_checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
import re
88
import sys
9+
from typing import Annotated
910

1011
import typer
1112
from spdx_tools.spdx.model import Document
1213
from spdx_tools.spdx.parser.tagvalue.parser import Parser
13-
from typing_extensions import Annotated
1414

1515

1616
def run_spdx_checks(input_file: Annotated[typer.FileText, typer.Argument()] = sys.stdin):

tests/integration/fixtures/cluster.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
import asyncio
66
import os
7+
from collections.abc import AsyncGenerator
78
from pathlib import Path
8-
from typing import Any, AsyncGenerator
9+
from typing import Any
910

1011
import pyhelm3
1112
import pytest

tests/manifests/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
44

55
import copy
6-
from typing import Any, Dict
6+
from typing import Any
77

88
_raw_shared_components_details = {
99
"initSecrets": {"hyphened_name": "init-secrets", "has_service_monitor": False, "has_ingress": False},
@@ -35,7 +35,7 @@
3535
}
3636

3737

38-
def _enrich_components_to_test(details) -> Dict[str, Any]:
38+
def _enrich_components_to_test(details) -> dict[str, Any]:
3939
_component_details = copy.deepcopy(details)
4040
for component in details:
4141
_component_details[component].setdefault("hyphened_name", component)

tests/manifests/test_ingresses.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,5 +240,6 @@ async def test_ingress_services(templates):
240240
else:
241241
port_numbers = [port["port"] for port in found_service["spec"]["ports"]]
242242
assert backend_service["port"]["number"] in port_numbers, (
243-
f"Port number {backend_service['port']['number']} not found in service {backend_service['name']}"
243+
f"Port number {backend_service['port']['number']} "
244+
f"not found in service {backend_service['name']}"
244245
)

tests/manifests/test_service_monitors.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,27 @@
22
#
33
# SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
44

5-
from typing import Any, Dict, Iterator
5+
from collections.abc import Iterator
6+
from typing import Any
67

78
import pytest
89

910
from . import component_details, shared_components_details, values_files_to_test
1011

1112

12-
def selector_match(labels: Dict[str, str], selector: Dict[str, str]) -> bool:
13+
def selector_match(labels: dict[str, str], selector: dict[str, str]) -> bool:
1314
return all(labels[key] == value for key, value in selector.items())
1415

1516

16-
def find_services_matching_selector(templates: Iterator[Any], selector: Dict[str, str]) -> list[Any]:
17+
def find_services_matching_selector(templates: Iterator[Any], selector: dict[str, str]) -> list[Any]:
1718
services = []
1819
for template in templates:
1920
if template["kind"] == "Service" and selector_match(template["metadata"]["labels"], selector):
2021
services.append(template)
2122
return services
2223

2324

24-
def find_workload_ids_matching_selector(templates: Iterator[Any], selector: Dict[str, str]) -> list[str]:
25+
def find_workload_ids_matching_selector(templates: Iterator[Any], selector: dict[str, str]) -> list[str]:
2526
workload_ids = []
2627
for template in templates:
2728
if template["kind"] in ("Deployment", "StatefulSet", "Job") and selector_match(

tests/manifests/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
# SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
44

55
import json
6+
from collections.abc import Iterator
67
from pathlib import Path
7-
from typing import Any, Dict, Iterator
8+
from typing import Any
89

910
import pyhelm3
1011
import pytest
@@ -29,12 +30,12 @@ def component(values_file):
2930

3031

3132
@pytest.fixture(scope="function")
32-
def values(values_file) -> Dict[str, Any]:
33+
def values(values_file) -> dict[str, Any]:
3334
return yaml.safe_load((Path("charts/matrix-stack/ci") / values_file).read_text("utf-8"))
3435

3536

3637
@pytest.fixture(scope="function")
37-
async def templates(chart: pyhelm3.Chart, values: Dict[str, Any]):
38+
async def templates(chart: pyhelm3.Chart, values: dict[str, Any]):
3839
return list([template for template in await helm_template(chart, "pytest", values) if template is not None])
3940

4041

0 commit comments

Comments
 (0)