Add dependency sources to poetry show - #11052
Open
wolfgang-aura wants to merge 2 commits into
Open
wolfgang-aura wants to merge 2 commits into
wolfgang-aura wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
poetry showlists dependency names, versions, and descriptions, but it does not identify where each package came from. This makes it difficult to distinguish PyPI packages, configured package sources, and direct-origin dependencies in the same environment.The command discarded the resolved package source while formatting its flat table and JSON output. This change adds
--source, derives a readable source from the resolved package, and includes it in flat text, single-package, and JSON output. PyPI packages are labelledPyPI, configured repositories use their source name, and direct dependencies show their actual URL. Because tree output has a different recursive format, combining--sourcewith--treenow fails explicitly instead of silently ignoring the option.Tests cover PyPI and configured sources, direct URLs, JSON and text output, truncation behaviour, and the tree-mode error. Documentation for
poetry shownow describes the option.Verification on Windows 11 with Python 3.14.3: the focused source tests passed (
8 passed). The widertest_show.pyrun reached 87 passes but had two environment-related failures caused by the installedpoetry-coreAPI not accepting this checkout'ssplitext(..., is_filename=...)call; CI still needs to run the supported matrix, mypy, and pre-commit checks.An alternative was to add source data to tree output. That would require changing the recursive tree presentation and increase the scope of this focused feature, so this patch rejects the combination clearly instead.
Resolves #10967.
This change was implemented and reviewed with
codex/gpt-5.6-lunathrough the Mailman harness. The submitting human must review the diff and take responsibility for the contribution before filing.