Skip to content

uv tool upgrade doesn't respect --excludes #18021

@gizmoguy

Description

@gizmoguy

Summary

In PR #16528, the ability to exclude dependencies when installing a python package was added.

This functionality can be used when installing a tool, like so:

$ cat /tmp/excludes.txt
markdown-it-py

$ uv tool install --excludes /tmp/excludes.txt 2048-cli==1.0.2
Resolved 7 packages in 11ms
Installed 7 packages in 35ms
 + 2048-cli==1.0.2
 + click==8.3.1
 + maturin==1.12.0
 + numpy==2.4.2
 + pygments==2.19.2
 + rich==13.9.4
 + rich-menu==0.3.0
Installed 1 executable: 2048-cli

If the --excludes option was omitted from the previous command, we would see markdown-it-py==4.0.0 installed by uv.

If we then upgrade this tool, we will see our excluded dependency is reinstalled:

$ uv tool upgrade 2048-cli
Updated 2048-cli v1.0.2 -> v1.0.3
 - 2048-cli==1.0.2
 + 2048-cli==1.0.3
 + markdown-it-py==4.0.0
 + mdurl==0.1.2
Installed 1 executable: 2048-cli

Since the uv tool upgrade command does not accept the --excludes cli arg, I would expect that the correct behaviour on upgrade is to exclude the same dependencies as when the tool was first installed.

Platform

Ubuntu 24.04 amd64 (Linux 6.14.0-27-generic x86_64 GNU/Linux)

Version

uv 0.10.2

Python version

Python 3.12.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions