Skip to content

Commit 984eacf

Browse files
authored
Merge pull request #54 from DavidCEllis/find-uv-graalpy
Find UV graalpy installs on windows
2 parents 1f1eed9 + 46a5195 commit 984eacf

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/ducktools/pythonfinder/shared.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -502,14 +502,23 @@ def _implementation_from_uv_dir(
502502
direntry: os.DirEntry,
503503
finder: DetailFinder | None = None,
504504
) -> PythonInstall | None:
505-
python_exe = "python.exe" if sys.platform == "win32" else "bin/python"
506-
python_path = os.path.join(direntry, python_exe)
505+
if sys.platform == "win32":
506+
python_paths = [
507+
os.path.join(direntry, "python.exe"),
508+
os.path.join(direntry, "bin/python.exe"), # graalpy
509+
]
510+
else:
511+
python_paths = [
512+
os.path.join(direntry, "bin/python")
513+
]
507514

508515
install: PythonInstall | None = None
509516
finder = DetailFinder() if finder is None else finder
510517

511-
if os.path.exists(python_path):
512-
install = finder.get_install_details(python_path, managed_by="Astral")
518+
for pth in python_paths:
519+
if os.path.exists(pth):
520+
install = finder.get_install_details(pth, managed_by="Astral")
521+
break
513522

514523
return install
515524

0 commit comments

Comments
 (0)