From 9462e4dd5e20c7c648cf5e58fb442734cf34afb8 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 13 Aug 2026 08:54:17 -0500 Subject: [PATCH 1/3] PYTHON-5956 Use shared python/setup action for CI setup Replaces the uv, just, and dependency-install steps that eight jobs each carried with the shared drivers-github-tools action. TESTING ONLY: pinned to a fork SHA of the action so this can run before the action lands upstream. Repoint at mongodb-labs/...@v3 before merging. The static job still installs separately, because its lock check has to run before the install. Jobs that never use just, or that let a just recipe handle their own dependencies, pass run-install: false. The build job allows prereleases, which its beta Python needs now that Python comes from setup-python rather than uv. --- .github/workflows/test-python.yml | 74 ++++++++++++------------------- 1 file changed, 29 insertions(+), 45 deletions(-) diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index f665c5c694..5d7437c3c3 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -25,18 +25,18 @@ jobs: - uses: actions/checkout@v7.0.1 with: persist-credentials: false - - name: Install uv - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + - name: Install Python tooling + uses: blink1073/drivers-github-tools/python/setup@b4f2bf29dec7a1ff0ea1b0b4b7837feb1d966309 with: - enable-cache: true python-version: "3.10" + # The lock check has to run before the install, so this job installs + # separately rather than letting the action do it. + run-install: "false" # Runs before the install so a stale lock fails in seconds rather than # after the build and typecheck. - name: Check lockfile is up to date run: | uv lock --check - - name: Install just - run: uv tool install rust-just - name: Install Python dependencies run: | just install @@ -82,11 +82,15 @@ jobs: - uses: actions/checkout@v7.0.1 with: persist-credentials: false - - name: Install uv - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + - name: Install Python tooling + uses: blink1073/drivers-github-tools/python/setup@b4f2bf29dec7a1ff0ea1b0b4b7837feb1d966309 with: - enable-cache: true python-version: ${{ matrix.python-version }} + # The matrix covers a Python still in beta, which setup-python will + # not select without this. + allow-prereleases: "true" + # This job runs pytest through `uv run`, and never uses just. + run-install: "false" - id: setup-mongodb uses: mongodb-labs/drivers-evergreen-tools@master with: @@ -104,17 +108,16 @@ jobs: - uses: actions/checkout@v7.0.1 with: persist-credentials: false - - name: Install uv - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + - name: Install Python tooling + uses: blink1073/drivers-github-tools/python/setup@b4f2bf29dec7a1ff0ea1b0b4b7837feb1d966309 with: - enable-cache: true python-version: "3.10" + # `just setup-tests` handles its own dependencies here. + run-install: "false" - id: setup-mongodb uses: mongodb-labs/drivers-evergreen-tools@master with: version: "8.0" - - name: Install just - run: uv tool install rust-just - name: Setup tests run: COVERAGE=1 just setup-tests - name: Run tests @@ -132,19 +135,14 @@ jobs: - uses: actions/checkout@v7.0.1 with: persist-credentials: false - - name: Install uv - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + - name: Install Python tooling + uses: blink1073/drivers-github-tools/python/setup@b4f2bf29dec7a1ff0ea1b0b4b7837feb1d966309 with: - enable-cache: true python-version: "3.10" - - name: Install just - run: uv tool install rust-just - id: setup-mongodb uses: mongodb-labs/drivers-evergreen-tools@master with: version: "8.0" - - name: Install dependencies - run: just install - name: Run tests run: | just setup-tests doctest @@ -157,15 +155,10 @@ jobs: - uses: actions/checkout@v7.0.1 with: persist-credentials: false - - name: Install uv - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + - name: Install Python tooling + uses: blink1073/drivers-github-tools/python/setup@b4f2bf29dec7a1ff0ea1b0b4b7837feb1d966309 with: - enable-cache: true python-version: "3.10" - - name: Install just - run: uv tool install rust-just - - name: Install dependencies - run: just install - name: Build docs run: just docs @@ -179,16 +172,10 @@ jobs: - uses: actions/checkout@v7.0.1 with: persist-credentials: false - - name: Install uv - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + - name: Install Python tooling + uses: blink1073/drivers-github-tools/python/setup@b4f2bf29dec7a1ff0ea1b0b4b7837feb1d966309 with: - enable-cache: true python-version: "${{matrix.python}}" - - name: Install just - run: uv tool install rust-just - - name: Install dependencies - run: | - just install - name: Run typecheck run: | just typing @@ -200,16 +187,10 @@ jobs: - uses: actions/checkout@v7.0.1 with: persist-credentials: false - - name: Install uv - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + - name: Install Python tooling + uses: blink1073/drivers-github-tools/python/setup@b4f2bf29dec7a1ff0ea1b0b4b7837feb1d966309 with: - enable-cache: true python-version: "3.10" - - name: Install just - run: uv tool install rust-just - - name: Install dependencies - run: | - just install - id: setup-mongodb uses: mongodb-labs/drivers-evergreen-tools@master - name: Run tests @@ -290,10 +271,13 @@ jobs: - uses: actions/checkout@v7.0.1 with: persist-credentials: false - - name: Install uv - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + - name: Install Python tooling + uses: blink1073/drivers-github-tools/python/setup@b4f2bf29dec7a1ff0ea1b0b4b7837feb1d966309 with: python-version: "3.9" + # This job builds its own venv with `uv pip install`, and never + # uses just. + run-install: "false" - id: setup-mongodb uses: mongodb-labs/drivers-evergreen-tools@master with: From ba7c636b5cede84cd7d53e07f6342abc34788888 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 13 Aug 2026 11:02:19 -0500 Subject: [PATCH 2/3] Rely on the action's prerelease default allow-prereleases now defaults to true in the action, so the build job no longer passes it. Repoints at the action commit that drops exclude-newer, so this run exercises the version being merged. --- .github/workflows/test-python.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index 5d7437c3c3..2903124983 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -26,7 +26,7 @@ jobs: with: persist-credentials: false - name: Install Python tooling - uses: blink1073/drivers-github-tools/python/setup@b4f2bf29dec7a1ff0ea1b0b4b7837feb1d966309 + uses: blink1073/drivers-github-tools/python/setup@f513d3cb3a1e6acf40e94ca82ddc336c13d49dbb with: python-version: "3.10" # The lock check has to run before the install, so this job installs @@ -83,12 +83,11 @@ jobs: with: persist-credentials: false - name: Install Python tooling - uses: blink1073/drivers-github-tools/python/setup@b4f2bf29dec7a1ff0ea1b0b4b7837feb1d966309 + uses: blink1073/drivers-github-tools/python/setup@f513d3cb3a1e6acf40e94ca82ddc336c13d49dbb with: + # The action allows prereleases by default, which the beta Python in + # this matrix needs. python-version: ${{ matrix.python-version }} - # The matrix covers a Python still in beta, which setup-python will - # not select without this. - allow-prereleases: "true" # This job runs pytest through `uv run`, and never uses just. run-install: "false" - id: setup-mongodb @@ -109,7 +108,7 @@ jobs: with: persist-credentials: false - name: Install Python tooling - uses: blink1073/drivers-github-tools/python/setup@b4f2bf29dec7a1ff0ea1b0b4b7837feb1d966309 + uses: blink1073/drivers-github-tools/python/setup@f513d3cb3a1e6acf40e94ca82ddc336c13d49dbb with: python-version: "3.10" # `just setup-tests` handles its own dependencies here. @@ -136,7 +135,7 @@ jobs: with: persist-credentials: false - name: Install Python tooling - uses: blink1073/drivers-github-tools/python/setup@b4f2bf29dec7a1ff0ea1b0b4b7837feb1d966309 + uses: blink1073/drivers-github-tools/python/setup@f513d3cb3a1e6acf40e94ca82ddc336c13d49dbb with: python-version: "3.10" - id: setup-mongodb @@ -156,7 +155,7 @@ jobs: with: persist-credentials: false - name: Install Python tooling - uses: blink1073/drivers-github-tools/python/setup@b4f2bf29dec7a1ff0ea1b0b4b7837feb1d966309 + uses: blink1073/drivers-github-tools/python/setup@f513d3cb3a1e6acf40e94ca82ddc336c13d49dbb with: python-version: "3.10" - name: Build docs @@ -173,7 +172,7 @@ jobs: with: persist-credentials: false - name: Install Python tooling - uses: blink1073/drivers-github-tools/python/setup@b4f2bf29dec7a1ff0ea1b0b4b7837feb1d966309 + uses: blink1073/drivers-github-tools/python/setup@f513d3cb3a1e6acf40e94ca82ddc336c13d49dbb with: python-version: "${{matrix.python}}" - name: Run typecheck @@ -188,7 +187,7 @@ jobs: with: persist-credentials: false - name: Install Python tooling - uses: blink1073/drivers-github-tools/python/setup@b4f2bf29dec7a1ff0ea1b0b4b7837feb1d966309 + uses: blink1073/drivers-github-tools/python/setup@f513d3cb3a1e6acf40e94ca82ddc336c13d49dbb with: python-version: "3.10" - id: setup-mongodb @@ -272,7 +271,7 @@ jobs: with: persist-credentials: false - name: Install Python tooling - uses: blink1073/drivers-github-tools/python/setup@b4f2bf29dec7a1ff0ea1b0b4b7837feb1d966309 + uses: blink1073/drivers-github-tools/python/setup@f513d3cb3a1e6acf40e94ca82ddc336c13d49dbb with: python-version: "3.9" # This job builds its own venv with `uv pip install`, and never From a50d4594ba6383cad249598b427634c7aa268f65 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 14 Aug 2026 17:10:46 -0500 Subject: [PATCH 3/3] Opt in to the action's dependency install run-install is off by default now, so the four jobs that need project dependencies ask for them and the four that do not say nothing. Repoints at the action commit that made the switch. --- .github/workflows/test-python.yml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index 2903124983..ecf96ba89b 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -26,12 +26,9 @@ jobs: with: persist-credentials: false - name: Install Python tooling - uses: blink1073/drivers-github-tools/python/setup@f513d3cb3a1e6acf40e94ca82ddc336c13d49dbb + uses: blink1073/drivers-github-tools/python/setup@da9b1e22992959ae8cc60d34d6a0eda3fdd31911 with: python-version: "3.10" - # The lock check has to run before the install, so this job installs - # separately rather than letting the action do it. - run-install: "false" # Runs before the install so a stale lock fails in seconds rather than # after the build and typecheck. - name: Check lockfile is up to date @@ -83,13 +80,11 @@ jobs: with: persist-credentials: false - name: Install Python tooling - uses: blink1073/drivers-github-tools/python/setup@f513d3cb3a1e6acf40e94ca82ddc336c13d49dbb + uses: blink1073/drivers-github-tools/python/setup@da9b1e22992959ae8cc60d34d6a0eda3fdd31911 with: # The action allows prereleases by default, which the beta Python in # this matrix needs. python-version: ${{ matrix.python-version }} - # This job runs pytest through `uv run`, and never uses just. - run-install: "false" - id: setup-mongodb uses: mongodb-labs/drivers-evergreen-tools@master with: @@ -108,11 +103,9 @@ jobs: with: persist-credentials: false - name: Install Python tooling - uses: blink1073/drivers-github-tools/python/setup@f513d3cb3a1e6acf40e94ca82ddc336c13d49dbb + uses: blink1073/drivers-github-tools/python/setup@da9b1e22992959ae8cc60d34d6a0eda3fdd31911 with: python-version: "3.10" - # `just setup-tests` handles its own dependencies here. - run-install: "false" - id: setup-mongodb uses: mongodb-labs/drivers-evergreen-tools@master with: @@ -135,9 +128,10 @@ jobs: with: persist-credentials: false - name: Install Python tooling - uses: blink1073/drivers-github-tools/python/setup@f513d3cb3a1e6acf40e94ca82ddc336c13d49dbb + uses: blink1073/drivers-github-tools/python/setup@da9b1e22992959ae8cc60d34d6a0eda3fdd31911 with: python-version: "3.10" + run-install: "true" - id: setup-mongodb uses: mongodb-labs/drivers-evergreen-tools@master with: @@ -155,9 +149,10 @@ jobs: with: persist-credentials: false - name: Install Python tooling - uses: blink1073/drivers-github-tools/python/setup@f513d3cb3a1e6acf40e94ca82ddc336c13d49dbb + uses: blink1073/drivers-github-tools/python/setup@da9b1e22992959ae8cc60d34d6a0eda3fdd31911 with: python-version: "3.10" + run-install: "true" - name: Build docs run: just docs @@ -172,9 +167,10 @@ jobs: with: persist-credentials: false - name: Install Python tooling - uses: blink1073/drivers-github-tools/python/setup@f513d3cb3a1e6acf40e94ca82ddc336c13d49dbb + uses: blink1073/drivers-github-tools/python/setup@da9b1e22992959ae8cc60d34d6a0eda3fdd31911 with: python-version: "${{matrix.python}}" + run-install: "true" - name: Run typecheck run: | just typing @@ -187,9 +183,10 @@ jobs: with: persist-credentials: false - name: Install Python tooling - uses: blink1073/drivers-github-tools/python/setup@f513d3cb3a1e6acf40e94ca82ddc336c13d49dbb + uses: blink1073/drivers-github-tools/python/setup@da9b1e22992959ae8cc60d34d6a0eda3fdd31911 with: python-version: "3.10" + run-install: "true" - id: setup-mongodb uses: mongodb-labs/drivers-evergreen-tools@master - name: Run tests @@ -271,12 +268,9 @@ jobs: with: persist-credentials: false - name: Install Python tooling - uses: blink1073/drivers-github-tools/python/setup@f513d3cb3a1e6acf40e94ca82ddc336c13d49dbb + uses: blink1073/drivers-github-tools/python/setup@da9b1e22992959ae8cc60d34d6a0eda3fdd31911 with: python-version: "3.9" - # This job builds its own venv with `uv pip install`, and never - # uses just. - run-install: "false" - id: setup-mongodb uses: mongodb-labs/drivers-evergreen-tools@master with: