Type Python and UV library detection metadata - #16177
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
馃煝 Approval recommended
The typed implementation preserves established behavior and is comprehensively covered by focused tests.
Review tier: Balanced
Findings: None
What changed in this PR
Adds typed pyproject metadata handling for Python and UV library detection while preserving existing precedence and fallback behavior.
Changes:
- Introduces typed project metadata accessors.
- Uses typed PyPI summary parsing with contextual errors.
- Expands precedence, malformed-data, caching, and resolver tests.
| File | Description |
|---|---|
.rubocop_todo.yml |
Reduces the T.untyped offense count. |
python/鈥媗ib/鈥媎ependabot/鈥媝ython/鈥媐ile_parser/鈥媝yproject_document.rb |
Adds typed metadata parsing. |
python/鈥媗ib/鈥媎ependabot/鈥媝ython/鈥媢pdate_checker.rb |
Uses typed pyproject and PyPI metadata. |
python/鈥媠pec/鈥媎ependabot/鈥媝ython/鈥媐ile_parser/鈥媝yproject_document_spec.rb |
Tests metadata parsing and validation. |
python/鈥媠pec/鈥媎ependabot/鈥媝ython/鈥媢pdate_checker_spec.rb |
Tests library detection and resolver behavior. |
uv/鈥媗ib/鈥媎ependabot/鈥媢v/鈥媢pdate_checker.rb |
Uses typed standard metadata while ignoring Poetry. |
uv/鈥媠pec/鈥媎ependabot/鈥媢v/鈥媢pdate_checker_spec.rb |
Tests UV metadata precedence and validation. |
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
jeffwidman
approved these changes
Sep 5, 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?
Use typed pyproject metadata for library detection in Python and UV.
PyprojectDocumentnow exposes optional stringnameanddescriptionfields, and the Python checker reads PyPI'sinfo.summarythrough a typed helper. This removes 12T.untypedannotations across the two checkers.Anything you want to highlight for special attention from reviewers?
Python still prefers Poetry, project, then build-system metadata. UV still ignores Poetry metadata. Empty tables remain distinct from missing tables, including when choosing the Poetry resolver. Missing descriptions, network fallbacks, and cached library decisions keep their existing behavior.
Wrongly typed consumed metadata now raises a contextual
TypeError. This is intentional: malformed names, descriptions, and PyPI summaries were previously handled inconsistently. Unknown fields remain allowed, and unselected metadata is not validated. TOML syntax errors retain each caller's existing handling.The types cover fields already used by library detection, not a complete pyproject schema. The build-system metadata fallback is existing Dependabot behavior. Resolver interfaces stay outside this change, so both checker files remain
typed: strict.This PR is independent of the UV version-config change. Both reduce the existing RuboCop offense count; preserve both reductions when merging.
How will you know you've accomplished your goal?
Repository-wide Sorbet and targeted RuboCop passed in containers. The relevant Python and UV document, parser, and checker suites passed all 394 examples, including new cases for malformed metadata, table precedence, empty-table resolver selection, and cached PyPI decisions. I did not run the complete repository suite.
Checklist