Skip to content

Commit db35c13

Browse files
authored
Ensure uv knows caller Python (#5)
1 parent fdb8619 commit db35c13

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/pre_commit_uv/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ def _install_environment(
5454
py = python.norm_version(version)
5555
if py is not None:
5656
venv_cmd.extend(("-p", py))
57-
cmd_output_b(*venv_cmd, cwd="/")
57+
env = os.environ.copy()
58+
env["UV_INTERNAL__PARENT_INTERPRETER"] = sys.executable
59+
cmd_output_b(*venv_cmd, cwd="/", env=env)
5860

5961
with python.in_env(prefix, version):
6062
setup_cmd(prefix, (uv, "pip", "install", ".", *additional_dependencies))

0 commit comments

Comments
 (0)