Poetry grapher generates lockfiles to determine versions in pyproject#14524
Merged
jakecoffman merged 11 commits intomainfrom Mar 24, 2026
Merged
Poetry grapher generates lockfiles to determine versions in pyproject#14524jakecoffman merged 11 commits intomainfrom
jakecoffman merged 11 commits intomainfrom
Conversation
brrygrdn
reviewed
Mar 24, 2026
brrygrdn
reviewed
Mar 24, 2026
Contributor
brrygrdn
left a comment
There was a problem hiding this comment.
LGTM, just one not on the log message
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Poetry-specific ephemeral lockfile generation step to the Python dependency grapher so Dependabot can resolve exact installed versions (instead of UNKNOWN) for SBOM/dependency graphing when a repo has pyproject.toml but no committed poetry.lock.
Changes:
- Add
Dependabot::Python::DependencyGrapher::LockfileGeneratorto runpoetry lockin a temp dir and return an in-memorypoetry.lock. - Update
Dependabot::Python::DependencyGrapher#prepare!to generate and inject an ephemeralpoetry.lockwhen the project is detected as Poetry viapyproject.toml. - Add/extend specs to cover successful/failed ephemeral lockfile generation and resulting resolved PURLs/relationships.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| python/lib/dependabot/python/dependency_grapher.rb | Generates/injects an ephemeral Poetry lockfile during graph preparation and adjusts relevant file selection. |
| python/lib/dependabot/python/dependency_grapher/lockfile_generator.rb | Implements the temp-dir poetry lock flow and returns a DependencyFile for the generated lock. |
| python/spec/dependabot/python/dependency_grapher_spec.rb | Adds coverage for grapher behavior when poetry.lock is absent (generation attempt, success, failure). |
| python/spec/dependabot/python/dependency_grapher/lockfile_generator_spec.rb | New unit specs for lockfile generator success/failure/non-generation paths. |
Nishnha
reviewed
Mar 24, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Nishnha
previously approved these changes
Mar 24, 2026
Nishnha
approved these changes
Mar 24, 2026
brrygrdn
approved these changes
Mar 24, 2026
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?
When there is no lockfile, Dependabot needs to generate one to determine what version would be installed at the time.
Anything you want to highlight for special attention from reviewers?
Copied patterns from the NPM lockfile generator which does the same thing.
How will you know you've accomplished your goal?
Versions will start replacing UNKNOWN in SBOMs where a pyproject exists but not a lockfile.
Checklist