Skip to content

Add sizes option to the tree command #11883

@pablofueros

Description

@pablofueros

Summary

This week I had the idea of creating a cli tool to check the size of the packages used in a python project. After checking available tools to facilitate the work, I noticed that uv tree could be used to get the dependency tree and then look up the sizes of the packages on the venv. As it was a "simple" wrapper around uv, I thought about it and decided to ask for the feature here.

Example

Note that sizes are not completely accurate:

~/test/ > uv tree --sizes
81MB    |   test v0.1.0  
39MB    |   ├── numpy v2.2.3
42MB    |   └── pandas v2.2.3 (group: dev)
(**)    |       ├── numpy v2.2.3
0.5MB   |       ├── python-dateutil v2.9.0.post0
8KB     |       │   └── six v1.17.0
1.5MB   |       ├── pytz v2025.1
1.6MB   |       └── tzdata v2025.1
(**) Package size already displayed

Benefits

  • In order to share a distribution (e.g. with pyinstaller), this helps us to get an idea of how big the executable will be.
  • Check if the dependency you are using really fits the project. There may be a lighter package that does what you need.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement to existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions