feat: better path handling when using --find-links especially#2417
Merged
ruben-arts merged 6 commits intoprefix-dev:mainfrom Nov 14, 2024
Merged
feat: better path handling when using --find-links especially#2417ruben-arts merged 6 commits intoprefix-dev:mainfrom
--find-links especially#2417ruben-arts merged 6 commits intoprefix-dev:mainfrom
Conversation
2 tasks
2 tasks
ruben-arts
approved these changes
Nov 14, 2024
Contributor
ruben-arts
left a comment
There was a problem hiding this comment.
Great PR and nice fix!
I've tested what was listed and I wasn't able to create an unexpected result. I don't have all knowledge on this front but it looks good to me!
tdejager
added a commit
to tdejager/pixi
that referenced
this pull request
Nov 15, 2024
…ix-dev#2417) Co-authored-by: Ruben Arts <ruben.arts@hotmail.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.
What does it fix
This should help with locking and trying to use relative paths when possible. For example before the find-links example had absolute path in the lock file, now we should not. Also compared to before the code has been documented a lot better, and there were some assumption errors, like assuming a path would be relative.
I've noticed that if a panic occurs during a resolve that this sometimes led to a silent error, very annoying. So I just removed all
expect's from the resolve code and decided to use errors and miette for all of it.How the design is approached
The assumption now is to use a relative path in the lock file if possible and otherwise fall back to an absolute path. Note that this behavior is only changed for path based indexes. We now check what kind of index the package is coming from, the latest uv updates made these distinctions a lot easier.
Why not always use relative paths?
Because (and some tests do this) you can supply absolute paths to indexes on disk or flat indexes (which are basically just a list of files) with absolute paths. However, if the project root is contained in this path we will make it relative, this way you can supply a relative path to a flat index, and it should work. Currently, we allow absolute paths, and like I said above some tests make absolute paths to
extra-index-urlon disk.How to test