From 75716ea697cc83e281a39f2e330922fa6b19f594 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 26 Jul 2026 21:39:52 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- studio/backend/routes/models.py | 1 - studio/backend/routes/training.py | 1 - studio/backend/tests/test_cached_gguf_routes.py | 4 +++- studio/backend/tests/test_video_gallery.py | 6 +++++- tests/studio/test_model_picker_contracts.py | 5 ++++- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/studio/backend/routes/models.py b/studio/backend/routes/models.py index 8f2c4b000c..235dd90950 100644 --- a/studio/backend/routes/models.py +++ b/studio/backend/routes/models.py @@ -3579,7 +3579,6 @@ def _cached_repo_task(repo_info) -> Optional[str]: # refuses its repo id, so tagging it text-to-image put a row in the Images picker that 400s. try: from core.inference.diffusion import _is_trusted_diffusion_repo - return "text-to-image" if _is_trusted_diffusion_repo(repo_id) else None except Exception: # noqa: BLE001 -- an import failure must not hide a usable repo return "text-to-image" diff --git a/studio/backend/routes/training.py b/studio/backend/routes/training.py index 6ef1e31d82..d8d1a28719 100644 --- a/studio/backend/routes/training.py +++ b/studio/backend/routes/training.py @@ -1188,7 +1188,6 @@ def diffusion_dataset_interlock(): TrainingActiveError, get_diffusion_training_service, ) - service = get_diffusion_training_service() except Exception: # noqa: BLE001 -- unknowable state never blocks a mutation yield diff --git a/studio/backend/tests/test_cached_gguf_routes.py b/studio/backend/tests/test_cached_gguf_routes.py index c9e8f0a228..4a589b8b71 100644 --- a/studio/backend/tests/test_cached_gguf_routes.py +++ b/studio/backend/tests/test_cached_gguf_routes.py @@ -1488,7 +1488,9 @@ def test_cached_repo_task_gates_an_image_pipeline_on_the_load_path_trust_rule(tm assert models_route._cached_repo_task(_pipeline_repo("unsloth/Qwen-Image", tmp_path)) == ( "text-to-image" ) - assert models_route._cached_repo_task(_pipeline_repo("someone/their-sdxl-mix", tmp_path)) is None + assert ( + models_route._cached_repo_task(_pipeline_repo("someone/their-sdxl-mix", tmp_path)) is None + ) def test_cached_repo_task_hides_an_untrusted_video_repo_instead_of_listing_it_under_images( diff --git a/studio/backend/tests/test_video_gallery.py b/studio/backend/tests/test_video_gallery.py index 0392be6cd3..aa2fe8b4b4 100644 --- a/studio/backend/tests/test_video_gallery.py +++ b/studio/backend/tests/test_video_gallery.py @@ -326,7 +326,11 @@ def test_save_leaves_no_orphan_mp4_when_sidecar_publish_fails(monkeypatch): assert gallery.list_videos() == [] -def _real_mp4_bytes(frames: int = 8, size: int = 32, rate: int = 8) -> bytes: +def _real_mp4_bytes( + frames: int = 8, + size: int = 32, + rate: int = 8, +) -> bytes: # A real (tiny) MP4 for the transcode tests: flat-color frames encoded with mpeg4 (bundled in # every PyAV build, unlike libx264). The GIF cap tests ask for more/larger frames. av = pytest.importorskip("av") diff --git a/tests/studio/test_model_picker_contracts.py b/tests/studio/test_model_picker_contracts.py index 1f71e14e39..ed2233ce21 100644 --- a/tests/studio/test_model_picker_contracts.py +++ b/tests/studio/test_model_picker_contracts.py @@ -622,7 +622,10 @@ def test_a_routed_curated_pick_uses_the_same_load_spec_as_a_direct_one(): repo that has no model_index.json. The catalog spec the page's own picker consults has to win.""" helper = _read("lib/diffusion-route-pick.ts") assert re.search(r"spec\?:\s*\{\s*kind:", helper), "the helper takes no catalog spec" - assert "if (spec) return { repoId: model, opts: { kind: spec.kind, filename: spec.filename } };" in helper + assert ( + "if (spec) return { repoId: model, opts: { kind: spec.kind, filename: spec.filename } };" + in helper + ) for rel, catalog in ( ("features/images/images-page.tsx", "IMAGE_CATALOG"), ("features/video/video-page.tsx", "VIDEO_CATALOG"),