From f7c0bd4120270b94e2332ed17ebaa4793191c5bf Mon Sep 17 00:00:00 2001 From: Mariam Ahhttouche Date: Tue, 10 Mar 2026 17:29:39 +0000 Subject: [PATCH] Update uv_python to log unparsed versions in debug mode --- plugins/modules/uv_python.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/modules/uv_python.py b/plugins/modules/uv_python.py index 6fe2be68ce..e4ea659d84 100644 --- a/plugins/modules/uv_python.py +++ b/plugins/modules/uv_python.py @@ -281,7 +281,7 @@ class UV: latest_version = path = "" # 'uv python list' returns versions in descending order but we sort them just in case future uv behavior changes dummy_rc, results, dummy_err = self._list_python(*args) - valid_results = self._parse_versions(results) + valid_results = self._filter_valid_versions(results) if valid_results: version = max(valid_results, key=lambda result: result["parsed_version"]) latest_version = version.get("version", "") @@ -303,15 +303,15 @@ class UV: return [result.get("version") for result in results], [result.get("path") for result in results] return [], [] - @staticmethod - def _parse_versions(results): + def _filter_valid_versions(self, results): valid_results = [] for result in results: + version = result.get("version", "") try: - result["parsed_version"] = StrictVersion(result.get("version", "")) + result["parsed_version"] = StrictVersion(version) valid_results.append(result) except ValueError: - continue + self.module.debug(f"Found {version} available, but it's not yet supported by uv_python module.") return valid_results @staticmethod