Draft
Conversation
Create a DependencyGrapher subclass for the Poetry package manager that: - Parses poetry.lock to extract dependency relationships - Handles the Poetry TOML lockfile format where dependencies are a hash of name to version constraint - Falls back to empty relationships when no lockfile is present - Registers as the grapher for the 'pip' package manager Includes test fixtures and specs following the UV grapher PR pattern. Co-authored-by: jakecoffman <886768+jakecoffman@users.noreply.github.com>
Co-authored-by: jakecoffman <886768+jakecoffman@users.noreply.github.com>
When poetry.lock is missing or fails to parse, fall back to running `poetry show --tree` to extract dependency relationships, mirroring the UV grapher's fallback to `uv tree`. Also adds `run_in_parsed_context` to Python FileParser to enable running shell commands in a temporary directory with dependency files. Co-authored-by: jakecoffman <886768+jakecoffman@users.noreply.github.com>
- Extract duplicate regex pattern into TREE_DEPTH_SEGMENT constant - Use endless range syntax for array truncation Co-authored-by: jakecoffman <886768+jakecoffman@users.noreply.github.com>
Only attempt `poetry show --tree` when the project has [tool.poetry] in pyproject.toml or uses poetry.core build backend. Non-Poetry projects (plain pip, pipenv, pip-compile) now return empty relationships instead of failing. Co-authored-by: jakecoffman <886768+jakecoffman@users.noreply.github.com>
Remove poetry show --tree fallback, tree parsing code, and poetry_project? detection. Just parse poetry.lock if present, otherwise return empty relationships. Non-Poetry projects are handled naturally since they won't have a poetry.lock. Co-authored-by: jakecoffman <886768+jakecoffman@users.noreply.github.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 are you trying to accomplish?
Providing more robust information to Dependency Graph for the Poetry package manager.
Anything you want to highlight for special attention from reviewers?
How will you know you've accomplished your goal?
We'll test it on repos!
Checklist