Skip to content

fix(ci): install test requirements with hatch's uv - #308

Merged
wyongzhi merged 1 commit into
aws-deadline:mainlinefrom
wyongzhi:fix/ci-hatch-uv
Oct 26, 2026
Merged

wyongzhi merged 1 commit into
aws-deadline:mainlinefrom
wyongzhi:fix/ci-hatch-uv

Conversation

@wyongzhi

Copy link
Copy Markdown
Contributor

What was the problem/requirement? (What/Why)

hatch run test fails in CI since aws-deadline/.github#125. The shared workflow now exports HATCH_ENV_TYPE_VIRTUAL_UV_PATH, so hatch builds its environments with uv. A uv-built env has no pip, so the bare pip install -r requirements-testing.txt in pre-install-commands resolves to the system pip and installs the test requirements into the wrong interpreter. The system pytest then runs without the deadline package:

INTERNALERROR> ModuleNotFoundError: No module named 'deadline'

Same failure on #305 (dependabot) and #306.

What was the solution? (How)

Use {env:HATCH_UV} pip install in pre-install-commands and sync for the default, integ and integ-ci envs. HATCH_UV is set by hatch for both uv- and virtualenv-backed envs. Same fix as aws-deadline/deadline-cloud-worker-agent#1114.

What is the impact of this change?

CI only. No source or behaviour change.

How was this change tested?

Locally with a fresh hatch env, both ways:

  • HATCH_ENV_TYPE_VIRTUAL_UV_PATH=$(which uv) hatch run test on mainline reproduces the INTERNALERROR (pytest loaded from the system site-packages). With this change: 480 passed, pytest resolved from inside the hatch env.
  • Plain hatch run test (virtualenv-backed): 480 passed.

Was this change documented?

No, CI-internal.

Did you modify schema files?

  • Yes
  • No

Is this a breaking change?

No.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

When hatch builds the environment with uv (HATCH_ENV_TYPE_VIRTUAL_UV_PATH
is set by the shared CI workflow), the env has no pip, so the bare
`pip install -r requirements-testing.txt` in pre-install-commands runs
against the interpreter outside the env. Test requirements then land in the
wrong site-packages and `hatch run test` fails with
`ModuleNotFoundError: No module named 'deadline'`.

Use `{env:HATCH_UV} pip install` instead, which works whether the env was
built with uv or virtualenv. Same change as deadline-cloud-worker-agent.

Signed-off-by: wyongzhi <276409147+wyongzhi@users.noreply.github.com>
@wyongzhi
wyongzhi requested a review from a team as a code owner October 26, 2026 19:40
@github-actions github-actions Bot added the waiting-on-maintainers Waiting on the maintainers to review. label Oct 26, 2026
@github-actions

Copy link
Copy Markdown

Claude review · advisory

Reviewed 700c59a (full review): 0 findings.

Open: 0 blocking · 0 should-fix · 0 nit. ✅ Nothing blocking.

Fix or reply to each thread; the next revision's review re-checks open threads and resolves those it agrees are handled. Resolving a thread yourself also closes it. Later revisions review only what changed.

@wyongzhi
wyongzhi merged commit 2e80239 into aws-deadline:mainline Oct 26, 2026
11 checks passed
@wyongzhi
wyongzhi deleted the fix/ci-hatch-uv branch October 26, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-on-maintainers Waiting on the maintainers to review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants