fix(uv): strip extras from dependency names in PURL generation#14468
Merged
Conversation
Apply the same fix from Python grapher (PR #14462) to the UV ecosystem. Add purl_name_for override that uses NameNormaliser.normalise to strip extras like [filecache] from dependency names in PURLs. Co-authored-by: jakecoffman <886768+jakecoffman@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
jakecoffman
March 17, 2026 12:27
View session
Member
|
Confirmed this works with |
Contributor
There was a problem hiding this comment.
Pull request overview
Ports the Python dependency grapher behavior to the UV ecosystem so generated PyPI PURLs don’t include dependency extras (e.g., cachecontrol[filecache]), aligning Dependency Graph submissions with the PURL spec.
Changes:
- Override
purl_name_forinDependabot::Uv::DependencyGrapherto normalize names viaNameNormaliser(stripping extras). - Add a UV dependency grapher spec case and a
pyproject.tomlfixture that includes an extra-bearing dependency.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| uv/lib/dependabot/uv/dependency_grapher.rb | Normalizes dependency names for PURL generation to strip extras. |
| uv/spec/dependabot/uv/dependency_grapher_spec.rb | Adds a test context asserting extras don’t appear in emitted PURL keys. |
| uv/spec/fixtures/pyproject_files/uv_dependency_grapher_extras.toml | New fixture with cachecontrol[filecache] to exercise extras handling. |
Co-authored-by: jakecoffman <886768+jakecoffman@users.noreply.github.com>
jakecoffman
approved these changes
Mar 17, 2026
Nishnha
approved these changes
Mar 17, 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?
Port the Python grapher fix (#14462) to the UV ecosystem. Python dependencies can carry extras in their name (e.g.
cachecontrol[filecache]), but PURLs must reference the base package only (pkg:pypi/cachecontrol@0.14.2, notpkg:pypi/cachecontrol[filecache]@0.14.2).Anything you want to highlight for special attention from reviewers?
Mirrors the exact approach used in the Python grapher — overrides
purl_name_forto run the dependency name throughNameNormaliser.normalise, which strips extras and normalizes casing/separators.purl_name_foroverride toDependabot::Uv::DependencyGrapherrequirefordependabot/uv/name_normaliserHow will you know you've accomplished your goal?
UV dependency graph submissions will emit clean PURLs without extras brackets, matching the Python grapher behavior.
Checklist