"""Put the studio and shared source trees on ``sys.path`` for the scene tools. These tools are run as scripts out of this directory, but the tests load them by file location (``spec_from_file_location`` + ``exec_module``), which leaves this directory off ``sys.path``. Each tool therefore adds it before importing here. """ from __future__ import annotations import sys from pathlib import Path def bootstrap_paths() -> None: """Make ``orisys_studio`` and ``orisys_app_shared`` importable from the repo.""" here = Path(__file__).resolve() repo = here.parents[2] for path in (repo / "apps" / "studio" / "src", repo / "shared" / "src"): if path.is_dir() and str(path) not in sys.path: sys.path.insert(0, str(path))