Skip to content

Skip uv dependencies pinned to a source that can never be updated - #16132

Open
Dichotomia wants to merge 1 commit into
dependabot:mainfrom
Dichotomia:uv-skip-git-and-url-sources
Open

Skip uv dependencies pinned to a source that can never be updated#16132
Dichotomia wants to merge 1 commit into
dependabot:mainfrom
Dichotomia:uv-skip-git-and-url-sources

Conversation

@Dichotomia

@Dichotomia Dichotomia commented Sep 1, 2026

Copy link
Copy Markdown

What are you trying to accomplish?

Dependabot resolves every entry in [project.dependencies] against a package index. A dependency
pinned to a url source in [tool.uv.sources], or to a git source carrying no tag, is not a
registry dependency, so that lookup either:

  • finds nothing — the pin is never updated, and no error says why. On a private repository, six
    upstream releases went by over seventeen days with daily runs and patterns: ["*"], and none was
    proposed;
  • or finds an unrelated package that happens to share the name, and proposes a version of it.

That second outcome is the same failure #14728 described one layer down, where pin_pep508_entry was
rewriting "pkg @ git+https://…" into pkg==<version>. #14729 fixed it there, and its comment —
"already pinned to a URL" — is the same reasoning applied to the updating side.

Details and the code walk-through are in #16129.

Anything you want to highlight for special attention from reviewers?

Which source kinds, and why a tagged git source is not one of them. url always, and git only
when the entry carries no tag. A tag gives an ordering, so such a pin can be read from the remote and
written back — skipping it would forgo an update that is available. #16151 does exactly that, which
makes these two changes complementary rather than alternatives: this one covers the shapes no
ordering can be derived from, which #16151 leaves with no source and therefore still resolved against
an index.

  • path entries keep their current behaviour. They are the subject of [UV] ignore sources #14644 and changing them here
    would conflate two requests.
  • index entries are real registry dependencies and must keep being checked.

Consistency rather than a new policy. The Poetry path in this same parser already skips these
source kinds, through UNSUPPORTED_DEPENDENCY_TYPES. This makes the PEP 621 path behave the same way.

Why the table is read per manifest. PyprojectDocument.from_file(pyproject_file) rather than the
memoised root document, because pep621_pep735_dependencies is also called for workspace members.

Why both names are normalised. uv applies PEP 508 normalisation when matching a source to a
dependency, while the table key is written as the author typed it, so normalise is applied to both
sides.

Not covered. A PEP 508 direct reference written inline ("pkg @ git+https://…") has the same
problem, but uv/helpers/lib/parser.py emits no url for it, so surfacing one is a wider change.

How will you know you've accomplished your goal?

The spec reuses the existing uv_mixed_sources.toml fixture, extended with a git-and-tag entry so
that the boundary between what is skipped and what is kept is asserted rather than implied. It checks
the complete set of names the parser emits, so a dependency appearing or disappearing both fail it.

Removing the skip yields git-package and url-package in that set; narrowing it to git alone
drops tagged-package from it.

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@Dichotomia
Dichotomia requested a review from a team as a code owner September 1, 2026 17:09
@Dichotomia
Dichotomia force-pushed the uv-skip-git-and-url-sources branch from 6d448ca to 8a9b5c2 Compare September 2, 2026 13:03
@v-robaiken v-robaiken moved this to Ready in Dependabot Sep 3, 2026
@Dichotomia
Dichotomia force-pushed the uv-skip-git-and-url-sources branch 2 times, most recently from fa9e4f4 to 4e98092 Compare September 3, 2026 16:17
@Dichotomia Dichotomia changed the title Skip uv dependencies pinned to a git or url source Skip uv dependencies pinned to a source that can never be updated Sep 3, 2026
@Dichotomia
Dichotomia force-pushed the uv-skip-git-and-url-sources branch 3 times, most recently from 86d6f9e to 7ccfe29 Compare September 3, 2026 21:45
@sachin-sandhu sachin-sandhu self-assigned this Sep 3, 2026
@sachin-sandhu

Copy link
Copy Markdown
Contributor

@Dichotomia 👋🏻 , thanks for the contribution. Let me know when the PR is ready for review.

@Dichotomia

Copy link
Copy Markdown
Author

Let me know when the PR is ready for review.

It is, and it will stop moving now: 7ccfe29, a single commit rebased on main, checks green. Apologies for the force-pushes you saw — a Sorbet fix, a title correction, and one rebase that landed just after your message. Nothing else is pending from me.

Dependabot resolves every entry in `[project.dependencies]` against a package index. A dependency
pinned to a `url` source in `[tool.uv.sources]`, or to a `git` source carrying no tag, is not a
registry dependency, so that lookup either finds nothing - the pin is never updated and no error says
why - or finds an unrelated package that happens to share the name, and proposes a version of it.

A `git` source carrying a tag is left alone: the tag gives an ordering, so such a pin can be read from
the remote and written back rather than skipped. What this covers is the residue, the shapes from which
no ordering can be derived, and dependabot#16129 asks for both halves.

The Poetry path in this same parser already skips these source kinds, through
UNSUPPORTED_DEPENDENCY_TYPES, so this makes the PEP 621 path consistent with it rather than
introducing a new policy. `path` entries keep their current behaviour: they are the subject of dependabot#14644.
`index` entries are real registry dependencies and must keep being checked.

The table is read per manifest rather than from the memoised root document, because
pep621_pep735_dependencies is also called for workspace members. Both sides of the name comparison
are normalised, since uv matches under PEP 508 normalisation while the table key is written as the
author typed it.

The branch is squashed, so the spec work is no longer visible as its own step: the fixture asserts the
complete set of names the parser emits, and the boundary between what is skipped and what is kept was
checked in both directions by breaking the predicate - removing the skip puts the url and untagged git
entries back in that set, and widening it to `git` alone drops the tagged one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Dichotomia
Dichotomia force-pushed the uv-skip-git-and-url-sources branch from 7ccfe29 to 7369465 Compare September 7, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

3 participants