mirror of
https://github.com/daylinmorgan/viv.git
synced 2024-11-09 19:13:14 -06:00
refactor: make hash generation match standalone method
This commit is contained in:
parent
d367571957
commit
992d039285
1 changed files with 7 additions and 6 deletions
|
@ -333,14 +333,15 @@ def get_hash(spec: Tuple[str, ...] | List[str], track_exe: bool = False) -> str:
|
||||||
Returns:
|
Returns:
|
||||||
sha256 representation of dependencies for vivenv
|
sha256 representation of dependencies for vivenv
|
||||||
"""
|
"""
|
||||||
pkg_hash = hashlib.sha256()
|
|
||||||
pkg_hash.update(str(spec).encode())
|
|
||||||
|
|
||||||
# generate unique venvs for unique python exe's
|
sha256 = hashlib.sha256()
|
||||||
if track_exe:
|
sha256.update(
|
||||||
pkg_hash.update(str(Path(sys.executable).resolve()).encode())
|
(
|
||||||
|
str(spec) + (str(Path(sys.executable).resolve()) if track_exe else "N/A")
|
||||||
|
).encode()
|
||||||
|
)
|
||||||
|
|
||||||
return pkg_hash.hexdigest()
|
return sha256.hexdigest()
|
||||||
|
|
||||||
|
|
||||||
class ViVenv:
|
class ViVenv:
|
||||||
|
|
Loading…
Reference in a new issue