Skip to content

Commit

Permalink
Ensure uv knows caller Python (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat authored Aug 8, 2024
1 parent fdb8619 commit db35c13
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pre_commit_uv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def _install_environment(
py = python.norm_version(version)
if py is not None:
venv_cmd.extend(("-p", py))
cmd_output_b(*venv_cmd, cwd="/")
env = os.environ.copy()
env["UV_INTERNAL__PARENT_INTERPRETER"] = sys.executable
cmd_output_b(*venv_cmd, cwd="/", env=env)

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

0 comments on commit db35c13

Please sign in to comment.