Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wheel build tag to pip list columns output #13231

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ichard26
Copy link
Member

Rebased version of #11531 with an update to the news entry and tweaks to the variable names (builds -> build tag). Fixes #5210.

This is how this looks:

Package                       Version         Build
----------------------------- --------------- ------

scripttest                    1.3
setuptools                    75.1.0
six                           1.16.0          1build

If a local editable is installed:

Package                       Version         Editable project location                   Build
----------------------------- --------------- ------------------------------------------- ------
pip                           25.1.dev0       /home/ichard26/dev/oss/pip
scripttest                    1.3
setuptools                    75.1.0
six                           1.16.0                                                      1build

To test this locally, the easiest way is probably to download a wheel, edit its WHEEL metadata file to add a Build: 2imabuildtag field, and install it.

@ichard26 ichard26 added this to the 25.1 milestone Feb 22, 2025
@ichard26 ichard26 closed this Feb 22, 2025
@ichard26 ichard26 reopened this Feb 22, 2025
@sbidoul
Copy link
Member

sbidoul commented Feb 23, 2025

Looks good, and useful :)

For completeness, this could also be added to the pip list json output, as well as pip inspect and maybe pip show.

To facilitate that, build_tag could be made a property of BaseDistribution like installer or requested.

These can be done in followup PRs, of course. It would be nice if these are all done in the same pip release cycle, if possible.

@sbidoul
Copy link
Member

sbidoul commented Feb 23, 2025

If a local editable is installed:

If the editable location column is present, it would perhaps look nicer to have the Build column next to Version column.

@ichard26
Copy link
Member Author

If the editable location column is present, it would perhaps look nicer to have the Build column next to Version column.

My thinking was that the build tag is the least important of the four fields shown in the list columns output, thus it should be last... but having looked at the output again, I agree it's better to have the build column next to the version column. Build tags aren't that common AFAIK anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add build number identifiers to version numbers reported by pip
4 participants