Skip to content

Commit

Permalink
wheel build instruction, remove py-build-release again
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Apr 11, 2024
1 parent 444ae8b commit efa30ed
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
22 changes: 6 additions & 16 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Rerun is available as a package on PyPi and can be installed with `pip install r
Additionally, prebuilt dev wheels from head of main are available at <https://github.com/rerun-io/rerun/releases/tag/prerelease>.

If you want to build from source, you can do so easily in the pixi environment:
* Run `pixi run py-build-release` to build SDK & viewer for python (or `pixi run py-build` for a debug build)
* Run `pixi run py-build --release` to build SDK & viewer for python (or `pixi run py-build` for a debug build)
* Then you can run examples from the repository, either by making the pixi shell active with `pixi shell` and then running python or by using `pixi run`, e.g. `pixi run python examples/python/minimal/main.py`


Expand All @@ -84,25 +84,15 @@ pixi run py-fmt
```

### Building an installable Python Wheel
The Python bindings to the core Rust library are built using https://github.com/PyO3/pyo3.

To build an installable Python wheel run:
```
pip install -r rerun_py/requirements-build.txt
maturin build -m rerun_py/Cargo.toml --release
The `py-wheel` command builds a whl file:
```sh
pixi run py-wheel --release
```

By default the wheels will be built to `target/wheels` (use the `-o` flag to set a different output directory).

Now you can install `rerun` in any Python3 environment using:

Which you can then install in your own virtual environment:
```sh
pip3 install target/wheels/*.whl
pip install ../rerun/target/wheels/*.whl
```




## Building and installing the Rerun C++ SDK

On Windows you have to have a system install of Visual Studio 2022 in order to compile the SDK and samples.
Expand Down
2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ py-fmt-check = "ruff format --check --config rerun_py/pyproject.toml"
py-lint = "mypy --install-types --non-interactive --no-warn-unused-ignore"

py-build = "maturin develop --manifest-path rerun_py/Cargo.toml --extras=tests"
py-build-release = "maturin develop --release --manifest-path rerun_py/Cargo.toml --extras=tests"
py-wheel = "maturin build --manifest-path rerun_py/Cargo.toml"

# Run the Python tests.
# Don't call this on CI - use `nox` to run tests on all supported Python versions instead.
Expand Down
8 changes: 6 additions & 2 deletions rerun_py/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,16 @@ Note that SDK and Viewer can run on different machines!
We use the [`pixi`](https://prefix.dev/) for managing dev-tool versioning, download and task running. See [here](https://github.com/casey/just#installation) for installation instructions.

```sh
pixi run py-build-release
pixi run py-build --release
```
To build SDK & viewer for python (or `pixi run py-build` for a debug build).
To build SDK & viewer for python (or `pixi run py-build` for a debug build) and install it in the pixi environment.

You can then run examples from the repository, either by making the pixi shell active with `pixi shell` and then running python or by using `pixi run`, e.g. `pixi run python examples/python/minimal/main.py`.

Respectively, to build a wheel instead for manual install use:
```sh
pixi run py-wheel --release
```

Refer to [BUILD.md](../BUILD.md) for details on the various different build options of the Rerun Viewer and SDKs for all target languages.

Expand Down

0 comments on commit efa30ed

Please sign in to comment.