fix: wrap uv export failures as ImageBuildError with stderr context#1103
Open
EngHabu wants to merge 1 commit into
Open
fix: wrap uv export failures as ImageBuildError with stderr context#1103EngHabu wants to merge 1 commit into
EngHabu wants to merge 1 commit into
Conversation
`_extract_editables_from_uv_export` runs `uv export --no-emit-project` with `check=True` and let `CalledProcessError` bubble up unmodified during image build. The default message — `Command '['uv', 'export', '--no-emit-project']' returned non-zero exit status 2.` — drops the captured stderr, which is the only useful piece of information (broken pyproject, lock conflict, etc.). Catch `CalledProcessError`, include the stderr/stdout the subprocess emitted, and raise as `ImageBuildError` so the existing Sentry user-error filter and ClickException handler treat it as user-actionable. Also handle the `uv`-not-installed case with a pointer to install it instead of leaking `FileNotFoundError`. Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>
pingsutw
approved these changes
May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_extract_editables_from_uv_exportrunsuv export --no-emit-projectwithcheck=Trueand letsCalledProcessErrorbubble up unmodified during image build. The default message —Command '['uv', 'export', '--no-emit-project']' returned non-zero exit status 2.— drops the captured stderr, which is the only useful piece of information for the user (broken pyproject, lock conflict, etc.).This change catches
CalledProcessError, includes the stderr/stdout the subprocess emitted, and raises it asImageBuildErrorso the existing Sentry user-error filter and ClickException handler treat it as user-actionable. Also handles theuv-not-installed case with a pointer to install it instead of leakingFileNotFoundError.Closes
CalledProcessError: Command '['uv', 'export', '--no-emit-project']' returned non-zero exit status 2.from_extract_editables_from_uv_exportfixes FLYTE-SDK-3FTest plan
test_extract_editables_surfaces_uv_export_failure— non-zero exit surfaces stderr inside anImageBuildError.test_extract_editables_surfaces_missing_uv_binary—FileNotFoundErrorbecomes anImageBuildErrorpointing at install docs.test_get_uv_lock_editable_dependencies_resolves_pathsstill passes (12 tests total).make fmtclean.🤖 Generated with Claude Code