1+ import platform
12import stat
23import sys
34from pathlib import Path
@@ -97,11 +98,15 @@ def test_find_python_from_rye_provider(mocked_python, tmp_path, monkeypatch):
9798
9899
99100def test_find_python_from_uv_provider (mocked_python , tmp_path , monkeypatch ):
101+ if platform .system () == "Linux" :
102+ python_root = tmp_path / ".local/share/uv/python"
103+ else : # macos
104+ python_root = tmp_path / "Library/Application Support/uv/python"
100105 python310 = mocked_python .add_python (
101- tmp_path / ".local/share/uv/python/ cpython@3.10.9/install/bin/python3" , "3.10.9"
106+ python_root / "cpython@3.10.9/install/bin/python3" , "3.10.9"
102107 )
103108 python311 = mocked_python .add_python (
104- tmp_path / ".local/share/uv/python/ cpython@3.11.8/bin/python3" , "3.11.8"
109+ python_root / "cpython@3.11.8/bin/python3" , "3.11.8"
105110 )
106111 monkeypatch .setenv ("HOME" , str (tmp_path ))
107112
@@ -112,13 +117,6 @@ def test_find_python_from_uv_provider(mocked_python, tmp_path, monkeypatch):
112117 find_311 = Finder (selected_providers = ["uv" ]).find_all (3 , 11 )
113118 assert python311 in find_311
114119
115- monkeypatch .setenv ("XDG_DATA_HOME" , str (tmp_path / "xdg" ))
116- python310_xdg = mocked_python .add_python (
117- tmp_path / "xdg/uv/python/cpython@3.10.9/install/bin/python3" , "3.10.9"
118- )
119- find_310 = Finder (selected_providers = ["uv" ]).find_all (3 , 10 )
120- assert python310_xdg in find_310
121-
122120 monkeypatch .setenv ("UV_PYTHON_INSTALL_DIR" , str (tmp_path / "uv_dir" ))
123121 python311_uv_dir = mocked_python .add_python (
124122 tmp_path / "uv_dir/cpython@3.11.8/bin/python3" , "3.11.8"
0 commit comments