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

Make poetry show <package> --tree show who requires <package> as well #5396

Closed
2 tasks done
jacopok opened this issue Mar 31, 2022 · 1 comment · Fixed by #5444
Closed
2 tasks done

Make poetry show <package> --tree show who requires <package> as well #5396

jacopok opened this issue Mar 31, 2022 · 1 comment · Fixed by #5444
Labels
kind/feature Feature requests/implementations

Comments

@jacopok
Copy link

jacopok commented Mar 31, 2022

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

Feature Request

Consider a project with pyproject.toml reading:

[tool.poetry]
name = "my_package"
version = "0.1.0"
description = ""
authors = ["Me <me@myself.com>"]

[tool.poetry.dependencies]
python = ">=3.8, <3.11"

[tool.poetry.dev-dependencies]
pytest = "^7.1.1"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

The full dependencies, as shown by poetry show --tree, are

$ poetry show --tree
pytest 7.1.1 pytest: simple powerful testing with Python
├── atomicwrites >=1.0
├── attrs >=19.2.0
├── colorama *
├── iniconfig *
├── packaging *
│   └── pyparsing >=2.0.2,<3.0.5 || >3.0.5 
├── pluggy >=0.12,<2.0
├── py >=1.8.2
└── tomli >=1.0.0

For larger projects, it can be helpful to find out which package is requiring another:
for example, say I want to figure out which of my top-level dependencies is requiring packaging.

Currently (poetry version 1.1.13) the behaviour of poetry show packaging --tree is:

$ poetry show packaging --tree
packaging 21.3 Core utilities for Python packages
└── pyparsing >=2.0.2,<3.0.5 || >3.0.5

So, it doesn't tell me that it is pytest which is asking for packaging to be present;
however this information is available as the full output shows.
I'm proposing that the output could look something like:

$ poetry show packaging --tree
pytest 7.1.1
├── packaging (required: *, used: 21.3) Core utilities for Python packages
│   └── pyparsing >=2.0.2,<3.0.5 || >3.0.5 

and so on for all the packages which require the one on hand.

@jacopok jacopok added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Mar 31, 2022
@abn abn closed this as completed in #5444 May 10, 2022
@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Jun 11, 2022
Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Feature requests/implementations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants