in ptr.py [0:0]
def _set_build_env(build_base_path: Optional[Path]) -> Dict[str, str]:
build_environ = environ.copy()
if not build_base_path or not build_base_path.exists():
if build_base_path:
LOG.error(
f"Configured local build env path {build_base_path} does not exist"
)
return build_environ
if build_base_path.exists():
build_env_vars = [
(
("PATH", build_base_path / "Scripts")
if WINDOWS
else ("PATH", build_base_path / "sbin")
),
("C_INCLUDE_PATH", build_base_path / "include"),
("CPLUS_INCLUDE_PATH", build_base_path / "include"),
]
if not WINDOWS:
build_env_vars.append(("PATH", build_base_path / "bin"))
for var_name, value in build_env_vars:
if var_name in build_environ:
build_environ[var_name] = f"{value}:{build_environ[var_name]}"
else:
build_environ[var_name] = str(value)
else:
LOG.error(
f"{build_base_path} does not exist. Not add int PATH + INCLUDE Env variables"
)
return build_environ