From 42d1ee111dfd7146ea63a8f5702c5ce88dccf633 Mon Sep 17 00:00:00 2001 From: Wei Lu Date: Mon, 12 Oct 2026 14:21:29 -0700 Subject: [PATCH] python(fix): install docs dependencies from uv.lock --- .github/actions/python-mike-delete/action.yml | 10 +++++----- .github/actions/python-mike-deploy/action.yml | 8 ++++---- .github/workflows/python_build_docs.yml | 5 +++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/actions/python-mike-delete/action.yml b/.github/actions/python-mike-delete/action.yml index d217aa7ef1..2de44e705d 100644 --- a/.github/actions/python-mike-delete/action.yml +++ b/.github/actions/python-mike-delete/action.yml @@ -10,15 +10,15 @@ runs: using: composite steps: - name: Set up Python - uses: actions/setup-python@v5 + uses: astral-sh/setup-uv@v6 with: - python-version: '3.11' + enable-cache: true - name: Install docs dependencies shell: bash run: | cd python - pip install -e .[docs-build] + uv sync --frozen --python 3.11 --extra docs-build - name: Fetch gh-pages branch shell: bash @@ -37,8 +37,8 @@ runs: run: | cd python echo "Deleting docs for: $VERSION" - if mike list | grep -q "$VERSION"; then - mike delete "$VERSION" --push + if uv run --no-sync mike list | grep -q "$VERSION"; then + uv run --no-sync mike delete "$VERSION" --push echo "Successfully deleted docs for $VERSION" else echo "No docs found for $VERSION, nothing to delete" diff --git a/.github/actions/python-mike-deploy/action.yml b/.github/actions/python-mike-deploy/action.yml index 9a6a89e7b2..b34f1a642c 100644 --- a/.github/actions/python-mike-deploy/action.yml +++ b/.github/actions/python-mike-deploy/action.yml @@ -18,15 +18,15 @@ runs: using: composite steps: - name: Set up Python - uses: actions/setup-python@v5 + uses: astral-sh/setup-uv@v6 with: - python-version: '3.11' + enable-cache: true - name: Install docs dependencies shell: bash run: | cd python - pip install -e .[docs-build] + uv sync --frozen --python 3.11 --extra docs-build - name: Fetch gh-pages branch shell: bash @@ -64,4 +64,4 @@ runs: MIKE_ARGS+=(--push --update-aliases --prop-set "hidden=$HIDDEN") echo "Running: mike deploy ${MIKE_ARGS[*]}" - mike deploy "${MIKE_ARGS[@]}" + uv run --no-sync mike deploy "${MIKE_ARGS[@]}" diff --git a/.github/workflows/python_build_docs.yml b/.github/workflows/python_build_docs.yml index ea7b8013d1..a19a2424ea 100644 --- a/.github/workflows/python_build_docs.yml +++ b/.github/workflows/python_build_docs.yml @@ -4,6 +4,7 @@ on: pull_request: types: [ opened, synchronize, closed ] paths: + - '.github/actions/python-mike-*/**' - 'python/docs/**' - 'python/lib/**' - 'python/mkdocs.yml' @@ -34,7 +35,7 @@ jobs: run: | # Use commit hash as version for dev deployments VERSION=$(git rev-parse --short HEAD) - + if [[ "${{ github.event_name }}" == "pull_request" ]]; then # Use PR number as alias for PR deployments ALIAS="pr-${{ github.event.number }}" @@ -42,7 +43,7 @@ jobs: # Use 'dev' for manual workflow dispatch ALIAS="dev" fi - + echo "version=$VERSION" >> $GITHUB_OUTPUT echo "alias=$ALIAS" >> $GITHUB_OUTPUT echo "Dev deployment - Version: $VERSION, Alias: $ALIAS"