Support bare local file paths in dependency parsing#10911
Open
Mirochill wants to merge 4 commits into
Open
Conversation
d740c2e to
0398859
Compare
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new
parse()logic now hits the filesystem for every separator-less requirement; consider limiting the early_parse_pathcheck to names that look like files (e.g., known archive extensions) to avoid unnecessarystatcalls for typical package specs. - In
_parse_path,is_relative_fileis a subset ofis_relative_path, so the condition(is_explicit_path && is_relative_path) || is_relative_filecan be simplified (or commented) to make the intended cases clearer and reduce mental overhead when reasoning about path handling.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new `parse()` logic now hits the filesystem for every separator-less requirement; consider limiting the early `_parse_path` check to names that look like files (e.g., known archive extensions) to avoid unnecessary `stat` calls for typical package specs.
- In `_parse_path`, `is_relative_file` is a subset of `is_relative_path`, so the condition `(is_explicit_path && is_relative_path) || is_relative_file` can be simplified (or commented) to make the intended cases clearer and reduce mental overhead when reasoning about path handling.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
radoering
requested changes
May 24, 2026
Member
radoering
left a comment
There was a problem hiding this comment.
I think the sourcery feedback in #10911 (review) makes sense and should be addressed.
0398859 to
c1782ea
Compare
Contributor
Author
|
Thanks, addressed in the latest branch updates. The parser now only probes local paths before or during fallback parsing when the requirement is explicit path-like or a known package archive filename, so plain package names avoid the filesystem path check. _parse_path() also uses the simplified relative/absolute path condition. The latest GitHub Actions matrix, Cirrus FreeBSD, and pre-commit.ci checks are green on 887f055. |
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.
Pull Request Check List
Resolves: #6951
Summary
demo.whlas a path dependency even when the argument has no directory separatorValidation
Not run locally
Added tests for changed code.
Updated documentation for changed code.