Skip to content

feat(packaging): PyPI distribution for dimos-viewer#4

Merged
spomichter merged 4 commits intomainfrom
feat/pypi-packaging
Mar 4, 2026
Merged

feat(packaging): PyPI distribution for dimos-viewer#4
spomichter merged 4 commits intomainfrom
feat/pypi-packaging

Conversation

@spomichter
Copy link
Copy Markdown

@spomichter spomichter commented Mar 3, 2026

Problem

Closes DIM-646

The custom Rerun viewer binary requires users to compile from source. This PR adds maturin-based Python packaging so pip install dimos-viewer just works.

Changes

  • Rename binary: custom_callback_viewerdimos-viewer
  • Remove unused custom_callback_app binary
  • Add pyproject.toml (maturin, bindings=bin)
  • Add dimos_viewer Python package (main, launch, _find_viewer_binary)
  • Add 13 Python tests (wrapper, binary, install)
  • CI: build-viewer.yml — clean maturin-based workflow
    • Follows Rerun's CI patterns (platform matrix, manylinux_2_28, concurrency groups)
    • Uses GitHub Artifacts for wheel storage (not GCS)
    • Triggers: PR (build+test), push to main (build+test), tag v* (publish)
    • Build matrix: linux-x64, linux-arm64, macos-arm64
    • bindings = "bin" produces universal py3 wheels (no per-interpreter builds)
    • Publish to PyPI via maturin upload on tag push
    • GitHub Release with wheel assets on tag push
  • Version 0.30.0a1 (aligned with Rerun base version)

Why not call Rerun's reusable workflows directly?

reusable_build_and_upload_wheels.yml is tightly coupled to rerun_py:

  • Hardcoded manifest path, pixi deps, rerun-cli download, feature flags
  • Requires GCS credentials (sccache, artifact upload)
  • Requires Rerun's self-hosted runners

Instead, build-viewer.yml follows the same structural patterns while building the right package.

How to Test

git checkout feat/pypi-packaging
maturin build --manifest-path examples/rust/custom_callback/Cargo.toml --release --out dist/
pip install dist/dimos_viewer-*.whl
pytest examples/rust/custom_callback/tests/ -v

- Rename binary from custom_callback_viewer to dimos-viewer
- Remove unused custom_callback_app binary
- Add pyproject.toml with maturin build backend (bindings=bin)
- Add dimos_viewer Python package with main(), launch(), _find_viewer_binary()
- Add __main__.py for 'python -m dimos_viewer' support
- Add comprehensive Python tests (wrapper, binary, install)
- Replace build-viewer.yml with build-and-publish.yml CI workflow
  - Build matrix: linux-x64, linux-arm64, macos-arm64
  - Python versions: 3.10, 3.11, 3.12, 3.13
  - Rust tests + Python tests
  - PyPI publish on tag push (v*) via maturin upload
  - GitHub Release with wheel artifacts
- Version 0.1.0 (independent semver, based on Rerun 0.30.0-alpha.1)
- Add README with usage, platform support, and versioning docs

Closes DIM-646 (dimos-viewer side)
- Version tracks Rerun base: 0.30.0a1 (based on Rerun 0.30.0-alpha.1)
- Remove comms/ (689 lines TCP protocol, unused)
- Remove panel.rs (demo UI wrapper, unused)
- Remove app.rs (demo app binary, already removed from Cargo.toml)
- lib.rs now only exports interaction module
@spomichter spomichter force-pushed the feat/pypi-packaging branch from 21b2632 to 63d28cb Compare March 4, 2026 00:13
Rework CI workflow to follow Rerun's patterns:
- Renamed build-and-publish.yml → build-viewer.yml
- Added push-to-main trigger alongside PR and tag triggers
- Simplified wheel build: removed redundant --interpreter flag
  (bindings='bin' produces py3-none universal wheels)
- Added concurrency group to cancel stale runs
- Added workflow_dispatch for manual triggers
- Cleaner job structure: check → build-wheel → test-wheel → publish → release
- Uses GitHub Artifacts for wheel storage (not GCS)
- Publish to PyPI via maturin upload on v* tags only

Rerun's reusable_build_and_upload_wheels.yml cannot be called directly
because it is tightly coupled to building rerun_py (uses pixi, GCS
sccache, rerun-cli download, and rerun_py-specific feature flags).
Instead, this workflow follows the same structural patterns:
platform matrix, manylinux_2_28 compat, artifact upload per platform.
@spomichter spomichter merged commit 5d73025 into main Mar 4, 2026
31 of 43 checks passed
vikastechnoai-ai pushed a commit to vikastechnoai-ai/Ai-voice-cmd-control that referenced this pull request Mar 21, 2026
Add [project.optional-dependencies] viewer = ['dimos-viewer>=0.1.0']
to enable 'pip install dimos[viewer]' for the interactive Rerun viewer
with click-to-navigate support.

Note: dimos-viewer is not yet published to PyPI. The uv.lock will resolve
after the first release of dimos-viewer (see dimensionalOS/dimos-viewer#4).
Once published, run 'uv lock' to update the lockfile.

Relates to DIM-646
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant