Skip to content

Commit 84934fe

Browse files
ref(toxgen): Remove unused get_file_hash() and get_last_updated() helpers (#8173)
1 parent 7ad4e1a commit 84934fe

1 file changed

Lines changed: 0 additions & 30 deletions

File tree

‎scripts/populate_tox/populate_tox.py‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,36 +1045,6 @@ def _transform_target_python_versions(
10451045
return updated
10461046

10471047

1048-
def get_file_hash() -> str:
1049-
"""Calculate a hash of the tox.ini file."""
1050-
hasher = hashlib.md5()
1051-
1052-
with open(TOX_FILE, "rb") as f:
1053-
buf = f.read()
1054-
hasher.update(buf)
1055-
1056-
return hasher.hexdigest()
1057-
1058-
1059-
def get_last_updated() -> Optional[datetime]:
1060-
repo_root = subprocess.run(
1061-
["git", "rev-parse", "--show-toplevel"],
1062-
capture_output=True,
1063-
text=True,
1064-
).stdout.strip()
1065-
tox_ini_path = Path(repo_root) / "tox.ini"
1066-
1067-
timestamp = subprocess.run(
1068-
["git", "log", "-1", "--pretty=%ct", str(tox_ini_path)],
1069-
capture_output=True,
1070-
text=True,
1071-
).stdout.strip()
1072-
1073-
timestamp = datetime.fromtimestamp(int(timestamp), timezone.utc)
1074-
print(f"Last committed tox.ini update: {timestamp}")
1075-
return timestamp
1076-
1077-
10781048
def _normalize_name(package: str) -> str:
10791049
# From https://peps.python.org/pep-0503/#normalized-names
10801050
# but normalizing to underscores instead of hyphens since tox-formatted packages

0 commit comments

Comments
 (0)