From dea3f8f5b0aa6af6f84fcc8e2032432e238a062a Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Fri, 31 Oct 2025 07:07:06 -0700 Subject: [PATCH] fix: handle missing type_checking group on release-0.3.x The release branch doesn't have the type_checking dependency group yet. Check if it exists and fall back to dev-only if not found. --- .github/workflows/pre-commit.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 6b03eb778..119567437 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -137,13 +137,22 @@ jobs: id: client-config uses: ./.github/actions/install-llama-stack-client - - name: Sync dev + type_checking dependencies + - name: Sync dev dependencies for mypy env: UV_INDEX_URL: ${{ steps.client-config.outputs.uv-index-url }} UV_EXTRA_INDEX_URL: ${{ steps.client-config.outputs.uv-extra-index-url }} UV_INDEX_STRATEGY: ${{ steps.client-config.outputs.uv-index-url && 'unsafe-best-match' || '' }} run: | - uv sync --group dev --group type_checking + # Check if type_checking group exists, otherwise just use dev + if grep -q "type.checking" pyproject.toml; then + echo "Found type_checking group, syncing with both groups" + uv sync --group dev --group type_checking + MYPY_CMD="uv run --group dev --group type_checking mypy" + else + echo "No type_checking group found, syncing with dev only" + uv sync --group dev + MYPY_CMD="uv run --group dev mypy" + fi # Install specific client version after sync if needed if [ "${{ steps.client-config.outputs.install-after-sync }}" = "true" ]; then @@ -151,10 +160,12 @@ jobs: uv pip install ${{ steps.client-config.outputs.install-source }} fi - - name: Run mypy (full type_checking) + echo "MYPY_CMD=$MYPY_CMD" >> $GITHUB_ENV + + - name: Run mypy (full type checking) run: | set +e - uv run --group dev --group type_checking mypy + $MYPY_CMD status=$? if [ $status -ne 0 ]; then echo "::error::Full mypy failed. Reproduce locally with 'uv run pre-commit run mypy-full --hook-stage manual --all-files'."