Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek authored Nov 9, 2024
1 parent 0d4418b commit 61aa299
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/src/hatchling/metadata/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,8 +990,10 @@ def classifiers(self) -> list[str]:

# combined text-numeric sort that ensures that Python versions sort correctly
split_re = re.compile(r'(\D*)(\d*)')
sort_key = lambda value: [(a, int(b) if b else None) for a, b in split_re.findall(value)]
sorted_classifiers = sorted(classifiers, key=sort_key)
sorted_classifiers = sorted(
classifiers,
key=lambda value: ([(a, int(b) if b else None) for a, b in split_re.findall(value)]),
)

self._classifiers = sorted(
unique_classifiers, key=lambda c: -1 if self.__classifier_is_private(c) else sorted_classifiers.index(c)
Expand Down

0 comments on commit 61aa299

Please sign in to comment.