From b12ca215674837de908a49b44d753f31c21e78c2 Mon Sep 17 00:00:00 2001 From: David C Ellis Date: Sat, 28 Feb 2026 18:31:49 +0000 Subject: [PATCH 1/2] Remove unused regex logic --- src/ducktools/pythonfinder/shared.py | 7 ------- tests/test_uv_finder.py | 11 ----------- 2 files changed, 18 deletions(-) diff --git a/src/ducktools/pythonfinder/shared.py b/src/ducktools/pythonfinder/shared.py index e6cf776..dc249a0 100644 --- a/src/ducktools/pythonfinder/shared.py +++ b/src/ducktools/pythonfinder/shared.py @@ -51,13 +51,6 @@ FULL_PY_VER_RE = r"(?P\d+)\.(?P\d+)\.?(?P\d*)-?(?Pa|b|c|rc)?(?P\d*)?" -UV_PYTHON_RE = ( - r"(?P[a-zA-Z]+)" - r"-(?P\d+\.\d+\.\d*[a-zA-Z]*\d*)\+?(?P.*?)?" - r"-(?P\w*)" - r"-(?P\w*)" - r"-.*" -) # Cache for runtime details # Code to work out where to store data diff --git a/tests/test_uv_finder.py b/tests/test_uv_finder.py index 263df48..0708ed1 100644 --- a/tests/test_uv_finder.py +++ b/tests/test_uv_finder.py @@ -33,7 +33,6 @@ import pytest from ducktools.pythonfinder.shared import ( - UV_PYTHON_RE, get_uv_python_path, get_uv_pythons, ) @@ -153,13 +152,3 @@ def test_finds_installed_pypy(self, uv_pythondir, temp_finder): assert pythons[0].implementation == "pypy" assert pythons[0].implementation_version >= (7, 3, 17) assert pythons[0].managed_by == "Astral" - - -def test_regex_matches(): - example_312 = "cpython-3.12.7-windows-x86_64-none" - match = re.match(UV_PYTHON_RE, example_312) - assert match.groups() == ("cpython", "3.12.7", "", "windows", "x86_64") - - example_313t = "cpython-3.13.0+freethreaded-windows-x86_64-none" - match = re.match(UV_PYTHON_RE, example_313t) - assert match.groups() == ("cpython", "3.13.0", "freethreaded", "windows", "x86_64") From d6070c58eecd53f052da34a5df45e7f1a9809d74 Mon Sep 17 00:00:00 2001 From: David C Ellis Date: Sat, 28 Feb 2026 18:32:24 +0000 Subject: [PATCH 2/2] Ignore the new UV symlink python folders --- src/ducktools/pythonfinder/shared.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ducktools/pythonfinder/shared.py b/src/ducktools/pythonfinder/shared.py index dc249a0..c7cad42 100644 --- a/src/ducktools/pythonfinder/shared.py +++ b/src/ducktools/pythonfinder/shared.py @@ -567,6 +567,7 @@ def get_uv_pythons(finder=None) -> Iterator[PythonInstall]: for f in fld: if ( f.is_dir() + and not f.is_symlink() and (install := _implementation_from_uv_dir(f, finder=finder)) ): yield install