Skip to content

Commit 8d4e28e

Browse files
committed
Remove Python install dir before downloading to priv
1 parent 01fc41d commit 8d4e28e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/pythonx/uv.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,24 @@ defmodule Pythonx.Uv do
1313
opts = Keyword.validate!(opts, force: false)
1414

1515
project_dir = project_dir(pyproject_toml, priv?)
16+
python_install_dir = python_install_dir(priv?)
1617

1718
if opts[:force] || priv? do
1819
_ = File.rm_rf(project_dir)
1920
end
2021

22+
if priv? do
23+
_ = File.rm_rf(python_install_dir)
24+
end
25+
2126
if not File.dir?(project_dir) do
2227
File.mkdir_p!(project_dir)
2328
File.write!(Path.join(project_dir, "pyproject.toml"), pyproject_toml)
2429

2530
# We always use uv-managed Python, so the paths are predictable.
2631
if run!(["sync", "--python-preference", "only-managed"],
2732
cd: project_dir,
28-
env: %{"UV_PYTHON_INSTALL_DIR" => python_install_dir(priv?)}
33+
env: %{"UV_PYTHON_INSTALL_DIR" => python_install_dir}
2934
) != 0 do
3035
_ = File.rm_rf(project_dir)
3136
raise "fetching Python and dependencies failed, see standard output for details"

0 commit comments

Comments
 (0)