Skip to content

fix: make --list respect the --output option - #49

Merged
henryiii merged 2 commits into
pypa:mainfrom
henryiii:fix/list-respects-output
Aug 6, 2026
Merged

fix: make --list respect the --output option#49
henryiii merged 2 commits into
pypa:mainfrom
henryiii:fix/list-respects-output

Conversation

@henryiii

@henryiii henryiii commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

The dependency-groups --list flag ignored -o/--output and always printed to stdout. The group list now goes through the same output handling as resolved requirements, so -o file works; stdout output is unchanged.

main() also gains an argv keyword parameter to match the other CLI entry points, which lets the new tests call it directly.


📚 Documentation preview 📚: https://dependency-groups--49.org.readthedocs.build/en/49/

Also give main() an argv parameter, matching the other CLI entry points,
so it can be tested directly.

Assisted-by: ClaudeCode:claude-fable-5
@henryiii
henryiii marked this pull request as ready for review August 5, 2026 23:21

@sirosen sirosen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a bugfix note for the changelog would be nice, but not strictly necessary.

Comment thread tests/test_main_cli.py
stdio = capsys.readouterr()
return CLIResult(rc, stdio.out, stdio.err)

return _run

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll work up a follow-up changeset to combine these fixtures with the other test module.

I have some other CLI testing patterns I've found useful, like baking in a default assertion on the exit code.

@henryiii
henryiii merged commit 0deaa53 into pypa:main Aug 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants