fix: Fix uv.lock check for running uv export with --frozen#747
Open
richardowen wants to merge 1 commit into
Open
fix: Fix uv.lock check for running uv export with --frozen#747richardowen wants to merge 1 commit into
richardowen wants to merge 1 commit into
Conversation
The check for the uv.lock file is done while inside the temp directory, which only contains the pyproject.toml and uv.lock files. So the check always fails if the source_path is a directory, as the uv_lock_file variable set further up includes the original path. This change fixes the check so it finds the uv.lock file in the current (temp) directory if it exists, and therefore sets the --frozen option correctly.
|
This PR has been automatically marked as stale because it has been open 30 days |
Author
|
Not stale |
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.
Description
The check for the uv.lock file is done while inside the temp directory, which only contains the pyproject.toml and uv.lock files. So the check always fails if the
source_pathis a directory, as theuv_lock_filevariable set further up includes the directory path.Motivation and Context
This change fixes the check so it finds the uv.lock file in the current (temp) directory if it exists, and therefore sets the
--frozenoption correctly.Breaking Changes
None, unless users are relying on the behaviour that dependencies are being installed which don't match those defined in the uv.lock file. I.e. the behaviour of
uv exportwithout--frozen.How Has This Been Tested?
I have tested this with the
package_dir_uvexample. I didn't need to modify the example; it is currently not working correctly (i.e. it doesn't pass--frozeneven though a lock file is present in the fixture). With my change,--frozenis now passed in correctly.