From c67fc61cc605811a3b5217a747b8c9349310d283 Mon Sep 17 00:00:00 2001 From: Eli Kogan-Wang Date: Tue, 7 May 2024 04:30:44 +0200 Subject: [PATCH] Update symlink to use env_hash instead of env_dir --- src/appenv.py | 2 +- tests/test_prepare.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/appenv.py b/src/appenv.py index c60dffe..74adac4 100755 --- a/src/appenv.py +++ b/src/appenv.py @@ -377,7 +377,7 @@ def prepare(self, args=None, remaining=None): os.unlink(current_path) except FileNotFoundError: pass - os.symlink(env_dir, current_path) + os.symlink(env_hash, current_path) self.env_dir = env_dir diff --git a/tests/test_prepare.py b/tests/test_prepare.py index edb0110..e8b37c1 100644 --- a/tests/test_prepare.py +++ b/tests/test_prepare.py @@ -25,4 +25,5 @@ def test_prepare_creates_venv_symlink(workdir, monkeypatch): env.update_lockfile() env.prepare() assert os.path.islink(os.path.join(env.appenv_dir, "current")) - assert os.readlink(os.path.join(env.appenv_dir, "current")) == env.env_dir + assert (os.path.realpath(os.path.join( + env.appenv_dir, "current")) == os.path.realpath(env.env_dir))