Skip to content

Commit

Permalink
Fix sorting case sensitivity in list command (#1973) (#1974)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbalabka authored Jun 12, 2023
1 parent 3a57ee2 commit c6b5f3b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions news/1973.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Case-insensitive sorting in `pdm list`.
2 changes: 1 addition & 1 deletion src/pdm/cli/commands/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def _group_of(name: str) -> set[str]:
keys = parse_comma_separated_string(options.sort)
if not all(key in Listable.KEYS for key in keys):
raise PdmUsageError(f"--sort key must be one of: {','.join(Listable.KEYS)}")
records.sort(key=lambda d: tuple(d[key] for key in keys))
records.sort(key=lambda d: tuple(d[key].casefold() for key in keys))

# Write CSV
if options.csv:
Expand Down

0 comments on commit c6b5f3b

Please sign in to comment.