Repository navigation
Handle Python requirements with no version specifier in the requirement file updater - #16323
Merged
v-kbukum1 merged 1 commit intoSep 18, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The guard safely handles valid nil requirements, and both shared consumer paths have focused regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Prevents Python and uv requirement updates from crashing when a dependency has no version specifier.
Changes:
- Skips rewriting requirements with a
nilspecifier. - Adds bare-name and direct-reference regression coverage for Python and uv.
| File | Description |
|---|---|
python/lib/dependabot/python/file_updater/requirement_file_updater.rb |
Adds the no-op guard. |
python/spec/dependabot/python/file_updater/requirement_file_updater_spec.rb |
Covers Python requirements without specifiers. |
uv/spec/dependabot/uv/file_updater/requirement_file_updater_spec.rb |
Covers the shared updater through uv. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
honeyankit
approved these changes
Sep 17, 2026
…nt file updater A version specifier is optional per PEP 508 and the pip requirements format (bare names, URL/VCS/editable/local-path references, unpinned pip-tools inputs, PEP 621 / [tool.uv.sources]). The requirement file updater assumed every requirement carried one and crashed with a TypeError when it did not. Guard the nil at the single shared call site so a no-specifier requirement is left unchanged instead of forced through the replacer, matching the existing pip-compile nil-guard. uv reuses this updater, so the fix covers pip and uv. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
v-kbukum1
force-pushed
the
kbukum1/python-uv-requirement-no-version-specifier
branch
from
September 18, 2026 15:53
a0d2340 to
12e4de8
Compare
honeyankit
approved these changes
Sep 18, 2026
v-kbukum1
deleted the
kbukum1/python-uv-requirement-no-version-specifier
branch
September 18, 2026 16:56
1 task done
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?
The Python requirement file updater assumed every requirement carries a version specifier and crashed with a
TypeErrorwhen one did not. A missing version specifier is valid per PEP 508 and the pip requirements format — bare names, URL/VCS/editable/local-path direct references, unpinned pip-tools inputs, and PEP 621 /[tool.uv.sources]entries. This change makes the updater handle that case gracefully. uv reuses the Python updater, so the fix covers pip and uv.Anything you want to highlight for special attention from reviewers?
nilhere is expected input, not a resolution failure — a no-op keeps the file byte-identical and matches the existing nil-guard in the pip-compile updater.RequirementFileUpdater).How will you know you've accomplished your goal?
Checklist