Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,15 @@ deployment = [
]

[project.urls]
Homepage = "https://github.com/ruvnet/wifi-densepose"
Documentation = "https://github.com/ruvnet/wifi-densepose#readme"
Repository = "https://github.com/ruvnet/wifi-densepose.git"
"Bug Tracker" = "https://github.com/ruvnet/wifi-densepose/issues"
Changelog = "https://github.com/ruvnet/wifi-densepose/blob/main/CHANGELOG.md"
Homepage = "https://github.com/ruvnet/RuView"
Documentation = "https://github.com/ruvnet/RuView#readme"
Repository = "https://github.com/ruvnet/RuView.git"
"Bug Tracker" = "https://github.com/ruvnet/RuView/issues"
Changelog = "https://github.com/ruvnet/RuView/blob/main/CHANGELOG.md"

[project.scripts]
wifi-densepose = "src.cli:cli"
wdp = "src.cli:cli"
# CLI entry points removed: the maintained `wifi-densepose` CLI is the Rust
# binary in v2/crates/wifi-densepose-cli (cargo install). The old Python
# `src.cli` module no longer exists at the repo root after the v1 reorg.

[project.entry-points."wifi_densepose.plugins"]
# Plugin entry points for extensibility
Expand All @@ -185,7 +185,7 @@ package-dir = {"" = "."}

[tool.setuptools.packages.find]
where = ["."]
include = ["wifi_densepose*", "src*"]
include = ["wifi_densepose*"]
exclude = ["tests*", "docs*", "scripts*"]

[tool.setuptools.package-data]
Expand Down
44 changes: 27 additions & 17 deletions wifi_densepose/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@

logger = logging.getLogger(__name__)

# Allow importing the v1 src package when installed from the repo
_v1_src = os.path.join(os.path.dirname(os.path.dirname(__file__)), "v1")
# Allow importing the v1 src package when installed from the repo.
# v1 moved to archive/v1 in the repo reorg (f49c7227); keep both locations
# so older checkouts and the shipped wheel both resolve.
_here = os.path.dirname(os.path.abspath(__file__))
_v1_src = os.path.join(os.path.dirname(_here), "v1")
if not os.path.isdir(_v1_src):
_v1_src = os.path.join(os.path.dirname(_here), "archive", "v1")
if os.path.isdir(_v1_src) and _v1_src not in sys.path:
sys.path.insert(0, _v1_src)

Expand Down Expand Up @@ -65,11 +70,9 @@ async def _async_start(self):
logger.info("WiFiDensePose system started on %s:%s", self.host, self.port)
except ImportError:
raise ImportError(
"Core dependencies not found. Make sure you installed "
"from the repository root:\n"
" cd wifi-densepose && pip install -e .\n"
"Or install the v1 package:\n"
" cd wifi-densepose/v1 && pip install -e ."
"Core dependencies not found. Install from the repository root:\n"
" git clone https://github.com/ruvnet/RuView && cd RuView\n"
" pip install -e ."
)

def stop(self):
Expand All @@ -83,24 +86,31 @@ def stop(self):
logger.info("WiFiDensePose system stopped")

def get_latest_poses(self):
"""Return the most recent list of detected pose dicts."""
"""Return the most recent list of detected pose dicts.

Returns [] only when there is genuinely no pose data yet; an
error is logged (never swallowed silently) before returning [].
"""
if self._orchestrator is None:
return []
try:
import asyncio
import asyncio

loop = _get_or_create_event_loop()
loop = _get_or_create_event_loop()
try:
return loop.run_until_complete(self._fetch_poses())
except Exception:
logger.warning(
"get_latest_poses failed (orchestrator may be unhealthy)",
exc_info=True,
)
return []

async def _fetch_poses(self):
try:
pose_svc = self._orchestrator.pose_service
if pose_svc and hasattr(pose_svc, "get_latest"):
return await pose_svc.get_latest()
except Exception:
pass
if self._orchestrator is None:
return []
pose_svc = self._orchestrator.pose_service
if pose_svc and hasattr(pose_svc, "get_latest"):
return await pose_svc.get_latest()
return []

# ------------------------------------------------------------------
Expand Down