Commit 66a48130 by Sébastien Eustace

Fix the detection of the system environment with custom installer

parent c3209550
......@@ -528,6 +528,10 @@ class Installer:
virtualenv.cli_run([str(env_path), "--clear"])
# We add a special file so that Poetry can detect
# its own virtual environment
env_path.joinpath("poetry_env").touch()
return env_path
def make_bin(self, version: str) -> None:
......
......@@ -1011,8 +1011,13 @@ class EnvManager:
"""
prefix, base_prefix = Path(sys.prefix), Path(cls.get_base_prefix())
if not naive:
if prefix.joinpath("poetry_env").exists():
return GenericEnv(base_prefix)
from poetry.locations import data_dir
try:
Path(__file__).relative_to(prefix)
prefix.relative_to(data_dir())
except ValueError:
pass
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment