Skip to content

Commit

Permalink
Fix checks
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Feb 22, 2025
1 parent aebd0e5 commit 44e3a1d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions acceptance_tests/acceptance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_home() -> None:
width=900,
height=1900,
result_folder="/results",
expected_filename=Path(__file__).parent / "home.expected.png",
expected_filename=str(Path(__file__).parent / "home.expected.png"),
sleep=500,
)

Expand All @@ -81,7 +81,7 @@ def test_project() -> None:
width=1000,
height=900,
result_folder="/results",
expected_filename=Path(__file__).parent / "project.expected.png",
expected_filename=str(Path(__file__).parent / "project.expected.png"),
sleep=500,
)

Expand All @@ -96,7 +96,7 @@ def test_welcome() -> None:
width=900,
height=500,
result_folder="/results",
expected_filename=Path(__file__).parent / "welcome.expected.png",
expected_filename=str(Path(__file__).parent / "welcome.expected.png"),
sleep=500,
)

Expand All @@ -111,7 +111,7 @@ def test_transversal_dashboard() -> None:
width=900,
height=200,
result_folder="/results",
expected_filename=Path(__file__).parent / "dashboard.expected.png",
expected_filename=str(Path(__file__).parent / "dashboard.expected.png"),
sleep=500,
)

Expand All @@ -130,7 +130,7 @@ def test_logs(log_type: str) -> None:
width=900,
height=900,
result_folder="/results",
expected_filename=Path(__file__).parent / f"logs-{log_type}.expected.png",
expected_filename=str(Path(__file__).parent / f"logs-{log_type}.expected.png"),
sleep=500,
)

Expand All @@ -149,6 +149,6 @@ def test_output(output_type: str) -> None:
width=900,
height=200,
result_folder="/results",
expected_filename=Path(__file__).parent / f"output-{output_type}.expected.png",
expected_filename=str(Path(__file__).parent / f"output-{output_type}.expected.png"),
sleep=500,
)
8 changes: 4 additions & 4 deletions github_app_geo_project/module/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def cleanup(self, context: CleanupContext[_EVENT_DATA]) -> None:
@abstractmethod
async def get_json_schema(self) -> dict[str, Any]:
"""Get the JSON schema of the module configuration."""
super_ = next([c for c in self.__class__.__orig_bases__ if c.__origin__ == Module]) # type: ignore[attr-defined] # pylint: disable=no-member
super_ = [c for c in self.__class__.__orig_bases__ if c.__origin__ == Module][0] # type: ignore[attr-defined] # pylint: disable=no-member
generic_element = super_.__args__[0]
# Is Pydantic BaseModel
if not isinstance(generic_element, GenericAlias) and issubclass(generic_element, BaseModel):
Expand All @@ -374,7 +374,7 @@ async def get_json_schema(self) -> dict[str, Any]:

def configuration_from_json(self, data: dict[str, Any]) -> _CONFIGURATION:
"""Create the configuration from the JSON data."""
super_ = next([c for c in self.__class__.__orig_bases__ if c.__origin__ == Module]) # type: ignore[attr-defined] # pylint: disable=no-member
super_ = [c for c in self.__class__.__orig_bases__ if c.__origin__ == Module][0] # type: ignore[attr-defined] # pylint: disable=no-member
generic_element = super_.__args__[0]
# Is Pydantic BaseModel
if not isinstance(generic_element, GenericAlias) and issubclass(generic_element, BaseModel):
Expand All @@ -388,7 +388,7 @@ def configuration_from_json(self, data: dict[str, Any]) -> _CONFIGURATION:

def event_data_from_json(self, data: dict[str, Any]) -> _EVENT_DATA:
"""Create the module event data from the JSON data."""
super_ = next([c for c in self.__class__.__orig_bases__ if c.__origin__ == Module]) # type: ignore[attr-defined] # pylint: disable=no-member
super_ = [c for c in self.__class__.__orig_bases__ if c.__origin__ == Module][0] # type: ignore[attr-defined] # pylint: disable=no-member
generic_element = super_.__args__[1]
# Is Pydantic BaseModel
if (not isinstance(generic_element, GenericAlias)) and issubclass(generic_element, BaseModel):
Expand All @@ -410,7 +410,7 @@ def event_data_to_json(self, data: _EVENT_DATA) -> dict[str, Any]:
def transversal_status_from_json(self, data: dict[str, Any] | None) -> _TRANSVERSAL_STATUS:
"""Create the transversal status from the JSON data."""
data = data or {}
super_ = next([c for c in self.__class__.__orig_bases__ if c.__origin__ == Module]) # type: ignore[attr-defined] # pylint: disable=no-member
super_ = [c for c in self.__class__.__orig_bases__ if c.__origin__ == Module][0] # type: ignore[attr-defined] # pylint: disable=no-member
generic_element = super_.__args__[2]
# Is Pydantic BaseModel
if not isinstance(generic_element, GenericAlias) and issubclass(generic_element, BaseModel):
Expand Down
4 changes: 2 additions & 2 deletions github_app_geo_project/module/audit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ async def _process_snyk_dpkg(
local_config: configuration.AuditConfiguration = {}

ghci_config_path = Path(".github/ghci.yaml")
if context.module_event_data.type in ("snyk", "dpkg") and ghci_config_path.exists:
if context.module_event_data.type in ("snyk", "dpkg") and ghci_config_path.exists():
with ghci_config_path.open(encoding="utf-8") as file:
local_config = yaml.load(file, Loader=yaml.SafeLoader).get("audit", {})

Expand Down Expand Up @@ -345,7 +345,7 @@ async def _use_python_version(python_version: str) -> dict[str, str]:

# Get path from /pyenv/versions/{python_version}.*/bin/
env = os.environ.copy()
bin_paths = Path("/pyenv/versions/").glob(f"{python_version}.*/bin")
bin_paths = list(Path("/pyenv/versions/").glob(f"{python_version}.*/bin"))
if bin_paths:
env["PATH"] = f'{bin_paths[0]}:{env["PATH"]}'

Expand Down
2 changes: 1 addition & 1 deletion github_app_geo_project/module/versions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ def _build_internal_dependencies(
dependency_minor = _canonical_minor_version(datasource_name, dependency_version)
if datasource_name == "docker":
assert len(dependency_package_data.status_by_version) == 1
support = next(dependency_package_data.status_by_version.values())
support = list(dependency_package_data.status_by_version.values())[0]
else:
support = dependency_package_data.status_by_version.get(
dependency_minor,
Expand Down

0 comments on commit 44e3a1d

Please sign in to comment.