Skip to content

Commit 587cfce

Browse files
authored
Bring back the py-docs pixi environment (#7818)
### What - Resolves: #6060 Pip installing things into pixi environments is always a recipe for pain. This is the way. Pushed this branch to `docs-latest` and confirmed it succeeded: - https://github.com/rerun-io/rerun/actions/runs/11390203895 ### 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/7818?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/7818?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)! * [x] If have noted any breaking changes to the log API in `CHANGELOG.md` and the migration guide - [PR Build Summary](https://build.rerun.io/pr/7818) - [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`.
1 parent ca18924 commit 587cfce

File tree

11 files changed

+32120
-36029
lines changed

11 files changed

+32120
-36029
lines changed

.github/workflows/contrib_checks.yml

+4-10
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,15 @@ jobs:
6161
steps:
6262
- uses: actions/checkout@v4
6363

64-
- name: Set up Python
65-
uses: actions/setup-python@v4
64+
- uses: prefix-dev/[email protected]
6665
with:
67-
python-version: "3.9"
68-
69-
- name: Install Python dependencies
70-
shell: bash
71-
run: |
72-
pip install --upgrade pip
73-
pip install -r rerun_py/requirements-doc.txt
66+
pixi-version: v0.25.0
67+
environments: py-docs
7468

7569
- name: Build via mkdocs
7670
shell: bash
7771
run: |
78-
mkdocs build --strict -f rerun_py/mkdocs.yml
72+
pixi run -e py-docs mkdocs build --strict -f rerun_py/mkdocs.yml
7973
8074
no-codegen-changes:
8175
name: Check if running codegen would produce any changes

.github/workflows/on_push_docs.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ jobs:
5959
- uses: prefix-dev/[email protected]
6060
with:
6161
pixi-version: v0.25.0
62+
environments: py-docs
6263

6364
- name: Install rerun-sdk
6465
run: |
@@ -72,11 +73,6 @@ jobs:
7273
# because it is not actually going to run
7374
RUSTFLAGS: "-Awarnings --cfg disable_web_viewer_server"
7475
run: |
75-
# Install latest release version of the Rerun SDK
76-
# We don't actually want to build it, because then we'd be installing the dev version.
77-
pixi run pip install -r rerun_py/requirements-doc.txt
78-
pixi run pip install rerun-sdk==${{ needs.get-version.outputs.version }}
79-
8076
pixi run search-index build \
8177
landing \
8278
--url "https://edge.meilisearch.com" \

.github/workflows/reusable_checks_python.yml

+4-12
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,12 @@ jobs:
5353
with:
5454
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
5555

56-
- name: Set up Python
57-
uses: actions/setup-python@v4
56+
- uses: prefix-dev/[email protected]
5857
with:
59-
python-version: "3.9"
60-
cache: "pip"
61-
cache-dependency-path: "rerun_py/requirements-doc.txt"
62-
63-
- name: Install Python dependencies
64-
shell: bash
65-
run: |
66-
pip install --upgrade pip
67-
pip install -r rerun_py/requirements-doc.txt
58+
pixi-version: v0.25.0
59+
environments: py-docs
6860

6961
- name: Build via mkdocs
7062
shell: bash
7163
run: |
72-
mkdocs build --strict -f rerun_py/mkdocs.yml
64+
pixi run -e py-docs mkdocs build --strict -f rerun_py/mkdocs.yml

.github/workflows/reusable_deploy_docs.yml

+5-13
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,10 @@ jobs:
7171
fetch-depth: 0 # Don't do a shallow clone
7272
ref: ${{ inputs.RELEASE_COMMIT || (github.event_name == 'pull_request' && github.event.pull_request.head.ref || '') }}
7373

74-
- name: Set up Python
75-
uses: actions/setup-python@v4
74+
- uses: prefix-dev/[email protected]
7675
with:
77-
python-version: "3.11"
78-
cache: "pip"
79-
cache-dependency-path: "rerun_py/requirements-doc.txt"
80-
81-
- name: Install Python dependencies
82-
shell: bash
83-
run: |
84-
pip install --upgrade pip
85-
pip install -r rerun_py/requirements-doc.txt
76+
pixi-version: v0.25.0
77+
environments: py-docs
8678

8779
- name: Set up git author
8880
run: |
@@ -99,7 +91,7 @@ jobs:
9991
if: ${{ inputs.UPDATE_LATEST }}
10092
run: |
10193
git fetch
102-
mike deploy -F rerun_py/mkdocs.yml --rebase -b gh-pages --prefix docs/python -u ${{inputs.PY_DOCS_VERSION_NAME}} stable
94+
pixi run -e py-docs mike deploy -F rerun_py/mkdocs.yml --rebase -b gh-pages --prefix docs/python -u ${{inputs.PY_DOCS_VERSION_NAME}} stable
10395
git checkout gh-pages
10496
git checkout --orphan gh-pages-orphan
10597
git commit -m "Update docs for ${GITHUB_SHA}"
@@ -112,7 +104,7 @@ jobs:
112104
if: ${{ ! inputs.UPDATE_LATEST }}
113105
run: |
114106
git fetch
115-
mike deploy -F rerun_py/mkdocs.yml --rebase -b gh-pages --prefix docs/python ${{inputs.PY_DOCS_VERSION_NAME}}
107+
pixi run -e py-docs mike deploy -F rerun_py/mkdocs.yml --rebase -b gh-pages --prefix docs/python ${{inputs.PY_DOCS_VERSION_NAME}}
116108
git checkout gh-pages
117109
git checkout --orphan gh-pages-orphan
118110
git commit -m "Update docs for ${GITHUB_SHA}"

crates/build/re_dev_tools/src/build_search_index/README.md

-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ Builds a Meilisearch index from our documentation.
1010
rustup install nightly
1111
rustup +nightly target add wasm32-unknown-unknown
1212
```
13-
- A local installation of `rerun_sdk` and `rerun_py/requirements-doc.txt`
14-
```
15-
pixi run py-build
16-
pixi run pip install -r rerun_py/requirements-doc.txt
17-
```
18-
1913
### Usage
2014

2115
Start a local `meilisearch` instance:

crates/build/re_dev_tools/src/build_search_index/ingest/python.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub fn ingest(ctx: &Context) -> anyhow::Result<()> {
4141
// this dump is only used to obtain docstrings
4242
progress.set("griffe dump", ctx.is_tty());
4343
let dump: Dump = Command::new("griffe")
44-
.with_args(["dump", "rerun_sdk"])
44+
.with_args(["dump", "rerun_sdk", "-s", "rerun_py"])
4545
.parse_json()
4646
.context("either griffe or rerun_sdk is not installed, try running `pixi run pip install -r rerun_py/requirements-doc.txt` and building the SDK")?;
4747

@@ -177,7 +177,7 @@ fn collect_docstrings(root: &Item) -> Docstrings {
177177
panic!("root must be a module");
178178
};
179179

180-
for member in &root.members {
180+
for member in root.members.values() {
181181
member.visit(&mut visitor);
182182
}
183183

@@ -233,7 +233,7 @@ enum Item {
233233
struct Module {
234234
name: String,
235235
// labels: Vec<String>,
236-
members: Vec<Item>,
236+
members: BTreeMap<String, Item>,
237237
docstring: Option<Docstring>,
238238
}
239239

@@ -278,7 +278,7 @@ struct Docstring {
278278
struct Class {
279279
name: String,
280280
docstring: Option<Docstring>,
281-
members: Vec<Item>,
281+
members: BTreeMap<String, Item>,
282282
}
283283

284284
type Dump = BTreeMap<String, Item>;
@@ -330,7 +330,7 @@ impl Visit for Item {
330330
impl Visit for Module {
331331
#[inline]
332332
fn visit<T: ?Sized + Visitor>(&self, visitor: &mut T) {
333-
for member in &self.members {
333+
for member in self.members.values() {
334334
member.visit(visitor);
335335
}
336336
}
@@ -354,7 +354,7 @@ impl Visit for Function {
354354
impl Visit for Class {
355355
#[inline]
356356
fn visit<T: ?Sized + Visitor>(&self, visitor: &mut T) {
357-
for member in &self.members {
357+
for member in self.members.values() {
358358
member.visit(visitor);
359359
}
360360
}

0 commit comments

Comments
 (0)