File size: 559 Bytes
d80690d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""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)