From 90cbc5433f2398919e2ef27a7c82deebf2ae0dfa Mon Sep 17 00:00:00 2001 From: Anatolii Date: Thu, 18 Jun 2026 13:43:44 +0400 Subject: [PATCH 1/2] fix(ci): add Callable to typing imports in runtime.py Runtime.py uses Callable[[Exception], dict[str, Any]] in the NullRunRuntime.execute signature (line 1392) but the typing import only had Any, Optional. Under Python 3.11 (CI matrix) the class body evaluates annotations eagerly, so the missing import raises NameError at *collection* time and every test errors with 'ERROR collecting tests/test_*.py - NameError: name Callable is not defined' before pytest can even run a single test. Python 3.14 happens to defer annotation evaluation so the same code passes locally; that masked the bug during development and during the previous local pytest run (443/443 passed). The bug is purely a missing import - adding Callable to the existing 'from typing import Any, Optional' line fixes all 19 collection errors and lets the test matrix reach the actual test cases. This is a pre-existing bug, not caused by the byte-mismatch or S-2 fixes; it survived the initial import commit (316a694) and the wip/working-tree migration (1244901) because no one ran the 3.11 matrix on a workstation with the right tooling. The fix is mechanical: one identifier added to one import line. --- src/nullrun/runtime.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nullrun/runtime.py b/src/nullrun/runtime.py index b611f68..5899812 100644 --- a/src/nullrun/runtime.py +++ b/src/nullrun/runtime.py @@ -40,7 +40,7 @@ import uuid from collections import defaultdict, deque from dataclasses import dataclass, field -from typing import Any, Optional +from typing import Any, Callable, Optional import httpx From ea55cd8bfc294cf84ac2445e0b26273327870e1d Mon Sep 17 00:00:00 2001 From: Anatolii Date: Thu, 18 Jun 2026 13:55:47 +0400 Subject: [PATCH 2/2] fix(ci): add pythonpath=["."] to pytest config test_track_span_context.py uses 'from tests.conftest import BASE_URL' which requires the tests/ directory to be importable as a top-level package. On Python 3.10/3.11 (CI matrix) pytest's rootdir discovery lands on the repo root rather than the tests/ directory, so 'tests' is not on sys.path and the import raises ModuleNotFoundError at collection time, failing one test: FAILED tests/test_track_span_context.py::test_module_level_track_llm_output_tokens_optional ModuleNotFoundError: No module named 'tests' On Python 3.14 the same code passes because pytest-asyncio / hatchling pyproject discovery adds the repo root to sys.path. 3.10/3.11 don't get that for free. Add 'pythonpath = ["."]' to [tool.pytest.ini_options] so all Python versions in the supported matrix resolve 'tests' as a top-level module. --- pyproject.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index f0f0e83..2a4d96d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -146,6 +146,12 @@ ignore = [ asyncio_mode = "auto" testpaths = ["tests"] addopts = "--tb=short -q" +# Make the tests/ directory importable as a top-level package so +# tests can use `from tests.conftest import BASE_URL`. Without this, +# `from tests.conftest` raises ModuleNotFoundError on Python 3.10/3.11 +# because pytest's rootdir discovery lands on the repo root rather +# than the tests/ directory. +pythonpath = ["."] [tool.coverage.run] source = ["src/nullrun"]