Skip to content

poetry show $DEPENDENCY should also list the user defined dependencies that cause the inclusion of this $DEPENDENCY #8975

@nicolassanmar

Description

@nicolassanmar
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the FAQ and general documentation and believe that my question is not already covered.

Feature Request

Running poetry show with a particular dependency only shows the parent dependencies that require it, instead of showing the dependencies defined by the user in the pyproject.toml that introduced it.

For example, I would like to know why my package depends on aiohttp. Running poetry show aiohttp shows that datasets and ffspec require it, but I did not directly add those dependencies to my project, and they don't tell me too much about why aiohttp is in my project:

image

It would be very useful if it actually returned the packages that I explicitly included (flair, transformers, and a few more).

I created this workaround where I parse the result of poetry show --tree in order to get this information:
https://gist.github.com/nicolassanmar/ed7f2a0dcccb5fab21364d86ec960444

poetry show aiohttp --why --tree does not show top-level dependencies either

None of the options for the poetry show command actually acomplish what I want to do.

image

datasets is not defined in my top-level packages (neither is ffspec):
image

Related context:
This is the PR that added the option to poetry show on a dependency #2351

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/showRelated to `poetry show`kind/featureFeature requests/implementationsstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions