-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert Python examples to proper packages (#5966)
### What This PR does the following: - Convert all Python examples to proper python packages, replacing the `requirements.txt` file with a `pyproject.toml` file. - Applies same conversion to `tests/python/test_api`. - Add WIP support for running example with pixi - Add a `all_examples` meta-project. - Fix `dev-tools build-examples` for the new example format. - Add a `dev-tools build-examples install` command to `pip install` the examples for the given channel (prerequisite to `build-examples rrd`). - Fix CI for the new example format. - Updates pixi to 0.19.1 in CI. #### pixi support This WIP pixi support allows running examples in the `examples` environment: ``` pixi run -e examples clock ``` Note that by default pixi builds the environment with a shim/empty/fake rerun package (from `examples/python/_empty_rerun_sdk`), which is a work-around to allow manual installation of rerun in the environment. As a result, at first (and whenever a rebuild is needed), this must be run: ``` pixi run -e examples py-build ``` #### `all_examples` This is a meta-package that dynamically depends on all examples. The original hope was to be able to depend on it from pixi, avoiding the need to list example explicitly. However, this is current impossible for a number a reason: - doing so means that examples would not be installed as editable, causing issue with `__file__` relative paths (#6054) - doing so we leak full path in the lock file - pixi currently has an issue where indirect dependency with git dependencies are broken `all_examples` also has a very basic CLI tool that allows listing all examples in a format suitable for pixi: `all_examples list`. Also, it should be relatively easy to cleanly reimplement the functionality of `run_all.py`, which is currently broken: - #6057 As it stands, it allows for efficiently checking dependency conflicts, especially with uv: ```shell cd /tmp uv venv source .venv/bin/activate uv pip install -e path/to/rerun/examples/python/all_examples # ok?? ``` #### TODO - [x] convert a few example to python package - [x] initial version of a `all_examples` meta-package - [x] fix re_build_example - [x] **RE-ENABLE LINK CHECKS!!!!** - ~~properly working pixi setup~~ - ~~python version matrix testing setup~~ ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using examples from latest `main` build: [rerun.io/viewer](https://rerun.io/viewer/pr/5966?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [rerun.io/viewer](https://rerun.io/viewer/pr/5966?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! - [PR Build Summary](https://build.rerun.io/pr/5966) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) To run all checks from `main`, comment on the PR with `@rerun-bot full-check`.
- Loading branch information
Showing
222 changed files
with
6,902 additions
and
1,169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: Update crate versions | ||
run: pixi run python scripts/ci/crates.py version --bump prerelease | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: Python format check | ||
run: pixi run py-fmt-check | ||
|
@@ -92,7 +92,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: Codegen check | ||
run: pixi run codegen --force --check | ||
|
@@ -114,7 +114,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: Rerun lints | ||
run: pixi run lint-rerun | ||
|
@@ -159,7 +159,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
environments: cpp | ||
|
||
# TODO(emilk): make this work somehow. Right now this just results in | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
environments: wheel-test | ||
|
||
- name: Build Wheel | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: Update PR description | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,7 +84,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: Update crate versions | ||
id: versioning | ||
|
@@ -379,7 +379,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: Commit new version | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,7 +164,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: Build web-viewer (release) | ||
run: pixi run rerun-build-web-release | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -189,7 +189,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: Get sha | ||
id: get-sha | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
environments: wheel-test | ||
|
||
- name: Download Wheel | ||
|
@@ -75,9 +75,8 @@ jobs: | |
|
||
- name: Install example dependencies | ||
run: | | ||
pixi run -e wheel-test pip install \ | ||
-r scripts/ci/requirements-examples-${{ inputs.CHANNEL }}.txt \ | ||
--no-input | ||
pixi run -e wheel-test build-examples install \ | ||
--channel ${{ inputs.CHANNEL }} | ||
- name: Install built wheel | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: Install yarn dependencies | ||
run: pixi run yarn --cwd rerun_js install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: Build web-viewer (release) | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,7 +86,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: Codegen check | ||
run: | | ||
|
@@ -104,7 +104,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
|
@@ -156,7 +156,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: prettier --check | ||
run: pixi run misc-fmt-check | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,7 +80,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
environments: cpp | ||
|
||
- name: Set up Rust | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: Python format check | ||
run: pixi run py-fmt-check | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,7 +63,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
# We need to build the web viewer for `rust_checks.py` to succeed. | ||
# We build in release so that we can reuse the results for actual publishing, if necessary | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -203,7 +203,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: Doxygen C++ docs | ||
run: pixi run cpp-docs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: Publish packages | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
environments: wheel-test | ||
|
||
# built by `reusable_build_and_publish_wheels` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,7 +155,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- id: "auth" | ||
uses: google-github-actions/auth@v2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
|
||
- name: Build web-viewer (release) | ||
run: pixi run rerun-build-web-release | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
environments: wheel-test | ||
|
||
- name: Download Wheel | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,7 +147,7 @@ jobs: | |
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.19.0 | ||
pixi-version: v0.19.1 | ||
environments: wheel-test | ||
|
||
- name: Download Wheel | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.