Skip to content

Commit

Permalink
Remove all dev/ci requirements.txt and fully replace with pixi (#5939)
Browse files Browse the repository at this point in the history
### What

* Fixes #5895

In the process cleans up quite a bit more ci to use the pixi environment
consequently.

Note that the process I followed here was essentially:
* pick a requirements.txt file
* check for each of its package if it's already in pixi
    * if not, try adding it as conda package to pixi
         * if not add it as pypi package to pixi
         * try documenting who uses it
* repeat until requirements.txt file is empty
* remove mentions of the requirements.txt file, ensure that python
invocations below are using pixi


### 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/5939?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/5939?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/5939)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
  • Loading branch information
Wumpf authored Apr 12, 2024
1 parent 4c6369d commit 97a45d3
Show file tree
Hide file tree
Showing 29 changed files with 1,227 additions and 1,522 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/auto_approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
- uses: prefix-dev/[email protected]
with:
python-version: 3.11

- name: Install dependencies
shell: bash
run: |
python3 -m pip install --upgrade pip
python3 -m pip install "PyGithub==1.59.0" "requests>=2.31,<3"
pixi-version: v0.18.0

- name: Wait a few seconds
shell: bash
Expand All @@ -40,7 +33,7 @@ jobs:
- name: Approve workflow runs
shell: bash
run: |
python3 scripts/ci/approve_workflow_runs.py \
pixi run python scripts/ci/approve_workflow_runs.py \
--github-token "${{ secrets.GITHUB_TOKEN }}" \
--github-repository "rerun-io/rerun" \
--pr-number "${{ github.event.pull_request.number || github.event.issue.number }}"
10 changes: 1 addition & 9 deletions .github/workflows/auto_release_crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,10 @@ jobs:
with:
pixi-version: v0.19.0

- name: Install dependencies
shell: bash
run: |
python3 -m pip install -r scripts/ci/requirements-crates.txt
- name: Update crate versions
shell: bash
run: |
python3 scripts/ci/crates.py version --bump prerelease
run: pixi run python scripts/ci/crates.py version --bump prerelease

- run: pixi run toml-fmt
shell: bash

- name: Get bumped version
id: versioning
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/checkboxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,14 @@ jobs:
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}

- name: Set up Python
uses: actions/setup-python@v5
- uses: prefix-dev/[email protected]
with:
python-version: 3.11

- name: Install deps
shell: bash
run: |
python3 -m pip install PyGithub==1.59.0
pixi-version: v0.18.0

- name: Check PR checkboxes
shell: bash
run: |
./scripts/ci/check_pr_checkboxes.py \
pixi run ./scripts/ci/check_pr_checkboxes.py \
--github-token ${{ secrets.GITHUB_TOKEN }} \
--github-repository ${{ github.repository }} \
--pr-number ${{ github.event.pull_request.number }}
27 changes: 3 additions & 24 deletions .github/workflows/contrib_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,12 @@ jobs:
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.19.0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install Python dependencies
shell: bash
run: |
pip install --upgrade pip
pip install -r rerun_py/requirements-lint.txt

- name: Python format check
shell: bash
run: |
pixi run py-fmt-check
run: pixi run py-fmt-check

- name: Lint Python
shell: bash
run: |
pixi run py-lint
run: pixi run py-lint

py-test-docs:
name: Test Python Docs
Expand All @@ -81,9 +67,7 @@ jobs:
pixi-version: v0.19.0

- name: Build via mkdocs
shell: bash
run: |
pixi run -e py-docs mkdocs build --strict -f rerun_py/mkdocs.yml
run: 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 Expand Up @@ -122,11 +106,6 @@ jobs:
with:
pixi-version: v0.19.0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"

- name: Rerun lints
run: pixi run lint-rerun

Expand Down
26 changes: 5 additions & 21 deletions .github/workflows/contrib_rerun_py.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ jobs:
with:
pixi-version: v0.19.0

# These should already be in the docker container, but run for good measure. A no-op install
# should be fast, and this way things don't break if we add new packages without rebuilding
# docker
- run: pip install -r scripts/ci/requirements.txt
shell: bash

- name: Build Wheel
uses: PyO3/maturin-action@v1
with:
Expand All @@ -76,16 +70,6 @@ jobs:
${{ inputs.MATURIN_FEATURE_FLAGS }}
--out dist
# Test the wheel
- name: Install wheel dependencies
# First we install the dependencies manually so we can use `--no-index` when installing the wheel.
# This needs to be a separate step for some reason or the following step fails
# TODO(jleibs): pull these deps from pyproject.toml
# TODO(jleibs): understand why deps can't be installed in the same step as the wheel
shell: bash
run: |
pip install attrs>=23.1.0 'numpy>=1.23,<2' pillow pyarrow>=14.0.2 pytest==7.1.2 torch==2.1.0 typing_extensions>=4.5
- name: Get version
id: get-version
shell: bash
Expand All @@ -110,27 +94,27 @@ jobs:
- name: Run Python unit-tests
shell: bash
run: cd rerun_py/tests && pytest -c ../pyproject.toml
run: pixi run -e wheel-test cd rerun_py/tests && pixi run -e wheel-test pytest -c ../pyproject.toml

- name: Run e2e test
shell: bash
run: RUST_LOG=debug scripts/run_python_e2e_test.py --no-build # rerun-sdk is already built and installed
run: pixi run -e wheel-test RUST_LOG=debug scripts/run_python_e2e_test.py --no-build # rerun-sdk is already built and installed

- name: Run tests/roundtrips.py
shell: bash
# --release so we can inherit from some of the artifacts that maturin has just built before
# --target x86_64-unknown-linux-gnu because otherwise cargo loses the target cache… even though this is the target anyhow…
# --no-py-build because rerun-sdk is already built and installed
run: |
RUST_LOG=debug tests/roundtrips.py --release --target x86_64-unknown-linux-gnu --no-py-build
pixi run -e wheel-test RUST_LOG=debug tests/roundtrips.py --release --target x86_64-unknown-linux-gnu --no-py-build
- name: Run docs/snippets/compare_snippet_output.py
shell: bash
# --release so we can inherit from some of the artifacts that maturin has just built before
# --target x86_64-unknown-linux-gnu because otherwise cargo loses the target cache… even though this is the target anyhow…
# --no-py-build because rerun-sdk is already built and installed
run: |
RUST_LOG=debug docs/snippets/compare_snippet_output.py --release --target x86_64-unknown-linux-gnu --no-py-build
pixi run -e wheel-test RUST_LOG=debug docs/snippets/compare_snippet_output.py --release --target x86_64-unknown-linux-gnu --no-py-build
- name: Cache RRD dataset
id: dataset
Expand All @@ -146,4 +130,4 @@ jobs:
run: |
mkdir rrd
pip install -r examples/python/structure_from_motion/requirements.txt
python3 examples/python/structure_from_motion/main.py --dataset colmap_fiat --resize 800x600 --save rrd/colmap_fiat.rrd
pixi run -e wheel-test python examples/python/structure_from_motion/main.py --dataset colmap_fiat --resize 800x600 --save rrd/colmap_fiat.rrd
12 changes: 3 additions & 9 deletions .github/workflows/on_pull_request_target_contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,14 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
- uses: prefix-dev/[email protected]
with:
python-version: 3.11

- name: Install deps
shell: bash
run: |
python3 -m pip install -r ./scripts/ci/requirements.txt
pixi-version: v0.19.0

- name: Update PR description
shell: bash
run: |
./scripts/ci/update_pr_body.py \
pixi run ./scripts/ci/update_pr_body.py \
--github-token '${{ secrets.GITHUB_TOKEN }}' \
--github-repository '${{ github.repository }}' \
--pr-number '${{ github.event.pull_request.number }}'
44 changes: 12 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,6 @@ jobs:
with:
node-version: 18

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install deps
shell: bash
run: |
python3 -m pip install -r ./scripts/ci/requirements-crates.txt
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.19.0
Expand All @@ -97,40 +87,40 @@ jobs:
shell: bash
run: |
echo Check that the release version matches expected format…
python3 scripts/ci/crates.py check-git-branch-name
pixi run python scripts/ci/crates.py check-git-branch-name
echo Parse the release version from the branch name…
# `release-0.8.1-meta.N` -> `0.8.1`
release_version=$(python3 scripts/ci/crates.py get-version --from git --finalize)
release_version=$(pixi run python scripts/ci/crates.py get-version --from git --finalize)
echo "release_version: $release_version"
echo Store version before the update, so we can later detect if it changed…
previous=$(python3 scripts/ci/crates.py get-version)
previous=$(pixi run python scripts/ci/crates.py get-version)
echo If the version minus prerelease/build metadata is not the same as the release version, then update it.…
if [ $(python3 scripts/ci/crates.py get-version --finalize) != $release_version ]; then
python3 scripts/ci/crates.py version --exact $release_version
if [ $(pixi run python scripts/ci/crates.py get-version --finalize) != $release_version ]; then
pixi run python scripts/ci/crates.py version --exact $release_version
fi
echo If this is an 'rc', additionally set add '-rc.N'. This will also bump the 'N' if '-rc.N' is already set…
if [ ${{ inputs.release-type }} = "rc" ]; then
python3 scripts/ci/crates.py version --bump prerelease --pre-id=rc
pixi run python scripts/ci/crates.py version --bump prerelease --pre-id=rc
fi
echo If this is an 'alpha', set the version to whatever is in the git branch name.…
if [ ${{ inputs.release-type }} = "alpha" ]; then
python3 scripts/ci/crates.py version --exact $(python3 scripts/ci/crates.py get-version --from git)
pixi run python scripts/ci/crates.py version --exact $(pixi run python scripts/ci/crates.py get-version --from git)
fi
echo If this is a 'final', set the version to the final release version…
if [ ${{ inputs.release-type }} = "final" ]; then
python3 scripts/ci/crates.py version --exact $release_version
pixi run python scripts/ci/crates.py version --exact $release_version
fi
echo Store version after the update, and the expected "final" release version…
current=$(python3 scripts/ci/crates.py get-version)
final=$(python3 scripts/ci/crates.py get-version --finalize)
current=$(pixi run python scripts/ci/crates.py get-version)
final=$(pixi run python scripts/ci/crates.py get-version --finalize)
echo Output everything for use in other steps…
echo "previous=$previous" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -385,20 +375,10 @@ jobs:
with:
node-version: 18

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- uses: prefix-dev/[email protected]
with:
pixi-version: v0.19.0

- name: Install dependencies
shell: bash
run: |
python3 -m pip install -r scripts/ci/requirements-crates.txt
- name: Commit new version
shell: bash
run: |
Expand All @@ -409,9 +389,9 @@ jobs:
git pull --rebase
# bump version and commit it
python3 scripts/ci/crates.py version --bump auto
pixi run python scripts/ci/crates.py version --bump auto
pixi run toml-fmt
version="$(python3 scripts/ci/crates.py get-version)"
version="$(pixi run python scripts/ci/crates.py get-version)"
git commit -am "Bump versions to $version"
git push
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/reusable_build_and_upload_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,6 @@ jobs:
with:
pixi-version: v0.19.0

- name: Install dependencies
shell: bash
run: |
rustup target add ${{ needs.set-config.outputs.TARGET }}
pip install -r rerun_py/requirements-build.txt
pip install google-cloud-storage==2.9.0
- name: Get sha
id: get-sha
shell: bash
Expand All @@ -207,7 +200,7 @@ jobs:
- name: Build
shell: bash
run: |
python3 scripts/ci/build_and_upload_wheels.py \
pixi run python scripts/ci/build_and_upload_wheels.py \
--mode ${{ inputs.MODE }} \
--target ${{ needs.set-config.outputs.TARGET }} \
--dir commit/${{ steps.get-sha.outputs.sha }}/wheels \
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/reusable_pr_summary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ jobs:
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}

- name: Set up Python
uses: actions/setup-python@v5
- uses: prefix-dev/[email protected]
with:
python-version: 3.11
pixi-version: v0.18.0

- id: "auth"
uses: google-github-actions/auth@v2
Expand All @@ -47,14 +46,10 @@ jobs:
with:
version: ">= 363.0.0"

- name: Install deps
shell: bash
run: pip install google-cloud-storage Jinja2 PyGithub

- name: Render HTML template
shell: bash
run: |
python scripts/ci/generate_pr_summary.py \
pixi run python scripts/ci/generate_pr_summary.py \
--github-token ${{secrets.GITHUB_TOKEN}} \
--github-repository ${GITHUB_REPOSITORY} \
--pr-number ${{ inputs.PR_NUMBER }} \
Expand Down
Loading

0 comments on commit 97a45d3

Please sign in to comment.