Skip to content

Return Python distribution files from path lookups - #35

Merged
andrew merged 2 commits into
mainfrom
issue-34-python-files
Aug 21, 2026
Merged

Return Python distribution files from path lookups#35
andrew merged 2 commits into
mainfrom
issue-34-python-files

Conversation

@andrew

@andrew andrew commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Python package path lookups return the shared site-packages directory, which
does not identify files owned by the requested distribution.

Adds an optional Files field to PathResult. The pip, uv, and poetry path
commands now request pip show --files, and the extractor resolves each listed
file against the reported location. Existing callers still receive the same
Path value.

Closes #34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 conda still uses conda run pip show with the line_prefix extractor (definitions/conda.yaml:86-95), so its PathResult.Files remains 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 thread extractor.go
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
}
@andrew
andrew merged commit bfdb5be into main Aug 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Return distribution-owned files from Python path lookups

2 participants