Skip to content

Commit cd77bc1

Browse files
[pre-commit.ci] pre-commit autoupdate (#1231)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.15.5 → v0.15.6](astral-sh/ruff-pre-commit@v0.15.5...v0.15.6) - [github.com/gitleaks/gitleaks: v8.30.0 → v8.30.1](gitleaks/gitleaks@v8.30.0...v8.30.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Debarati Basu-Nag <dbasunag@redhat.com>
1 parent 15b5606 commit cd77bc1

File tree

12 files changed

+14
-14
lines changed

12 files changed

+14
-14
lines changed

.github/workflows/scripts/pr_workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def verify_allowed_user(self) -> bool:
109109
# check if the user is a member of opendatahub-tests-contributors
110110
membership = team.get_team_membership(member=self.user_login)
111111
LOGGER.info(f"User {self.user_login} is a member of the test contributor team. {membership}")
112-
return True # noqa: TRY300
112+
return True
113113
except UnknownObjectException:
114114
LOGGER.error(f"User {self.user_login} is not allowed for this action. Exiting.")
115115
return False

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ repos:
3636
exclude: .*/__snapshots__/.*|.*-input\.json$|^semgrep\.yaml$
3737

3838
- repo: https://github.com/astral-sh/ruff-pre-commit
39-
rev: v0.15.5
39+
rev: v0.15.6
4040
hooks:
4141
- id: ruff
4242
- id: ruff-format
@@ -50,7 +50,7 @@ repos:
5050
# - id: renovate-config-validator
5151

5252
- repo: https://github.com/gitleaks/gitleaks
53-
rev: v8.30.0
53+
rev: v8.30.1
5454
hooks:
5555
- id: gitleaks
5656

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def registry_pull_secret(pytestconfig: Config) -> list[str]:
167167
try:
168168
for secret in registry_pull_secret:
169169
base64.b64decode(s=secret, validate=True)
170-
return registry_pull_secret # noqa: TRY300
170+
return registry_pull_secret
171171
except binascii.Error:
172172
raise ValueError("Registry pull secret is not a valid base64 encoded string")
173173

@@ -253,7 +253,7 @@ def modelcar_yaml_config(pytestconfig: pytest.Config) -> dict[str, Any] | None:
253253
modelcar_yaml = yaml.safe_load(file)
254254
if not isinstance(modelcar_yaml, dict):
255255
raise ValueError("modelcar.yaml should contain a dictionary.") # noqa: TRY004
256-
return modelcar_yaml # noqa: TRY300
256+
return modelcar_yaml
257257
except yaml.YAMLError as e:
258258
raise ValueError(f"Error parsing modelcar.yaml: {e}") from e
259259

tests/llama_stack/safety/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def guardrails_orchestrator_ssl_cert(guardrails_orchestrator_route: Route):
4848
with open(filepath, "w") as f:
4949
f.write("\n".join(cert_lines))
5050

51-
return filepath # noqa: TRY300
51+
return filepath
5252

5353
except Exception as e: # noqa: BLE001
5454
raise RuntimeError(f"Could not get certificate from {hostname}: {e}")

tests/llama_stack/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def wait_for_llama_stack_client_ready(client: LlamaStackClient) -> bool:
9898
f"vector_stores:{len(vector_stores.data)} "
9999
f"files:{len(files.data)})"
100100
)
101-
return True # noqa: TRY300
101+
return True
102102

103103
except (APIConnectionError, InternalServerError) as error:
104104
LOGGER.debug(f"Llama Stack server not ready yet: {error}")

tests/model_registry/model_catalog/huggingface/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def get_huggingface_nested_attributes(obj, attr_path) -> Any:
5757
if not hasattr(current_obj, attr):
5858
return None
5959
current_obj = getattr(current_obj, attr)
60-
return current_obj # noqa: TRY300
60+
return current_obj
6161
except AttributeError as e:
6262
LOGGER.error(f"AttributeError getting '{attr_path}': {e}")
6363
return None

tests/model_registry/model_catalog/metadata/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def get_metadata_from_catalog_pod(model_catalog_pod: Pod, model_name: str) -> di
294294
metadata_json = model_catalog_pod.execute(command=["cat", metadata_path], container=CATALOG_CONTAINER)
295295
metadata = json.loads(metadata_json)
296296
LOGGER.info(f"Successfully loaded metadata.json for model '{model_name}'")
297-
return metadata # noqa: TRY300
297+
return metadata
298298
except Exception as e:
299299
LOGGER.error(f"Failed to read metadata.json for model '{model_name}': {e}")
300300
raise

tests/model_registry/model_registry/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def sa_token(service_account: ServiceAccount) -> str:
135135
raise ValueError("Retrieved token is empty after successful command execution.")
136136

137137
LOGGER.info(f"Successfully retrieved token for SA '{sa_name}'")
138-
return token # noqa: TRY300
138+
return token
139139

140140
except Exception as e: # Catch all exceptions from the try block
141141
error_type = type(e).__name__

tests/model_serving/model_server/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def _is_kueue_operator_installed(admin_client: DynamicClient) -> bool:
436436
if csv.name.startswith("kueue") and csv.status == csv.Status.SUCCEEDED:
437437
LOGGER.info(f"Found Kueue operator CSV: {csv.name}")
438438
return True
439-
return False # noqa: TRY300
439+
return False
440440
except ResourceNotFoundError:
441441
return False
442442

utilities/infra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ def check_internal_image_registry_available(admin_client: DynamicClient) -> bool
11851185
is_available = management_state == "managed"
11861186

11871187
LOGGER.info(f"Image registry management state: {management_state}, available: {is_available}")
1188-
return is_available # noqa: TRY300
1188+
return is_available
11891189
except (ResourceNotFoundError, Exception) as e: # noqa: BLE001
11901190
LOGGER.warning(f"Failed to check image registry config: {e}")
11911191
return False

0 commit comments

Comments
 (0)