From 31909ba97b56d65ef31730d1318317dae04f551a Mon Sep 17 00:00:00 2001 From: luis Date: Wed, 7 Sep 2022 10:56:47 -0400 Subject: [PATCH] closes #1 --- setup.py | 2 +- src/port_env/command.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 13ecc95..f1716dd 100755 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setuptools.setup( name="port_env", - version="0.0.2", + version="0.0.3", author="Moist-Cat", author_email="moistanonpy@gmail.com", description="Make environments portable", diff --git a/src/port_env/command.py b/src/port_env/command.py index c64b51c..5ba7a9a 100644 --- a/src/port_env/command.py +++ b/src/port_env/command.py @@ -34,6 +34,10 @@ def _old_env(activate_path: Path) -> Path: out = exc_cmd("awk", r'BEGIN {FS="\x3D"} /^VIRTUAL_ENV/ {print $2}', activate_path) old_env = Path(out.strip().strip('"').strip("'")) + # see https://github.com/Moist-Cat/port_env/issues/1 + # we are getting old/path/env + # we want old/path -- the root + old_env = old_env.parent assert old_env, "There is no VIRTUAL_ENV variable in your activate script." @@ -93,7 +97,8 @@ def fix_third_party(path, _test=False): def fix_env(path: Path): """Wrapper. Gets the old env and globally replaces it by the new one""" - new_env = path.absolute() + # see #1 + new_env = path.absolute().parent bin_path = path / "bin" activate_path = bin_path / "activate"