From 287a16f41ce9a87832042e55c89d89a2119f3544 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Wed, 21 Oct 2026 09:57:44 +0200 Subject: [PATCH] fix: name --fetch when an original is not cached The export failed with 'absent and fetching is off'. It now names the cache directory it looked in and the flag that downloads the file. --- scripts/export_native.py | 4 +++- tests/test_exporters.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/export_native.py b/scripts/export_native.py index 1ccddb68..c5a2b09e 100644 --- a/scripts/export_native.py +++ b/scripts/export_native.py @@ -335,7 +335,9 @@ def collect_originals( elif path.exists(): payload = path.read_bytes() else: - missing.append(f"{relative}: absent and fetching is off") + missing.append( + f"{relative}: not in {root}; rerun with --fetch to download it" + ) continue if archive: originals.update(_read_archive(unpack, payload)) diff --git a/tests/test_exporters.py b/tests/test_exporters.py index 6504e890..cdaedfac 100644 --- a/tests/test_exporters.py +++ b/tests/test_exporters.py @@ -914,7 +914,9 @@ class CachedOriginal(unittest.TestCase): def test_offline_serves_what_is_cached_and_names_what_is_not(self): url = self._upstream("v1.txt", "one") _, missing = collect_originals(_OneFileExporter(url), {}, self.cache, False) - self.assertEqual(missing, ["list.txt: absent and fetching is off"]) + self.assertEqual(missing, [ + f"list.txt: not in {self.cache / 'plat'}; rerun with --fetch to download it" + ]) collect_originals(_OneFileExporter(url), {}, self.cache, True) originals, missing = collect_originals( _OneFileExporter("file:///nowhere/else.txt"), {}, self.cache, False