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

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

Open
2 tasks done
nicolassanmar opened this issue Feb 15, 2024 · 4 comments
Labels
area/show Related to `poetry show` kind/feature Feature requests/implementations status/triage This issue needs to be triaged

Comments

@nicolassanmar
Copy link

nicolassanmar commented Feb 15, 2024

  • 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

@nicolassanmar nicolassanmar added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Feb 15, 2024
@nicolassanmar nicolassanmar changed the title poetry show $DEPENDENCY should also list the user defined dependencies that cause the inclusion of this $DEPENDENCY poetry show $DEPENDENCY should also list the user defined dependencies that cause the inclusion of this $DEPENDENCY Feb 15, 2024
@dimbleby
Copy link
Contributor

--why already does this

please close

@nicolassanmar
Copy link
Author

🤦‍♂️I did not know about this, and I'm not sure how I missed the option when I checked the docs.
Thanks for the quick response!

@nicolassanmar
Copy link
Author

nicolassanmar commented Feb 22, 2024

@dimbleby Sorry to come back with this after a few days, but I just recently had time to give it a try.
From the documentation, I did think this would do what I wanted it to do (list top level packages that included aiohttp in my project).

Unfortunately, there is no combination of options I can pass to poetry show that actually lists them:

image

This still lists datasets and ffspec instead of the actual flair or transformers that I included in the pyproject.toml.

For this reason, I'm reopening this issue, as there is no feature to do this

@nicolassanmar nicolassanmar reopened this Feb 22, 2024
@dimbleby
Copy link
Contributor

well, poetry tree --show --why is clearly where this belongs.

I expect that a merge request making it do what you want would be welcome (I also expect that if you are hoping for someone else to do it: they probably won't)

@Secrus Secrus added the area/show Related to `poetry show` label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/show Related to `poetry show` kind/feature Feature requests/implementations status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants