diff --git a/build/common/verify/wheel.py b/build/common/verify/wheel.py index 03c0761..c08acf8 100644 --- a/build/common/verify/wheel.py +++ b/build/common/verify/wheel.py @@ -193,11 +193,11 @@ print(json.dumps({ # Default runtime-verification inputs. Overridable by CLI flags or environment. DEFAULT_RUNTIME_CONFIG = os.getenv("ORISYS_VERIFY_CONFIG", "box") -# Clips tracked in the repository, smallest first. +# Clips tracked in the repository. ``data/sample/s1.mp4`` is the sanctioned +# verification input; the larger 720p clip is deliberately not listed, so a +# missing s1.mp4 fails loudly instead of silently verifying against it. DEFAULT_VIDEO_CANDIDATES = ( Path("data") / "sample" / "s1.mp4", - Path("data") / "sample" / "s1_720p.mp4", - Path("tests") / "idle_1min.mp4", ) diff --git a/data/sample/s1.mp4 b/data/sample/s1.mp4 new file mode 100644 index 0000000..b155542 Binary files /dev/null and b/data/sample/s1.mp4 differ diff --git a/src/orisys/configs.py b/src/orisys/configs.py index 8f69cec..63a6bd7 100644 --- a/src/orisys/configs.py +++ b/src/orisys/configs.py @@ -1,4 +1,5 @@ import json +import os import shutil import sys from contextlib import ExitStack @@ -21,9 +22,17 @@ def _resource_path(*parts: str) -> Path | None: """Resolve a package resource to a filesystem path for wheel-safe loaders.""" try: resource = files("orisys").joinpath(*parts) - return _RESOURCE_STACK.enter_context(as_file(resource)) + resolved = _RESOURCE_STACK.enter_context(as_file(resource)) except Exception: return None + # ``as_file`` is not contractually a ``pathlib.Path``: a Nuitka-compiled + # build hands back its own ``nuitka_resource_reader_files``, which is + # path-like but has no ``.resolve()``. Normalise here so every caller can + # treat the result as a Path. + try: + return Path(os.fspath(resolved)) + except TypeError: + return None def _unique_paths(paths) -> list[Path]: @@ -31,9 +40,10 @@ def _unique_paths(paths) -> list[Path]: unique: list[Path] = [] seen: set[str] = set() for path in paths: + path = Path(path) if not isinstance(path, Path) else path try: key = str(path.resolve()).casefold() - except OSError: # pragma: no cover - defensive: unresolvable path + except (OSError, ValueError): # pragma: no cover - defensive key = str(path).casefold() if key in seen: continue diff --git a/tests/conftest.py b/tests/conftest.py index c9c03c8..5525c8c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -46,11 +46,12 @@ from orisys import Sensor from orisys import configs as orisys_configs from orisys.backend_availability import check_cupy_available, check_opencl_available -# Video clips that are tracked in git, in preference order. +# Video clips that are tracked in git, in preference order. The 720p clip is +# deliberately not a fallback: tests should run the sanctioned sample or skip, +# never silently verify against a different resolution. DEFAULT_VIDEO_CANDIDATES = ( Path("tests") / "idle_1min.mp4", Path("data") / "sample" / "s1.mp4", - Path("data") / "sample" / "s1_720p.mp4", )