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

Retrieving metadata for installed packages #10962

Open
tjni opened this issue Jan 25, 2025 · 0 comments
Open

Retrieving metadata for installed packages #10962

tjni opened this issue Jan 25, 2025 · 0 comments
Labels
enhancement New feature or improvement to existing functionality

Comments

@tjni
Copy link

tjni commented Jan 25, 2025

Summary

I have a use case in which I'd like to programmatically work with the metadata for every installed package. My ideal workflow would be to run a single command:

❯ uv pip list --python <some python> --format=json --metadata-fields=name,keywords --requires
[
  {
    "name": "normalized-name",
    "version": "1.0.0",
    "metadata": {
      "name": "original_name",
      "keywords": "1,2,3"
    },
    "requires": [
      { "name": "normalized-dependency-name" }
    ]
  },
  ...
]

where the --requires option is something I'm proposing in #10886.

When researching the history of this feature being asked for in pip, I stumbled across pypa/pip#11097 and pypa/pip#5261, in which the pip maintainers felt that adding this to pip list (or pip show) as JSON output was feature creep, and instead created pip inspect. Less optimal for my use case, but still quite reasonable (I can join this information in application code):

❯ uv pip list --python <some python> --format=json --requires
[
  {
    "name": "normalized-name",
    "version": "1.0.0",
    "requires": [
      { "name": "normalized-dependency-name" }
    ]
  },
  ...
]

❯ uv pip inspect --python <some python>
{
  "version": "1",
  "uv_version": "0.5.24",
  "installed": [
    {
      "metadata": {
        "name": "original_name",
        "keywords": "1,2,3",
        ...
    }
  ]
  "environment": {
    ...
  }
}

I feel that this feature request shares some overlap with:

Example

No response

@tjni tjni added the enhancement New feature or improvement to existing functionality label Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality
Projects
None yet
Development

No branches or pull requests

1 participant