From 291a66dd38659fec4d358d56db2d44560663d8a6 Mon Sep 17 00:00:00 2001 From: Tarik Moussa Date: Thu, 4 Jun 2026 23:34:34 +0200 Subject: [PATCH] fix(parsing): add root conftest.py so pytest resolves codex package Co-Authored-By: Claude Sonnet 4.6 --- conftest.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 conftest.py diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..97da40f --- /dev/null +++ b/conftest.py @@ -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)