From d1fc2ee33863071aa03c6679595d554d67246258 Mon Sep 17 00:00:00 2001 From: Saurav Maheshkar Date: Mon, 8 Apr 2024 23:46:00 +0100 Subject: [PATCH] feat(ci): migrate to `uv` in CI (#3038) * feat(ci): migrate to `uv` in CI * feat(ci): drop upgrade strategy * feat(ci): use `uv` in docs workflow * fix(ci/doc): update sphinx build cmd * fix(ci/doc): specify python path * (experimental) simplify * remove venv * Revert line wrap change for doc.yml --------- Co-authored-by: Brent Yi --- .github/workflows/core_code_checks.yml | 9 ++++++--- .github/workflows/doc.yml | 3 ++- nerfstudio/scripts/github/run_actions.py | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/core_code_checks.yml b/.github/workflows/core_code_checks.yml index 556432bfc..35ed0f1ca 100644 --- a/.github/workflows/core_code_checks.yml +++ b/.github/workflows/core_code_checks.yml @@ -25,7 +25,8 @@ jobs: key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }} - name: Install dependencies run: | - pip install --upgrade --upgrade-strategy eager -e .[dev] + pip install uv + uv pip install --system --upgrade -e .[dev] - name: Run license checks run: | ./nerfstudio/scripts/licensing/license_headers.sh --check @@ -33,9 +34,11 @@ jobs: run: | python ./nerfstudio/scripts/docs/add_nb_tags.py --check - name: Run Ruff Linter - run: ruff check docs/ nerfstudio/ tests/ --output-format=github + run: | + ruff check docs/ nerfstudio/ tests/ --output-format=github - name: Run Ruff Formatter - run: ruff format docs/ nerfstudio/ tests/ --diff + run: | + ruff format docs/ nerfstudio/ tests/ --diff - name: Run Pyright run: | pyright diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 7b46b3429..d2637429c 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -18,7 +18,8 @@ jobs: python-version: '3.9' - name: Install dependencies run: | - pip install .[docs] + pip install uv + uv pip install --system .[docs] - name: Sphinx build # fail on warnings run: | diff --git a/nerfstudio/scripts/github/run_actions.py b/nerfstudio/scripts/github/run_actions.py index c758d23b6..2fa3aa54c 100644 --- a/nerfstudio/scripts/github/run_actions.py +++ b/nerfstudio/scripts/github/run_actions.py @@ -59,7 +59,7 @@ def run_github_actions_file(filename: str, continue_on_fail: bool = False): curr_command = step["run"].replace("\n", ";").replace("\\", "") if curr_command.startswith("ruff"): if "ruff check" in curr_command: - curr_command = f"{curr_command} --fix" + curr_command = curr_command.replace("ruff check", "ruff check --fix") curr_command = curr_command.replace(" --check", "") curr_command = curr_command.replace(" --diff", "")