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

Add list --short option #804

Merged
merged 5 commits into from
Feb 16, 2022
Merged

Add list --short option #804

merged 5 commits into from
Feb 16, 2022

Conversation

q0w
Copy link
Contributor

@q0w q0w commented Feb 1, 2022

  • I have added an entry to docs/changelog.md

Summary of changes

#792
Should --short flag have precedence over --json flag?
Should --include-injected flag be accepted with --short?

Test plan

Tested by running

> pipx list --short
black 18.9b0
pipx 0.10.0

Copy link
Member

@cs01 cs01 left a comment

Choose a reason for hiding this comment

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

Cool, looks pretty good!

Could you add example output to the summary?

Should --short flag have precedence over --json flag?

These should be mutually exclusive. You should be able to do this with https://docs.python.org/3/library/argparse.html#mutual-exclusion.

Should --include-injected flag be accepted with --short?

Probably not, since it wouldn't be very short in that case. Thoughts @njthomas?

docs/changelog.md Outdated Show resolved Hide resolved
@q0w
Copy link
Contributor Author

q0w commented Feb 14, 2022

Could you add example output to the summary?
These should be mutually exclusive. You should be able to do this with https://docs.python.org/3/library/argparse.html#mutual-exclusion.

Done.

Copy link
Member

@cs01 cs01 left a comment

Choose a reason for hiding this comment

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

Look good, thank you!

Comment on lines +137 to +146
def test_list_short(pipx_temp_env, monkeypatch, capsys):
assert not run_pipx_cli(["install", PKG["pycowsay"]["spec"]])
assert not run_pipx_cli(["install", PKG["pylint"]["spec"]])
captured = capsys.readouterr()

assert not run_pipx_cli(["list", "--short"])
captured = capsys.readouterr()

assert "pycowsay 0.0.0.1" in captured.out
assert "pylint 2.3.1" in captured.out
Copy link
Member

Choose a reason for hiding this comment

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

nice!

@cs01 cs01 merged commit cf06187 into pypa:main Feb 16, 2022
@q0w
Copy link
Contributor Author

q0w commented Feb 16, 2022

@cs01 but why did tests fail on macos?

@cs01
Copy link
Member

cs01 commented Feb 16, 2022

@cs01 but why did tests fail on macos?

Where are you seeing that? (edit: nevermind, I see it now; it was hidden on my phone) Tests were failing on main until just a couple days ago so that may have been the reason. Either way everything is merged and passing now.

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.

None yet

2 participants