Skip to content

Commit

Permalink
hooks.make-venv: Remove references to native Python in pyvenv.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
adisbladis committed Nov 24, 2024
1 parent fd55c84 commit 4b74b01
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build/hooks/make-venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,12 @@ def fixup_pyvenv(python_root: Path, out_root: Path) -> None:
with open(out_root.joinpath("pyvenv.cfg"), "r") as pyvenv_f:
pyvenv = pyvenv_f.read()

# Replace build-time interpreter references with actual target Python
pyvenv = pyvenv.replace(os.path.dirname(os.path.dirname(sys.executable)), str(python_root))

# If the build Python is a cross Python env also replace references to the native Python bin path
pyvenv = pyvenv.replace(sys.base_prefix, str(python_root))

with open(out_root.joinpath("pyvenv.cfg"), "w") as pyvenv_f:
pyvenv_f.write(pyvenv)

Expand Down

0 comments on commit 4b74b01

Please sign in to comment.