From 64c36c93253ae86ae37c7002f842672c3056078e Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Fri, 17 May 2024 13:18:03 +0100 Subject: [PATCH] Improve reproducibility of sorting --- src/validate_pyproject/plugins/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/validate_pyproject/plugins/__init__.py b/src/validate_pyproject/plugins/__init__.py index f39175d..19ca2c1 100644 --- a/src/validate_pyproject/plugins/__init__.py +++ b/src/validate_pyproject/plugins/__init__.py @@ -90,7 +90,9 @@ def iterate_entry_points(group: str = ENTRYPOINT_GROUP) -> Iterable[EntryPoint]: # TODO: Once Python 3.10 becomes the oldest version supported, this fallback and # conditional statement can be removed. entries_ = (plugin for plugin in entries.get(group, [])) - deduplicated = {e.name: e for e in sorted(entries_, key=lambda e: e.name)} + deduplicated = { + e.name: e for e in sorted(entries_, key=lambda e: (e.name, e.value)) + } return list(deduplicated.values())