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

uv pip tree improvement #4439

Closed
4 of 6 tasks
ibraheemdev opened this issue Jun 21, 2024 · 13 comments · Fixed by #4440, #4449, #4621 or #4655
Closed
4 of 6 tasks

uv pip tree improvement #4439

ibraheemdev opened this issue Jun 21, 2024 · 13 comments · Fixed by #4440, #4449, #4621 or #4655
Labels
cli Related to the command line interface enhancement New feature or improvement to existing functionality help wanted Contribution especially encouraged

Comments

@ibraheemdev
Copy link
Member

ibraheemdev commented Jun 21, 2024

Some additional features that did not land as part of #3859:

@zanieb
Copy link
Member

zanieb commented Jun 21, 2024

Can you create specific issues for each of these so we can track contributions easier?

@ChannyClaus
Copy link
Contributor

how would --no-dedupe and the current behavior for printing out dependency cycles would interact? wouldn't it end up with an infinite loop?

@zanieb
Copy link
Member

zanieb commented Jun 21, 2024

We would need to deduplicate cycles still, but we can show anything that's not a cycle.

@ChannyClaus
Copy link
Contributor

should we also print (**) instead of (*) for cyclic dependencies? it may be nice to disambiguate between the regular de-duplication and cyclic dependencies.

@zanieb
Copy link
Member

zanieb commented Jun 21, 2024

If you use --no-dedupe we can just use (*) still and change the footnote to say it's a cycle. idk if we need to highlight cycles further in the default output, sounds hard to read.

@kdeldycke
Copy link

May I propose to add a machine-readable output like JSON/CSV/Toml/whatever to the list of improvements?

So I can hack uv pip tree output to produce a mermaid graph of dependencies (and emulates pipdeptree --mermaid > dependencies.mmd)?

@dsully
Copy link

dsully commented Jun 22, 2024

+1 on adding JSON -j to pipdeptree and other machine readable outputs. Example output:

[
    ....
    {
        "package": {
            "key": "werkzeug",
            "package_name": "Werkzeug",
            "installed_version": "3.0.3"
        },
        "dependencies": [
            {
                "key": "markupsafe",
                "package_name": "MarkupSafe",
                "installed_version": "2.1.5",
                "required_version": ">=2.1.1"
            }
        ]
    }
]

@charliermarsh charliermarsh added enhancement New feature or improvement to existing functionality cli Related to the command line interface labels Jun 23, 2024
@zanieb zanieb closed this as completed in c127632 Jun 24, 2024
@Peiffap
Copy link
Contributor

Peiffap commented Jun 25, 2024

@zanieb I think this accidentally got closed in #4449; #4440 hasn't been merged yet and contains some of the additional features being asked for (--depth and --prune). There was also the bullet on proper handling of extras.

You might also want to ask about creating follow-up issues for the output flags that were mentioned in comments (--mermaid, -j, etc.).

@zanieb zanieb reopened this Jun 25, 2024
@hauntsaninja
Copy link
Contributor

hauntsaninja commented Jun 26, 2024

I mostly use pipdeptree with its -p / --packages and -r / --reverse flags; I'd love to see uv pip tree have equivalent functionality!

(let me know if I should open a new issue for that :-) )

@zanieb
Copy link
Member

zanieb commented Jun 26, 2024

We're on the loose with this issue right now — seems to be working fine since @ChannyClaus is just doing them all :)

Please chime in if you're interested in doing any of these improvements though!

@zanieb zanieb added the help wanted Contribution especially encouraged label Jun 26, 2024
@ChannyClaus
Copy link
Contributor

ChannyClaus commented Jun 27, 2024

oh okay yah i can add those (--packages and --reverse that is) 🌵

was going to make a PR for the extras (since this would be a "breaking" change unless it's behind a flag?) once #4440 merged but maybe i'll just stack them on top of each other or something...

@zanieb
Copy link
Member

zanieb commented Jun 27, 2024

I don't think you need to worry about breaking changes in the text output since it's meant for users to "view".

@ibraheemdev ibraheemdev reopened this Jun 27, 2024
ibraheemdev pushed a commit that referenced this issue Jul 1, 2024
## Summary

Part of #4439.

## Test Plan

Existing tests pass + added a couple of new tests with `--invert`.
@ibraheemdev ibraheemdev reopened this Jul 1, 2024
ibraheemdev pushed a commit that referenced this issue Jul 1, 2024
## Summary

Part of #4439.

## Test Plan

The existing tests pass + added a couple of tests to ensure `--package` behaves as expected.
@ibraheemdev
Copy link
Member Author

Thanks @ChannyClaus for all your work on this! Splitting the remaining two issues into #4711 and #4710.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command line interface enhancement New feature or improvement to existing functionality help wanted Contribution especially encouraged
Projects
None yet
8 participants