From 5cf1749edb8550fd62681fd27c4a7122f49cb67b Mon Sep 17 00:00:00 2001 From: titaiwang Date: Thu, 20 Aug 2026 19:40:26 +0000 Subject: [PATCH 1/2] style: format component inspection tests Restore all-files Ruff formatting after #378 so main and dependent pull requests pass lint. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e10674c1-6909-4b09-9f5a-d41b28c89d2d --- src/mobius/_inspect_test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mobius/_inspect_test.py b/src/mobius/_inspect_test.py index a7f4dade..cbdc5e00 100644 --- a/src/mobius/_inspect_test.py +++ b/src/mobius/_inspect_test.py @@ -239,7 +239,8 @@ def test_explicit_task_without_config_returns_roles_without_source_paths(monkeyp staticmethod(lambda *a, **k: (_ for _ in ()).throw(OSError("no config"))), ) monkeypatch.setattr( - "mobius.integrations.transformers._config_resolver._try_load_config_json", lambda *_a, **_k: None + "mobius.integrations.transformers._config_resolver._try_load_config_json", + lambda *_a, **_k: None, ) components = inspect_components("anything", task="vision-language") @@ -280,7 +281,8 @@ def test_unresolvable_config_raises(monkeypatch): staticmethod(lambda *a, **k: (_ for _ in ()).throw(OSError("no config"))), ) monkeypatch.setattr( - "mobius.integrations.transformers._config_resolver._try_load_config_json", lambda *_a, **_k: None + "mobius.integrations.transformers._config_resolver._try_load_config_json", + lambda *_a, **_k: None, ) with pytest.raises(ValueError, match="Could not load a HuggingFace config"): inspect_components("fake/diffusers-pipeline") From f82dfc0748ed092b4a28f6ca0747a245e3d89c07 Mon Sep 17 00:00:00 2001 From: titaiwang Date: Thu, 20 Aug 2026 20:01:49 +0000 Subject: [PATCH 2/2] test: preserve asset fixture line endings Write the hashed chat-template fixture as exact UTF-8 bytes so Windows newline translation does not invalidate its expected SHA-256. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e10674c1-6909-4b09-9f5a-d41b28c89d2d --- src/mobius/upstream_patches/_patches_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mobius/upstream_patches/_patches_test.py b/src/mobius/upstream_patches/_patches_test.py index 7e6e60a9..65585f7a 100644 --- a/src/mobius/upstream_patches/_patches_test.py +++ b/src/mobius/upstream_patches/_patches_test.py @@ -65,7 +65,7 @@ def setUp(self): self.addCleanup(self._temp.cleanup) def _write_package(self, template: str = _ORIGINAL, *, tokenizer_config=True): - (self.package / "chat_template.jinja").write_text(template, encoding="utf-8") + (self.package / "chat_template.jinja").write_bytes(template.encode("utf-8")) if tokenizer_config: (self.package / "tokenizer_config.json").write_text( json.dumps({"chat_template": template, "model_max_length": 4096}),