From 00c5cf5c9ae8e0f89833c33bca78c3922360bfd6 Mon Sep 17 00:00:00 2001 From: Valentina Date: Tue, 28 Jul 2026 11:45:29 +0200 Subject: [PATCH 1/2] fix: content negotiation 4 static build --- pyproject.toml | 2 +- tests/test_static_builder.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fa6b232..82e6fa3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lode" -version = "0.3.8" +version = "0.3.9" description = "New reengineered version of LODE, maintained by OpenCitations" authors = [{name = "Valentina Pasqual, Silvio Peroni", email = "valentina.pasqual2@unibo.it"}] readme = "README.md" diff --git a/tests/test_static_builder.py b/tests/test_static_builder.py index 3538af5..da900b6 100644 --- a/tests/test_static_builder.py +++ b/tests/test_static_builder.py @@ -21,6 +21,10 @@ ONTOLOGIES_PATH = Path(__file__).parent / "ontologies_spar.json" URIS = [e["uri"] for e in json.loads(ONTOLOGIES_PATH.read_text(encoding="utf-8"))["uris"]] +from lode.viewer.base_viewer import SERIALIZATION_FORMATS + +_EXTS = [f["ext"] for f in SERIALIZATION_FORMATS] + def _load(uri): r = Reader() @@ -46,7 +50,7 @@ def built(request, tmp_path_factory): def test_index_and_ontology_serializations(built): out = built["out"] assert (out / "index.html").exists() - for ext in ("ttl", "rdf", "n3"): + for ext in _EXTS: assert (out / f"ontology.{ext}").exists(), f"missing ontology.{ext}" @@ -66,14 +70,12 @@ def test_every_html_resource_has_all_formats(built): res = built["out"] / "resources" html_files = list(res.rglob("*.html")) assert html_files, f"no resource pages generated for {built['uri']}" - missing = [] for html in html_files: - for ext in ("ttl", "rdf", "n3"): + for ext in _EXTS: sibling = html.with_suffix(f".{ext}") if not sibling.exists(): missing.append(str(sibling.relative_to(built["out"]))) - assert not missing, "missing serializations:\n" + "\n".join(missing) From a1809379e76751520fde06eace064997d002a2f3 Mon Sep 17 00:00:00 2001 From: Valentina Date: Tue, 28 Jul 2026 11:56:14 +0200 Subject: [PATCH 2/2] update uv lock to match version --- uv.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uv.lock b/uv.lock index 8f33e46..ac687cb 100644 --- a/uv.lock +++ b/uv.lock @@ -446,7 +446,7 @@ wheels = [ [[package]] name = "lode" -version = "0.3.8" +version = "0.3.9" source = { editable = "." } dependencies = [ { name = "fastapi" },