Skip to content

Run ruff via uv tool run in acceptance tests and install Pythons in bump-sdk-post - #7389

Open
janniklasrose wants to merge 2 commits into
mainfrom
janniklasrose/ruff-via-uv
Open

janniklasrose wants to merge 2 commits into
mainfrom
janniklasrose/ruff-via-uv

Conversation

@janniklasrose

Copy link
Copy Markdown
Member

Changes

  • The acceptance harness no longer requires a ruff binary on PATH. RequireRuff becomes PrefetchRuff, which runs uv tool run ruff@0.9.1 --version so that release lands in the uv cache before the harness sets UV_OFFLINE. It runs in the test body rather than the prerequisites subtest, because a -run TestAccept/<dir> filter skips that subtest.
  • acceptance/bundle/templates/pydabs/check-formatting/script, the only test that uses ruff, runs uv tool run ruff@0.9.1 format ... offline from that cache. Its golden changes only in the two traced command lines.
  • bump-sdk-post runs install-pythons before generate-check and test-update, the same way the cloud tasks (integration, cloud-select, ...) already depend on it.
  • The bump-sdk skill text describes the new state.

Why

The SDK bumper's image has uv and Python 3.12 but no ruff. The global ruff prerequisite made test-update stop at TestAccept/prerequisites there, before touching a single golden, and generate-clijson-post ignores that error by design. That is why bumper PRs such as #7277 never refreshed acceptance/help/output.txt and a human had to add it by hand. Only one test directory (16 variants) ever ran ruff, and it does not run on DBR, so the suite-wide requirement was protecting one test at the cost of blocking the rest.

Once ruff no longer stops it, test-update in the bumper hits the next gap: the acceptance tests run uv offline, bundle tests pin UV_PYTHON=3.10, and integration_classic matrixes 3.9 through 3.13. With only Python 3.12 present, uv venv fails with "No interpreter found for Python 3.10 ... uv is set to offline mode", and -update would bake that into dozens of goldens. CI avoids this by running install-pythons in setup-build-environment; bump-sdk-post now does the same.

Whether the bumper pod can download the managed Pythons is not verified here. It reaches GitHub for cloning, which is where uv fetches them from; the next bumper PR will show it.

Follow-up: drop RuffDownloader from internal/testarchive and the ruff-action step from setup-build-environment. Both only existed to satisfy the global check.

Tests

  • go test ./acceptance -run TestAccept/bundle/templates/pydabs/check-formatting passes with a PATH that has uv but no ruff, mirroring the bumper image.
  • go test ./acceptance -run '^TestAccept$/prerequisites' passes without ruff on PATH.
  • Offline uv tool run ruff@0.9.1 hits the cache under the tests' UV_PYTHON=3.10 pin after a prefetch done with a different interpreter.
  • Reproduced the Python gap: with only a 3.12 interpreter reachable and UV_OFFLINE=true, uv venv with UV_PYTHON=3.10 fails as quoted above.
  • ./task lint-q, ./task ws, go vet ./acceptance/... are clean.

This pull request and its description were written by Isaac.

…ump-sdk-post

The acceptance harness required a `ruff` binary on PATH for every run, although
only the pydabs check-formatting test uses it. The SDK bumper's image has uv but
no ruff, so `test-update` there stopped at TestAccept/prerequisites and bumper
PRs never refreshed goldens such as acceptance/help/output.txt (#7277).

Run ruff through `uv tool run ruff@0.9.1` instead: the harness fetches that
release into the uv cache before it turns on UV_OFFLINE, and the test script
runs the same command offline from the cache. The prefetch lives in testAccept
rather than the prerequisites subtest, which a -run filter for a test directory
skips.

Once the ruff check no longer stops it, test-update in the bumper hits the next
gap: its image has only Python 3.12, while bundle tests pin 3.10 and one template
matrix needs 3.9-3.13, and uv is offline during tests. Run install-pythons at the
start of bump-sdk-post, as CI does in setup-build-environment, so a missing
interpreter is not baked into the goldens as a uv error.

Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions github-actions Bot added DABs DABs related issues PyDABs labels Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Commit: bc633bd4e | Workflow run

Regression test report

Selected 1 changed tests (limit=20, 0 not selected)

16 tests: regression=0 unreleased=0 coverage=16 failing=0
test branch main (663e1f7) latest (v1.24.0)
TestAccept/bundle/templates/pydabs/check-formatting/DMS=/INCLUDE_JOB=no/INCLUDE_PIPELINE=no/INCLUDE_PYTHON=no/SERVERLESS=no ✅ ✅ ✅
TestAccept/bundle/templates/pydabs/check-formatting/DMS=/INCLUDE_JOB=no/INCLUDE_PIPELINE=no/INCLUDE_PYTHON=no/SERVERLESS=yes ✅ ✅ ✅
TestAccept/bundle/templates/pydabs/check-formatting/DMS=/INCLUDE_JOB=no/INCLUDE_PIPELINE=no/INCLUDE_PYTHON=yes/SERVERLESS=no ✅ ✅ ✅
TestAccept/bundle/templates/pydabs/check-formatting/DMS=/INCLUDE_JOB=no/INCLUDE_PIPELINE=no/INCLUDE_PYTHON=yes/SERVERLESS=yes ✅ ✅ ✅
TestAccept/bundle/templates/pydabs/check-formatting/DMS=/INCLUDE_JOB=no/INCLUDE_PIPELINE=yes/INCLUDE_PYTHON=no/SERVERLESS=no ✅ ✅ ✅
TestAccept/bundle/templates/pydabs/check-formatting/DMS=/INCLUDE_JOB=no/INCLUDE_PIPELINE=yes/INCLUDE_PYTHON=no/SERVERLESS=yes ✅ ✅ ✅
TestAccept/bundle/templates/pydabs/check-formatting/DMS=/INCLUDE_JOB=no/INCLUDE_PIPELINE=yes/INCLUDE_PYTHON=yes/SERVERLESS=no ✅ ✅ ✅
TestAccept/bundle/templates/pydabs/check-formatting/DMS=/INCLUDE_JOB=no/INCLUDE_PIPELINE=yes/INCLUDE_PYTHON=yes/SERVERLESS=yes ✅ ✅ ✅
TestAccept/bundle/templates/pydabs/check-formatting/DMS=/INCLUDE_JOB=yes/INCLUDE_PIPELINE=no/INCLUDE_PYTHON=no/SERVERLESS=no ✅ ✅ ✅
TestAccept/bundle/templates/pydabs/check-formatting/DMS=/INCLUDE_JOB=yes/INCLUDE_PIPELINE=no/INCLUDE_PYTHON=no/SERVERLESS=yes ✅ ✅ ✅
TestAccept/bundle/templates/pydabs/check-formatting/DMS=/INCLUDE_JOB=yes/INCLUDE_PIPELINE=no/INCLUDE_PYTHON=yes/SERVERLESS=no ✅ ✅ ✅
TestAccept/bundle/templates/pydabs/check-formatting/DMS=/INCLUDE_JOB=yes/INCLUDE_PIPELINE=no/INCLUDE_PYTHON=yes/SERVERLESS=yes ✅ ✅ ✅
TestAccept/bundle/templates/pydabs/check-formatting/DMS=/INCLUDE_JOB=yes/INCLUDE_PIPELINE=yes/INCLUDE_PYTHON=no/SERVERLESS=no ✅ ✅ ✅
TestAccept/bundle/templates/pydabs/check-formatting/DMS=/INCLUDE_JOB=yes/INCLUDE_PIPELINE=yes/INCLUDE_PYTHON=no/SERVERLESS=yes ✅ ✅ ✅
TestAccept/bundle/templates/pydabs/check-formatting/DMS=/INCLUDE_JOB=yes/INCLUDE_PIPELINE=yes/INCLUDE_PYTHON=yes/SERVERLESS=no ✅ ✅ ✅
TestAccept/bundle/templates/pydabs/check-formatting/DMS=/INCLUDE_JOB=yes/INCLUDE_PIPELINE=yes/INCLUDE_PYTHON=yes/SERVERLESS=yes ✅ ✅ ✅

CI's setup-uv exports UV_CACHE_DIR, so the ruff prefetch filled that cache
while the harness pinned test scripts to the HOME-derived default: every
check-formatting variant failed with "ruff was not found in the cache". Ask uv
for its cache directory (as getUVPythonInstallDir already does for the Python
install dir) instead of deriving the default from HOME.

Pass -q to uv in the check-formatting script: the first variant to build the
tool environment for the test interpreter otherwise prints "Installed 1 package"
to stderr, which the other variants do not.

Co-authored-by: Isaac <no-reply@databricks.com>
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: bc633bd

Run: 42225524027

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 271 16 3:24
✅​ aws-windows-latest-4core-16gb 273 14 2:31
✅​ azure linux-2core-8gb 270 16 3:38
✅​ azure-windows-latest-4core-16gb 272 14 2:21
✅​ gcp linux-2core-8gb 271 16 3:43
✅​ gcp-windows-latest-4core-16gb 273 14 2:30

@janniklasrose
janniklasrose requested a review from pietern November 6, 2026 13:32
@janniklasrose
janniklasrose marked this pull request as ready for review November 6, 2026 13:32
@janniklasrose
janniklasrose requested review from a team as code owners November 6, 2026 13:32

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues PyDABs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants