Skip to content

Commit fee3dee

Browse files
committed
Take the TOOLS_VIRTUALENV_CACHE_SEED environmental variable into account when calculating the virtual environments cache hash.
Fixes #23 Signed-off-by: Pedro Algarvio <[email protected]>
1 parent 61448e8 commit fee3dee

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

changelog/23.improvement.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Take the `TOOLS_VIRTUALENV_CACHE_SEED` environmental variable into account when calculating the virtual environments cache hash.

src/ptscripts/virtualenv.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ def _default_venv_bin_dir(self):
105105
@requirements_hash.default
106106
def __default_requirements_hash(self):
107107
requirements_hash = hashlib.sha256(self.name.encode())
108+
hash_seed = os.environ.get("TOOLS_VIRTUALENV_CACHE_SEED", "")
109+
requirements_hash.update(hash_seed.encode())
108110
if self.requirements:
109111
for requirement in sorted(self.requirements):
110112
requirements_hash.update(requirement.encode())

0 commit comments

Comments
 (0)