Skip to content

Conversation

@jleibs
Copy link
Member

@jleibs jleibs commented Dec 11, 2025

What

Using our pixi environment for working with the rerun-sdk itself has led to all manner of pain. In theory pixi-build may fix this some day, but it's still not optimized for an explicit maturin develop dev flow.

We move the entire "rerun-sdk" test-oriented environment over to uv, removing all examples and dedicated py-related environments from pixi.

Notable Changes

Building and running python code

BEFORE:

pixi run py-build
pixi run -e py ./my_script.py

NOW:

pixi run py-build

# Run through pixi if you don't have uv
pixi run uv ./my_script.py

# Or just use uv directly if you have it installed
uv run ./my_script.py

@github-actions
Copy link

github-actions bot commented Dec 11, 2025

Web viewer built successfully.

Result Commit Link Manifest
1e3a7a2 https://rerun.io/viewer/pr/12176 +nightly +main

View image diff on kitdiff.

Note: This comment is updated whenever you push a commit.

@github-actions
Copy link

github-actions bot commented Dec 11, 2025

Latest documentation preview deployed successfully.

Result Commit Link
1e3a7a2 https://landing-5203ymanf-rerun.vercel.app/docs

Note: This comment is updated whenever you push a commit.

@jleibs jleibs added the sdk-python Python logging API label Dec 11, 2025
@jleibs jleibs added the exclude from changelog PRs with this won't show up in CHANGELOG.md label Dec 11, 2025
@rerun-io rerun-io deleted a comment from github-actions bot Dec 12, 2025
@rerun-io rerun-io deleted a comment from github-actions bot Dec 12, 2025
@rerun-io rerun-io deleted a comment from github-actions bot Dec 12, 2025
@jleibs
Copy link
Member Author

jleibs commented Dec 12, 2025

@rerun-bot full-check

@rerun-io rerun-io deleted a comment from github-actions bot Dec 12, 2025
@github-actions
Copy link

@rerun-io rerun-io deleted a comment from github-actions bot Dec 12, 2025
Copy link
Member

@ntjohnson1 ntjohnson1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM but I'm lacking enough sleep to think about this holistically.

}

fn install_snippet_deps() {
// uv sync --inexact --no-install-package rerun-sdk --group snippets
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This selective inexact usage feels a little footgunny/susceptible to bit rot. I guess if we miss an inexact somewhere then rerun won't be in the environment and we hopefully fail early.

# Build and install the `rerun-sdk` package with the `web_viewer` & `server` feature.
py-build-common-web-viewer = { cmd = "PIP_REQUIRE_VIRTUALENV=0 RERUN_ALLOW_MISSING_BIN=1 maturin develop --manifest-path rerun_py/Cargo.toml --features web_viewer,nasm,server --extras=tests", depends-on = [
"rerun-build-native-and-web", # We need to build rerun-cli since it is bundled in the python package.
py-build-notebook-fast = { cmd = "uv sync --inexact --package rerun-notebook" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fast just allows skipping the JavaScript pieces?

print(f"No wheels found for package {pkg} on platform {plat} and architecture {arch}")
sys.exit(1)

if len(wheels) > 1:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is overly strict. Did you try bumping the version and seeing if this barfs? For instance if we're on 0.27 then go to 0.28 we'd have duplicate wheels in our wheels dir but unique by version

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Historically this has only been used in CI where there will be a single wheel and the main purpose of this was to avoid needing to pick up a dependency on the version. This is a direct port of the other pixi-oriented version of the same script. I'm going to leave it for now but flag it as a thing I clean up in the pending script cleanup.

@timsaucer
Copy link
Member

Something I ran into that I suspect others who frequently use uv/maturin will also is that I cannot just source .venv/bin/activate and then do maturin develop --uv from the rerun_py directory. I have to pass in that additional RERUN_MATURIN_BUILD environment variable and also run the fix_rerun_pth.py. I see that the pixi run py-build command will do those for me, but that means that even though I have this uv environment I can't just use it after setting up. I still need to go through pixi.

Maybe it's worth another look at the fix_rerun_pth.py. I don't have to do this in datafusion-python. There running maturin develop --uv just works.

So I guess what I'm finding is that this does work similar to what I had before except that there is a uv environment but it doesn't work like I would expect it to. I'll keep playing around with it on my flight.

@jleibs jleibs added the do-not-merge Do not merge this PR label Dec 15, 2025
@jleibs
Copy link
Member Author

jleibs commented Dec 15, 2025

We are going to hold off merging this until after 0.28 has been released to avoid debugging release-scripts during the release.

@jleibs jleibs force-pushed the jleibs/python-uv-workflows branch from 3f7db48 to 7032cce Compare December 19, 2025 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge Do not merge this PR exclude from changelog PRs with this won't show up in CHANGELOG.md sdk-python Python logging API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants