Exclude TUI apps from coverage
This commit is contained in:
parent
11534bf686
commit
5dd8a82d1f
14 changed files with 20 additions and 16 deletions
|
|
@ -18,7 +18,7 @@ def run_chat(
|
|||
"""
|
||||
try:
|
||||
from haiku.rag.chat.app import ChatApp
|
||||
except ImportError as e: # pragma: no cover
|
||||
except ImportError as e:
|
||||
raise ImportError(
|
||||
"textual is not installed. Please install it with `pip install 'haiku.rag-slim[tui]'` or use the full haiku.rag package."
|
||||
) from e
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ try:
|
|||
|
||||
logfire.configure(send_to_logfire="if-token-present", console=False)
|
||||
logfire.instrument_pydantic_ai()
|
||||
except ImportError: # pragma: no cover
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
try:
|
||||
|
|
@ -47,7 +47,7 @@ try:
|
|||
from haiku.rag.chat.widgets.chat_history import ChatHistory, CitationWidget
|
||||
|
||||
TEXTUAL_AVAILABLE = True
|
||||
except ImportError: # pragma: no cover
|
||||
except ImportError:
|
||||
TEXTUAL_AVAILABLE = False
|
||||
App = object # type: ignore
|
||||
SystemCommand = object # type: ignore
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from textual.screen import ModalScreen
|
|||
from textual.widgets import Button, Markdown, Static
|
||||
|
||||
|
||||
class ContextModal(ModalScreen): # pragma: no cover
|
||||
class ContextModal(ModalScreen):
|
||||
"""Modal screen for viewing session Q&A history."""
|
||||
|
||||
BINDINGS = [
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from textual.widgets import Button, Checkbox, Input, Static
|
|||
from haiku.rag.client import HaikuRAG
|
||||
|
||||
|
||||
class DocumentFilterModal(ModalScreen): # pragma: no cover
|
||||
class DocumentFilterModal(ModalScreen):
|
||||
"""Modal screen for selecting documents to filter searches."""
|
||||
|
||||
BINDINGS = [
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
try:
|
||||
from haiku.rag.inspector.app import run_inspector
|
||||
except ImportError as e: # pragma: no cover
|
||||
except ImportError as e:
|
||||
raise ImportError(
|
||||
"textual is not installed. Please install it with `pip install 'haiku.rag-slim[tui]'` or use the full haiku.rag package."
|
||||
) from e
|
||||
|
|
|
|||
|
|
@ -21,12 +21,12 @@ try:
|
|||
from haiku.rag.inspector.widgets.search_modal import SearchModal
|
||||
|
||||
TEXTUAL_AVAILABLE = True
|
||||
except ImportError: # pragma: no cover
|
||||
except ImportError:
|
||||
TEXTUAL_AVAILABLE = False
|
||||
App = object # type: ignore
|
||||
|
||||
|
||||
class InspectorApp(App): # pragma: no cover
|
||||
class InspectorApp(App):
|
||||
"""Textual TUI for inspecting LanceDB data."""
|
||||
|
||||
TITLE = "haiku.rag DB Inspector"
|
||||
|
|
@ -243,7 +243,7 @@ def run_inspector(
|
|||
db_path: Path | None = None,
|
||||
read_only: bool = False,
|
||||
before: datetime | None = None,
|
||||
) -> None: # pragma: no cover
|
||||
) -> None:
|
||||
"""Run the inspector TUI.
|
||||
|
||||
Args:
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from haiku.rag.store.models import Chunk
|
|||
BATCH_SIZE = 50
|
||||
|
||||
|
||||
class ChunkList(VerticalScroll): # pragma: no cover
|
||||
class ChunkList(VerticalScroll):
|
||||
"""Widget for displaying and browsing chunks."""
|
||||
|
||||
can_focus = False
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ if TYPE_CHECKING:
|
|||
from haiku.rag.store.models import Chunk
|
||||
|
||||
|
||||
class ContextModal(Screen): # pragma: no cover
|
||||
class ContextModal(Screen):
|
||||
"""Modal screen for displaying how a chunk appears to agents."""
|
||||
|
||||
BINDINGS = [
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class ProvenanceData(Protocol):
|
|||
doc_item_refs: list[str]
|
||||
|
||||
|
||||
class DetailView(VerticalScroll): # pragma: no cover
|
||||
class DetailView(VerticalScroll):
|
||||
"""Widget for displaying detailed content of documents or chunks."""
|
||||
|
||||
can_focus = True
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from haiku.rag.store.models import Document
|
|||
BATCH_SIZE = 50
|
||||
|
||||
|
||||
class DocumentList(VerticalScroll): # pragma: no cover
|
||||
class DocumentList(VerticalScroll):
|
||||
"""Widget for displaying and browsing documents."""
|
||||
|
||||
can_focus = False
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ if TYPE_CHECKING:
|
|||
from haiku.rag.client import HaikuRAG
|
||||
|
||||
|
||||
class InfoModal(ModalScreen): # pragma: no cover
|
||||
class InfoModal(ModalScreen):
|
||||
"""Modal screen for displaying database information."""
|
||||
|
||||
BINDINGS = [
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from haiku.rag.inspector.widgets.detail_view import DetailView
|
|||
from haiku.rag.store.models import Chunk, SearchResult
|
||||
|
||||
|
||||
class SearchModal(Screen): # pragma: no cover
|
||||
class SearchModal(Screen):
|
||||
"""Screen for searching chunks."""
|
||||
|
||||
BINDINGS = [
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ if TYPE_CHECKING:
|
|||
from haiku.rag.store.models import Chunk
|
||||
|
||||
|
||||
class VisualGroundingModal(Screen): # pragma: no cover
|
||||
class VisualGroundingModal(Screen):
|
||||
"""Modal screen for displaying visual grounding with bounding boxes."""
|
||||
|
||||
BINDINGS = [
|
||||
|
|
|
|||
|
|
@ -131,6 +131,10 @@ filterwarnings = ["error", "ignore::UserWarning", "ignore::DeprecationWarning"]
|
|||
|
||||
[tool.coverage.run]
|
||||
source = ["haiku_rag_slim"]
|
||||
omit = [
|
||||
"haiku_rag_slim/haiku/rag/chat/*",
|
||||
"haiku_rag_slim/haiku/rag/inspector/*",
|
||||
]
|
||||
|
||||
[tool.coverage.report]
|
||||
show_missing = true
|
||||
|
|
|
|||
Loading…
Reference in a new issue