Return Python distribution files from path lookups - #35
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds distribution-owned Python file paths to package lookups while preserving existing path results.
Changes:
- Adds optional
PathResult.Files. - Updates pip, uv, and Poetry commands to report files.
- Adds extraction, integration tests, and documentation.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Summary |
|---|---|
translator_test.go |
Updates expected Python path commands. |
README.md |
Documents returned distribution files. |
manager.go |
Adds the Files result field. |
generic_manager.go |
Propagates enriched path results. |
generic_manager_test.go |
Tests manager integration. |
extractor.go |
Parses and resolves distribution files; currently bypasses strip_filename post-processing in one branch. |
extractor_test.go |
Tests file extraction and missing records. |
definitions/uv.yaml |
Enables uv file reporting. |
definitions/poetry.yaml |
Enables Poetry file reporting. |
definitions/pip.yaml |
Enables pip file reporting. |
Suppressed comments (1)
README.md:259
- This claim covers all Python path results, but
condastill usesconda run pip showwith theline_prefixextractor (definitions/conda.yaml:86-95), so itsPathResult.Filesremains empty. Limit the sentence to pip, uv, and poetry, or update conda as well.
Python path results also include `result.Files`, resolved from `pip show --files`, because several distributions share one `site-packages` directory.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+51
to
+57
| if extract != nil && extract.Type == "python_distribution" { | ||
| path, files, err := extractPythonDistribution(output) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| return &PathResult{Path: path, Files: files}, nil | ||
| } |
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.
Python package path lookups return the shared
site-packagesdirectory, whichdoes not identify files owned by the requested distribution.
Adds an optional
Filesfield toPathResult. The pip, uv, and poetry pathcommands now request
pip show --files, and the extractor resolves each listedfile against the reported location. Existing callers still receive the same
Pathvalue.Closes #34