| """Backend package. | |
| The modules in here import each other flat (`from retriever import ...`) rather | |
| than relative, which is what the test suite and `--app-dir src` already assume. | |
| Adding this directory to `sys.path` on package import makes the documented and | |
| deployed entrypoint `uvicorn src.app:app` resolve those same names, so the app | |
| starts identically whether it is imported as `src.app` or as `app`. | |
| """ | |
| import sys | |
| from pathlib import Path | |
| _SRC_DIR = str(Path(__file__).resolve().parent) | |
| if _SRC_DIR not in sys.path: | |
| sys.path.insert(0, _SRC_DIR) | |