Skip to content

Commit

Permalink
FIX: When
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Dec 21, 2024
1 parent 94b8195 commit 2fd6774
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/hooks/sync_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# License: BSD-3-Clause
# Copyright the MNE-Python contributors.

import difflib
import re
from importlib.metadata import metadata
from pathlib import Path
Expand Down Expand Up @@ -92,4 +93,9 @@ def _prettify_pin(pin):
skip = False
if not skip:
out_lines.append(line)
README_PATH.write_text("\n".join(out_lines) + "\n", encoding="utf-8")
new = "\n".join(out_lines) + "\n"
old = README_PATH.read_text("utf-8")
if new != old:
diff = "\n".join(difflib.unified_diff(old.splitlines(), new.splitlines()))
print(f"Updating {README_PATH} with diff:\n{diff}")
README_PATH.write_text(new, encoding="utf-8")

0 comments on commit 2fd6774

Please sign in to comment.