-
Notifications
You must be signed in to change notification settings - Fork 2k
Add conda list --reverse argument
#12496
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
93a90a2
Update File
HeavenEvolved 8825a96
Update File
HeavenEvolved e9319d3
Create File
HeavenEvolved 7d6c076
Update File
HeavenEvolved 8652fd1
Update File
HeavenEvolved 9d75a96
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] adef903
Update conda/cli/main_list.py
HeavenEvolved bc16df9
Update conda/cli/main_list.py
HeavenEvolved 7828e01
Update conda/cli/main_list.py
HeavenEvolved e27d011
Update conda/cli/conda_argparse.py
HeavenEvolved f8bc541
Update conda/cli/conda_argparse.py
HeavenEvolved aaee394
Update news/gh-11954-list-reverse
HeavenEvolved 595e447
Merge branch 'main' into HeavenEvolved-Issue#11954
kenodegard f6b32a9
Apply suggestions from code review
kenodegard 247fc21
Canonical and export formats were missed
kenodegard da4a204
Update File
HeavenEvolved d6c3faf
Merge branch 'main' into HeavenEvolved-Issue#11954
kenodegard 57ecfec
Add tests
kenodegard e44a650
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 0603363
Merge branch 'main' into HeavenEvolved-Issue#11954
travishathaway File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ### Enhancements | ||
|
|
||
| * Added `conda list --reverse` to return a reversed list of installed packages. (#11954) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Copyright (C) 2012 Anaconda, Inc | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
| import json | ||
|
|
||
| from conda.testing.integration import Commands, make_temp_env, run_command | ||
|
|
||
|
|
||
| # conda list | ||
| def test_list(): | ||
| pkg = "ca-certificates" # has no dependencies | ||
| with make_temp_env(pkg) as prefix: | ||
| stdout, _, _ = run_command(Commands.LIST, prefix, "--json") | ||
| assert any(item["name"] == pkg for item in json.loads(stdout)) | ||
|
|
||
|
|
||
| # conda list --reverse | ||
| def test_list_reverse(): | ||
| pkg = "curl" # has dependencies | ||
| with make_temp_env(pkg) as prefix: | ||
| stdout, _, _ = run_command(Commands.LIST, prefix, "--json") | ||
| names = [item["name"] for item in json.loads(stdout)] | ||
| assert names == sorted(names) | ||
|
|
||
| stdout, _, _ = run_command(Commands.LIST, prefix, "--reverse", "--json") | ||
| names = [item["name"] for item in json.loads(stdout)] | ||
| assert names == sorted(names, reverse=True) |
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.
Uh oh!
There was an error while loading. Please reload this page.