fix(parsing): add root conftest.py so pytest resolves codex package
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
17
conftest.py
Normal file
17
conftest.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
"""Root conftest — ensures the project root is on sys.path.
|
||||||
|
|
||||||
|
Required when the virtual-environment Python is symlinked to an external
|
||||||
|
interpreter (e.g. Anaconda) that does not process the venv's .pth files
|
||||||
|
automatically. Adding the project root here makes ``codex`` importable
|
||||||
|
regardless of how pytest is invoked (``pytest``, ``python -m pytest``, etc.).
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
# Insert the project root so `import codex` always resolves.
|
||||||
|
_project_root = str(Path(__file__).parent)
|
||||||
|
if _project_root not in sys.path:
|
||||||
|
sys.path.insert(0, _project_root)
|
||||||
Reference in New Issue
Block a user