wifi-densepose/python
ruv 4ec5b166e6 fix(adr-117/p1): standalone Cargo.toml + python-source=. + #[pyo3(name=_native)] (P1 GREEN)
Three fixes to make maturin develop actually work locally:

1. `python/Cargo.toml` removed `*.workspace = true` inheritance —
   the python/ crate is intentionally outside the v2/ workspace
   (ADR-117 §5.2) so it needs every `[package]` field local.

2. `python/pyproject.toml` `python-source = "python"` was wrong
   because pyproject.toml lives at python/ — maturin was looking for
   python/python/. Changed to `python-source = "."` so the
   `wifi_densepose/` package directory sibling-to-pyproject is found.

3. `python/src/lib.rs` `#[pymodule] fn wifi_densepose_native` →
   `#[pymodule] #[pyo3(name = "_native")] fn wifi_densepose_native`.
   PyO3 generates `PyInit__native` from the pyo3-name attribute, which
   must match the `module-name` in pyproject.toml's [tool.maturin]
   block ("wifi_densepose._native"). Without this attribute the wheel
   builds but `import wifi_densepose._native` fails with
   ModuleNotFoundError.

## Local validation (P1 acceptance gate)

```
$ python -m venv .venv && .venv/Scripts/python -m pip install maturin pytest
$ VIRTUAL_ENV=… maturin develop --release
…
    Finished `release` profile [optimized] target(s)
📦 Built wheel for abi3 Python ≥ 3.10
🛠 Installed wifi-densepose-2.0.0a1

$ .venv/Scripts/python -c 'import wifi_densepose; print(wifi_densepose.__version__, wifi_densepose.__rust_version__, wifi_densepose.hello())'
2.0.0a1 2.0.0-alpha.1 ok

$ .venv/Scripts/python -m pytest tests/ -v
tests/test_smoke.py::test_package_imports PASSED
tests/test_smoke.py::test_version_string_well_formed PASSED
tests/test_smoke.py::test_rust_version_surfaced PASSED
tests/test_smoke.py::test_build_features_listed PASSED
tests/test_smoke.py::test_hello_returns_ok PASSED
tests/test_smoke.py::test_native_module_private PASSED
======================== 6 passed in 0.05s =========================
```

P1 closed. Moving to P2 (core type bindings).

Refs #785, ADR-117 §6.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-05-24 10:48:28 -04:00
..
src fix(adr-117/p1): standalone Cargo.toml + python-source=. + #[pyo3(name=_native)] (P1 GREEN) 2026-05-24 10:48:28 -04:00
tests feat(adr-117/p1): scaffold python/ workspace — PyO3 + maturin + smoke tests (refs #785) 2026-05-24 10:42:35 -04:00
wifi_densepose feat(adr-117/p1): scaffold python/ workspace — PyO3 + maturin + smoke tests (refs #785) 2026-05-24 10:42:35 -04:00
Cargo.toml fix(adr-117/p1): standalone Cargo.toml + python-source=. + #[pyo3(name=_native)] (P1 GREEN) 2026-05-24 10:48:28 -04:00
README.md feat(adr-117/p1): scaffold python/ workspace — PyO3 + maturin + smoke tests (refs #785) 2026-05-24 10:42:35 -04:00
pyproject.toml fix(adr-117/p1): standalone Cargo.toml + python-source=. + #[pyo3(name=_native)] (P1 GREEN) 2026-05-24 10:48:28 -04:00

README.md

wifi-densepose v2.x — PyO3 bindings for the Rust core

This directory contains the source for the wifi-densepose PyPI wheel (v2.0+). It's a PyO3 + maturin build that wraps the Rust crates in v2/crates/ and replaces the legacy pure-Python wifi-densepose==1.1.0 (released 2025-06-07).

See ADR-117 for the full modernization plan.

Build locally

# Install maturin + dev deps
pip install maturin pytest

# Develop-install — builds the Rust extension in-place
cd python
maturin develop

# Run the smoke tests
pytest tests/

The maturin develop command produces a debug-build wheel installed into your current Python environment. For release builds:

maturin build --release --strip

The wheel lands under python/target/wheels/.

Layout

python/
├── Cargo.toml                    # PyO3 + abi3-py310 + Rust deps
├── pyproject.toml                # maturin backend + Python metadata
├── README.md                     # this file
├── src/
│   └── lib.rs                    # #[pymodule] — Rust binding glue
├── wifi_densepose/               # pure-Python facade (the user-facing API)
│   ├── __init__.py               # re-exports compiled module symbols
│   └── py.typed                  # PEP 561 typed-package marker
└── tests/
    └── test_smoke.py             # P1 acceptance tests

Phase status (per ADR-117 §6)

  • P1 — Scaffold (this commit): module loads, version constant exposed, 6 smoke tests pass via maturin develop.
  • P2 — Core type bindings: CsiFrame, Keypoint, PoseEstimate.
  • P3 — Vitals + signal DSP: 4-stage HR/BR pipeline + CsiProcessor
    • PhaseSanitizer, with allow_threads GIL release on hot loops.
  • P4 — WS/MQTT client: pure-Python wifi_densepose.client extra.
  • P5 — cibuildwheel + PyPI publish: Linux/macOS/Windows × abi3-py310.

Each phase ends with a checkbox PR. Tests are additive — every phase's smoke tests must still pass after later phases land.

Migrating from v1.x

The v1 line was a separate pure-Python implementation. v2 is a hard break (semver-justified by 11.5 months of stack drift). Migration guide ships in docs/migrations/wifi-densepose-1-to-2.md (landing in P5).