Bugfix/uv shim fallback - #40
Merged
Merged
Conversation
…ntain permissions' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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.
This pull request improves the fallback logic when the
uvexecutable is present but cannot be run, ensuring more robust handling of package management commands. The main changes include updating both the implementation and documentation to treatOSError(e.g., due to a dangling shebang, corrupted binary, or permission error) as a trigger for falling back topip, not justCalledProcessError. The test suite is also extended to cover these scenarios.Fallback Logic Improvements:
uvtopipin_iter_pip_listand_install_requirement_stringnow triggers on bothCalledProcessErrorandOSError, ensuring that any execution failure ofuv(including unrunnable binaries) results in a retry withpip. [1] [2]_raise_oserrorhelper to ensure that ifuvwas not attempted andpipitself fails withOSError, the error is propagated without modification, preserving prior behavior. [1] [2]Documentation Updates:
OSError(not just nonzero exit codes) fromuvtriggers a fallback topip, and describes the resulting behavior in detail. [1] [2]Testing Enhancements:
_write_broken_uvand_write_installable_packagetest helpers to simulate both nonzero-exit and unrunnableuvexecutables, and to create real installable test packages.pipworks whenuvis unrunnable (OSError), and that the error handling and recovery logic behave as intended in all cases. [1] [2] [3]Miscellaneous:
1.4.3inpyproject.toml.These changes make the fallback mechanism more robust and ensure that package operations do not fail unexpectedly when
uvis present but unusable.