Skip to content

Add wheel build tag to pip list columns output #13231

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

Merged
merged 2 commits into from
Mar 1, 2025

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.

@ichard26
Copy link
Member Author

ichard26 commented Feb 26, 2025

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

I'll do that in a separate PR as this is already good to go. Exposing the build tag in machine-readable output may require some extra bikeshedding. How does that sound? @sbidoul

@sbidoul
Copy link
Member

sbidoul commented Mar 1, 2025

Sounds good :)

@ichard26 ichard26 merged commit 5aeda3b into pypa:main Mar 1, 2025
31 checks passed
@ichard26 ichard26 deleted the feat/wheel-build-tag-list branch March 1, 2025 15:00
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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