Skip to content

Commit

Permalink
Bring back the py-docs pixi environment (#7818)
Browse files Browse the repository at this point in the history
### 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`.
  • Loading branch information
jleibs authored Oct 18, 2024
1 parent ca18924 commit 587cfce
Show file tree
Hide file tree
Showing 11 changed files with 32,120 additions and 36,029 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/contrib_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with:
python-version: "3.9"

- name: Install Python dependencies
shell: bash
run: |
pip install --upgrade pip
pip install -r rerun_py/requirements-doc.txt
pixi-version: v0.25.0
environments: py-docs

- name: Build via mkdocs
shell: bash
run: |
mkdocs build --strict -f rerun_py/mkdocs.yml
pixi run -e py-docs mkdocs build --strict -f rerun_py/mkdocs.yml
no-codegen-changes:
name: Check if running codegen would produce any changes
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/on_push_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
- uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.25.0
environments: py-docs

- name: Install rerun-sdk
run: |
Expand All @@ -72,11 +73,6 @@ jobs:
# because it is not actually going to run
RUSTFLAGS: "-Awarnings --cfg disable_web_viewer_server"
run: |
# Install latest release version of the Rerun SDK
# We don't actually want to build it, because then we'd be installing the dev version.
pixi run pip install -r rerun_py/requirements-doc.txt
pixi run pip install rerun-sdk==${{ needs.get-version.outputs.version }}
pixi run search-index build \
landing \
--url "https://edge.meilisearch.com" \
Expand Down
16 changes: 4 additions & 12 deletions .github/workflows/reusable_checks_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,12 @@ jobs:
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}

- name: Set up Python
uses: actions/setup-python@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: "rerun_py/requirements-doc.txt"

- name: Install Python dependencies
shell: bash
run: |
pip install --upgrade pip
pip install -r rerun_py/requirements-doc.txt
pixi-version: v0.25.0
environments: py-docs

- name: Build via mkdocs
shell: bash
run: |
mkdocs build --strict -f rerun_py/mkdocs.yml
pixi run -e py-docs mkdocs build --strict -f rerun_py/mkdocs.yml
18 changes: 5 additions & 13 deletions .github/workflows/reusable_deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,10 @@ jobs:
fetch-depth: 0 # Don't do a shallow clone
ref: ${{ inputs.RELEASE_COMMIT || (github.event_name == 'pull_request' && github.event.pull_request.head.ref || '') }}

- name: Set up Python
uses: actions/setup-python@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: "rerun_py/requirements-doc.txt"

- name: Install Python dependencies
shell: bash
run: |
pip install --upgrade pip
pip install -r rerun_py/requirements-doc.txt
pixi-version: v0.25.0
environments: py-docs

- name: Set up git author
run: |
Expand All @@ -99,7 +91,7 @@ jobs:
if: ${{ inputs.UPDATE_LATEST }}
run: |
git fetch
mike deploy -F rerun_py/mkdocs.yml --rebase -b gh-pages --prefix docs/python -u ${{inputs.PY_DOCS_VERSION_NAME}} stable
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
git checkout gh-pages
git checkout --orphan gh-pages-orphan
git commit -m "Update docs for ${GITHUB_SHA}"
Expand All @@ -112,7 +104,7 @@ jobs:
if: ${{ ! inputs.UPDATE_LATEST }}
run: |
git fetch
mike deploy -F rerun_py/mkdocs.yml --rebase -b gh-pages --prefix docs/python ${{inputs.PY_DOCS_VERSION_NAME}}
pixi run -e py-docs mike deploy -F rerun_py/mkdocs.yml --rebase -b gh-pages --prefix docs/python ${{inputs.PY_DOCS_VERSION_NAME}}
git checkout gh-pages
git checkout --orphan gh-pages-orphan
git commit -m "Update docs for ${GITHUB_SHA}"
Expand Down
6 changes: 0 additions & 6 deletions crates/build/re_dev_tools/src/build_search_index/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ Builds a Meilisearch index from our documentation.
rustup install nightly
rustup +nightly target add wasm32-unknown-unknown
```
- A local installation of `rerun_sdk` and `rerun_py/requirements-doc.txt`
```
pixi run py-build
pixi run pip install -r rerun_py/requirements-doc.txt
```

### Usage

Start a local `meilisearch` instance:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub fn ingest(ctx: &Context) -> anyhow::Result<()> {
// this dump is only used to obtain docstrings
progress.set("griffe dump", ctx.is_tty());
let dump: Dump = Command::new("griffe")
.with_args(["dump", "rerun_sdk"])
.with_args(["dump", "rerun_sdk", "-s", "rerun_py"])
.parse_json()
.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")?;

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

for member in &root.members {
for member in root.members.values() {
member.visit(&mut visitor);
}

Expand Down Expand Up @@ -233,7 +233,7 @@ enum Item {
struct Module {
name: String,
// labels: Vec<String>,
members: Vec<Item>,
members: BTreeMap<String, Item>,
docstring: Option<Docstring>,
}

Expand Down Expand Up @@ -278,7 +278,7 @@ struct Docstring {
struct Class {
name: String,
docstring: Option<Docstring>,
members: Vec<Item>,
members: BTreeMap<String, Item>,
}

type Dump = BTreeMap<String, Item>;
Expand Down Expand Up @@ -330,7 +330,7 @@ impl Visit for Item {
impl Visit for Module {
#[inline]
fn visit<T: ?Sized + Visitor>(&self, visitor: &mut T) {
for member in &self.members {
for member in self.members.values() {
member.visit(visitor);
}
}
Expand All @@ -354,7 +354,7 @@ impl Visit for Function {
impl Visit for Class {
#[inline]
fn visit<T: ?Sized + Visitor>(&self, visitor: &mut T) {
for member in &self.members {
for member in self.members.values() {
member.visit(visitor);
}
}
Expand Down
Loading

0 comments on commit 587cfce

Please sign in to comment.