Skip to content

Commit da24a25

Browse files
committed
Fix circular import between observer and platform
1 parent 4ea5556 commit da24a25

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

src/pidpal/core/explainer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
if TYPE_CHECKING:
2424
from pidpal.llm.base import LLMProvider
2525

26+
2627
@dataclass
2728
class ProcessExplanation:
2829
"""Human-readable explanation of a process."""

src/pidpal/core/observer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
"""
24
Observation Layer - System Truth
35
@@ -7,9 +9,10 @@
79

810
from dataclasses import dataclass
911
from datetime import datetime
10-
from typing import Any
12+
from typing import TYPE_CHECKING, Any
1113

12-
from pidpal.platform.base import PlatformInterface
14+
if TYPE_CHECKING:
15+
from pidpal.platform.base import PlatformInterface
1316

1417

1518
@dataclass

src/pidpal/knowledge/local_enrichment.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,9 @@ def _iter_desktop_dirs(self) -> list[Path]:
562562
Path.home() / ".local/share/flatpak/exports/share/applications",
563563
]
564564

565-
def _update_desktop_cache(self, cache: dict[str, dict[str, str]], entry: dict[str, str]) -> None:
565+
def _update_desktop_cache(
566+
self, cache: dict[str, dict[str, str]], entry: dict[str, str]
567+
) -> None:
566568
"""Add a desktop entry to the cache with common keys."""
567569
exec_name = entry.get("exec_name", "").lower()
568570
if exec_name:

src/pidpal/platform/base.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@
55
"""
66

77
from abc import ABC, abstractmethod
8+
from typing import TYPE_CHECKING
89

9-
from pidpal.core.observer import ProcessData
10+
if TYPE_CHECKING:
11+
from pidpal.core.observer import ProcessData
1012

1113

1214
class PlatformInterface(ABC):
1315
"""Abstract interface for platform-specific process data collection."""
1416

1517
@abstractmethod
16-
def collect_process_data(self, pid: int) -> ProcessData:
18+
def collect_process_data(self, pid: int) -> "ProcessData":
1719
"""
1820
Collect all available data for a specific process.
1921
@@ -30,7 +32,7 @@ def collect_process_data(self, pid: int) -> ProcessData:
3032
pass
3133

3234
@abstractmethod
33-
def collect_all_processes(self) -> list[ProcessData]:
35+
def collect_all_processes(self) -> list["ProcessData"]:
3436
"""
3537
Collect data for all running processes.
3638

src/pidpal/ui/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
if TYPE_CHECKING:
2222
from threading import Thread
2323

24+
2425
@dataclass
2526
class CliOptions:
2627
pid: str | None

0 commit comments

Comments
 (0)