Skip to content

Commit bb820e5

Browse files
fix: resolve all CI failures (mypy, module imports, test mocks)
- Add mypy==1.18.1 to requirements-dev.txt for lint jobs - Expose main module in __init__.py for test mocking access - Update test mocks to accept timeout parameter in method signatures - Fix _FakeEmbeddings.create() and _FakeClientWrapper.__init__() signatures - Resolve 'mypy: command not found' and test mock TypeError issues This should resolve all CI job failures including lint, test, and security jobs.
1 parent 2bff006 commit bb820e5

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

requirements-dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ mdurl==0.1.2
6464
# via markdown-it-py
6565
msgpack==1.1.2
6666
# via cachecontrol
67+
mypy==1.18.1
68+
# via -r requirements-dev.in
6769
mypy-extensions==1.1.0
6870
# via black
6971
nodeenv==1.9.1

src/contextforge_memory/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
information.
66
"""
77

8+
from . import main # Add this import
89
from .vector_index.in_memory_index import InMemoryCosineIndex
910

10-
__all__ = ["InMemoryCosineIndex", "__version__"]
11+
__all__ = ["InMemoryCosineIndex", "main", "__version__"]
1112
__version__ = "0.0.1"

tests/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class _FakeEmbeddings:
4545
def __init__(self, raise_on_create: bool = False) -> None:
4646
self.raise_on_create = raise_on_create
4747

48-
def create(self, model: str, input: list[str]) -> Any:
48+
def create(self, model: str, input: list[str], timeout: float | None = None) -> Any:
4949
"""Create embeddings, optionally raising an error."""
5050
if self.raise_on_create:
5151
error_msg = "netfail"
@@ -134,7 +134,9 @@ def fake_openai_module(
134134
class _FakeClientWrapper:
135135
"""Fake OpenAI client wrapper with explicit interface."""
136136

137-
def __init__(self, api_key: str | None = None) -> None:
137+
def __init__(
138+
self, api_key: str | None = None, timeout: float | None = None
139+
) -> None:
138140
self._client = _FakeClient(api_key=api_key, raise_on_create=raise_on_create)
139141

140142
@property

tests/test_embeddings_validation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ def test_openai_embeddings_provider_lazy_dimension_discovery(
157157

158158
# Create a fake OpenAI module that returns different dimensions
159159
class _FakeEmbeddings:
160-
def create(self, model: str, input: list[str]) -> Any:
160+
def create(
161+
self, model: str, input: list[str], timeout: float | None = None
162+
) -> Any:
161163
# Track calls per model
162164
call_counts[model] = call_counts.get(model, 0) + 1
163165

0 commit comments

Comments
 (0)