Skip to content

Commit

Permalink
[platform] Fix venv site-packages path
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba2k2 committed Sep 8, 2023
1 parent 1475b6d commit 8bcb473
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion builder/python-venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import site
import subprocess
import sys
from pathlib import Path

import semantic_version
Expand Down Expand Up @@ -42,13 +43,21 @@ def env_configure_python_venv(env: Environment):
"Scripts" if IS_WINDOWS else "bin",
"python" + (".exe" if IS_WINDOWS else ""),
)
site_path = venv_path.joinpath(
"Lib" if IS_WINDOWS else "lib",
"." if IS_WINDOWS else f"python{sys.version_info[0]}.{sys.version_info[1]}",
"site-packages",
)

assert (
python_path.is_file()
), f"Error: Missing Python executable file `{python_path.absolute()}`"
assert (
site_path.is_dir()
), f"Error: Missing site-packages directory `{site_path.absolute()}`"

env.Replace(LTPYTHONEXE=python_path.absolute(), LTPYTHONENV=venv_path.absolute())
site.addsitedir(str(venv_path.absolute()))
site.addsitedir(str(site_path.absolute()))


def env_install_python_dependencies(env: Environment, dependencies: dict):
Expand Down

0 comments on commit 8bcb473

Please sign in to comment.