chore: extract reusable uv_setup composite action (#7262)

Extract a composite GitHub Action for Python + uv setup, replacing 12
scattered `astral-sh/setup-uv@v7` calls with a single reusable
`uv_setup` action that scopes cache dependency globs per library. Also
tightens issue template language and fixes a broken expression in the
release-test workflow.

## Changes

- Add `.github/actions/uv_setup/action.yml` — composite action wrapping
`astral-sh/setup-uv@v7` with a `working-directory` input that scopes
`cache-dependency-glob` to `<dir>/pyproject.toml`, `<dir>/uv.lock`, and
`<dir>/requirements*.txt`
- Migrate all workflow files (`_test.yml`, `_lint.yml`,
`_test_langgraph.yml`, `_integration_test.yml`, `baseline.yml`,
`bench.yml`, `ci.yml`, `release.yml`, `_test_release.yml`,
`uv_lock_ugprade.yml`) from inline `astral-sh/setup-uv@v7` to
`./.github/actions/uv_setup`, passing library-specific
`working-directory` for cache scoping
- Fix typo in `_test_release.yml` step name: `$${ env.PYTHON_VERSION }}`
→ `${{ env.PYTHON_VERSION }}`
- Disable uv cache for the release smoke-test job (`enable-cache:
false`) since it installs from PyPI, not the local lockfile
- Update `config.yml` API reference URL to point to `/python/langgraph/`
instead of `/python/`
- Tighten `privileged.yml` — shorter description, add English language
policy link, add "do not begin work unless assigned" notice
This commit is contained in:
Mason Daugherty
2026-03-24 00:25:58 -04:00
committed by GitHub
parent c8c1b71db0
commit 11f4d3339f
13 changed files with 71 additions and 39 deletions
+2 -3
View File
@@ -46,12 +46,11 @@ jobs:
filter: "libs/cli/**"
- name: Set up Python ${{ matrix.python-version }}
if: (steps.changed-files.outputs.all || github.event_name == 'workflow_dispatch')
uses: astral-sh/setup-uv@v7
uses: ./.github/actions/uv_setup
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-suffix: "cli-integration-test"
ignore-nothing-to-cache: true
working-directory: libs/cli
- name: Install cli globally
if: (steps.changed-files.outputs.all || github.event_name == 'workflow_dispatch')
run: pip install -e .
+2 -2
View File
@@ -40,11 +40,11 @@ jobs:
filter: "${{ inputs.working-directory }}/**"
- name: Set up Python ${{ matrix.python-version }}
if: steps.changed-files.outputs.all || github.event_name == 'workflow_dispatch'
uses: astral-sh/setup-uv@v7
uses: ./.github/actions/uv_setup
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-suffix: lint-${{ inputs.working-directory }}
working-directory: ${{ inputs.working-directory }}
- name: Install dependencies
if: steps.changed-files.outputs.all || github.event_name == 'workflow_dispatch'
+2 -2
View File
@@ -27,11 +27,11 @@ jobs:
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v7
uses: ./.github/actions/uv_setup
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-suffix: test-${{ inputs.working-directory }}
working-directory: ${{ inputs.working-directory }}
- name: Login to Docker Hub
uses: docker/login-action@v4
if: ${{ !github.event.pull_request.head.repo.fork }}
+2 -2
View File
@@ -25,11 +25,11 @@ jobs:
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v7
uses: ./.github/actions/uv_setup
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-suffix: "test-langgraph"
working-directory: libs/langgraph
- name: Login to Docker Hub
uses: docker/login-action@v4
if: ${{ !github.event.pull_request.head.repo.fork }}
+3 -3
View File
@@ -25,12 +25,12 @@ jobs:
steps:
- uses: actions/checkout@v6
- name: Set up Python $${ env.PYTHON_VERSION }}
uses: astral-sh/setup-uv@v7
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: ./.github/actions/uv_setup
with:
python-version: ${{ env.PYTHON_VERSION }}
enable-cache: true
cache-suffix: "release"
working-directory: ${{ inputs.working-directory }}
# We want to keep this build stage *separate* from the release stage,
# so that there's no sharing of permissions between them.
+2 -2
View File
@@ -20,11 +20,11 @@ jobs:
- uses: actions/checkout@v6
- run: SHA=$(git rev-parse HEAD) && echo "SHA=$SHA" >> $GITHUB_ENV
- name: Set up Python 3.11
uses: astral-sh/setup-uv@v7
uses: ./.github/actions/uv_setup
with:
python-version: "3.11"
enable-cache: true
cache-suffix: "bench"
working-directory: libs/langgraph
- name: Install dependencies
run: uv sync --group test
- name: Run benchmarks
+2 -2
View File
@@ -22,11 +22,11 @@ jobs:
with:
format: json
- name: Set up Python 3.11
uses: astral-sh/setup-uv@v7
uses: ./.github/actions/uv_setup
with:
python-version: "3.11"
enable-cache: true
cache-suffix: "bench"
working-directory: libs/langgraph
- name: Install dependencies
run: uv sync --group test
- name: Download baseline
+2 -2
View File
@@ -125,11 +125,11 @@ jobs:
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v7
uses: ./.github/actions/uv_setup
with:
python-version: "3.13"
enable-cache: true
cache-suffix: "schema-check-cli"
working-directory: libs/cli
- name: Install CLI dependencies
run: |
cd libs/cli
+9 -8
View File
@@ -28,11 +28,11 @@ jobs:
- uses: actions/checkout@v6
- name: Set up Python
uses: astral-sh/setup-uv@v7
uses: ./.github/actions/uv_setup
with:
python-version: ${{ env.PYTHON_VERSION }}
enable-cache: true
cache-suffix: "release"
working-directory: ${{ inputs.working-directory }}
# We want to keep this build stage *separate* from the release stage,
# so that there's no sharing of permissions between them.
@@ -173,10 +173,11 @@ jobs:
# used in the real world.
- name: Set up Python
uses: astral-sh/setup-uv@v7
uses: ./.github/actions/uv_setup
with:
python-version: ${{ env.PYTHON_VERSION }}
enable-cache: true
enable-cache: false
working-directory: ${{ inputs.working-directory }}
- name: Import published package
shell: bash
@@ -263,11 +264,11 @@ jobs:
- uses: actions/checkout@v6
- name: Set up Python
uses: astral-sh/setup-uv@v7
uses: ./.github/actions/uv_setup
with:
python-version: ${{ env.PYTHON_VERSION }}
enable-cache: true
cache-suffix: "release"
working-directory: ${{ inputs.working-directory }}
- uses: actions/download-artifact@v8
with:
@@ -304,11 +305,11 @@ jobs:
- uses: actions/checkout@v6
- name: Set up Python
uses: astral-sh/setup-uv@v7
uses: ./.github/actions/uv_setup
with:
python-version: ${{ env.PYTHON_VERSION }}
enable-cache: true
cache-suffix: "release"
working-directory: ${{ inputs.working-directory }}
- uses: actions/download-artifact@v8
with:
+1 -3
View File
@@ -19,11 +19,9 @@ jobs:
- uses: actions/checkout@v6
- name: Set up uv
uses: astral-sh/setup-uv@v7
uses: ./.github/actions/uv_setup
with:
# use minimum supported Python version
python-version: "3.10"
enable-cache: true
cache-suffix: "uv-lock-upgrade"
- name: Run uv lock --upgrade in all Python packages