"""pytest configuration — ensure ``scripts/`` is importable via package syntax. The ``scripts`` directory is a PEP 420 implicit namespace package (no ``__init__.py``). Because ``uv run pytest`` does **not** add the project root to ``sys.path``, ``from scripts.sweep_cam_perf import ...`` would otherwise fail with ``ModuleNotFoundError``. This conftest inserts the repository root at the front of ``sys.path`` so that ``scripts`` is discoverable as a top-level package. """ from __future__ import annotations import sys from pathlib import Path _repo_root = Path(__file__).resolve().parent.parent _repo_root_str = str(_repo_root) if _repo_root_str not in sys.path: sys.path.insert(0, _repo_root_str)