Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions scripts/populate_tox/populate_tox.py
Original file line number Diff line number Diff line change
Expand Up @@ -1045,36 +1045,6 @@ def _transform_target_python_versions(
return updated


def get_file_hash() -> str:
"""Calculate a hash of the tox.ini file."""
hasher = hashlib.md5()

with open(TOX_FILE, "rb") as f:
buf = f.read()
hasher.update(buf)

return hasher.hexdigest()


def get_last_updated() -> Optional[datetime]:
repo_root = subprocess.run(
["git", "rev-parse", "--show-toplevel"],
capture_output=True,
text=True,
).stdout.strip()
tox_ini_path = Path(repo_root) / "tox.ini"

timestamp = subprocess.run(
["git", "log", "-1", "--pretty=%ct", str(tox_ini_path)],
capture_output=True,
text=True,
).stdout.strip()

timestamp = datetime.fromtimestamp(int(timestamp), timezone.utc)
print(f"Last committed tox.ini update: {timestamp}")
return timestamp


def _normalize_name(package: str) -> str:
# From https://peps.python.org/pep-0503/#normalized-names
# but normalizing to underscores instead of hyphens since tox-formatted packages
Expand Down
Loading