name: Python - Dev Dependency Upgrade on: workflow_dispatch: permissions: contents: write pull-requests: write env: UV_CACHE_DIR: /tmp/.uv-cache jobs: upgrade-dev-dependencies: name: Upgrade Dev Dependencies runs-on: ubuntu-latest env: UV_PYTHON: "3.13" GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - name: Set up python and install the project uses: ./.github/actions/python-setup with: python-version: ${{ env.UV_PYTHON }} os: ${{ runner.os }} env: UV_CACHE_DIR: /tmp/.uv-cache - name: Upgrade dev dependencies and validate workspace run: uv run poe upgrade-dev-dependencies working-directory: ./python - name: Commit and push dev dependency updates id: commit_updates run: | BRANCH="automation/python-dev-dependency-updates" git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git checkout -B "${BRANCH}" git add python/pyproject.toml python/packages/*/pyproject.toml python/uv.lock if git diff --cached --quiet; then echo "has_changes=false" >> "$GITHUB_OUTPUT" echo "No dev dependency updates to commit." exit 0 fi git commit -F- <<'EOF' Python: chore: upgrade dev dependencies EOF git push --force-with-lease --set-upstream origin "${BRANCH}" echo "has_changes=true" >> "$GITHUB_OUTPUT" - name: Create or update pull request with GitHub CLI if: steps.commit_updates.outputs.has_changes == 'true' run: | BRANCH="automation/python-dev-dependency-updates" PR_TITLE="Python: chore: upgrade dev dependencies" PR_BODY_FILE="$(mktemp)" cat > "${PR_BODY_FILE}" <<'EOF' ### Motivation and Context This automated update refreshes Python dev dependency pins across the workspace and reruns the repo validation gates before opening a pull request. ### Description - Ran `uv run poe upgrade-dev-dependencies` - Refreshed dev dependency pins in workspace `pyproject.toml` files - Refreshed `python/uv.lock` with `uv lock --upgrade` - Reinstalled from the frozen lockfile and reran `check`, `typing`, and `test` ### Contribution Checklist - [x] The code builds clean without any errors or warnings - [x] The PR follows the [Contribution Guidelines](https://github.com/microsoft/agent-framework/blob/main/CONTRIBUTING.md) - [x] All unit tests pass, and I have added new tests where possible - [ ] **Is this a breaking change?** If yes, add "[BREAKING]" prefix to the title of the PR. EOF PR_NUMBER="$(gh pr list --head "${BRANCH}" --base main --state open --json number --jq '.[0].number')" if [ -n "${PR_NUMBER}" ]; then gh pr edit "${PR_NUMBER}" --title "${PR_TITLE}" --body-file "${PR_BODY_FILE}" else gh pr create --base main --head "${BRANCH}" --title "${PR_TITLE}" --body-file "${PR_BODY_FILE}" fi