diff --git a/src/ducktools/pythonfinder/shared.py b/src/ducktools/pythonfinder/shared.py index e6cf776..c7cad42 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 @@ -574,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 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")