Skip to content

Commit

Permalink
FIX: Why
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Dec 19, 2024
1 parent 1449a7d commit 5905947
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/hooks/update_environment_file.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 pathlib import Path

Expand Down Expand Up @@ -86,4 +87,9 @@ def split_dep(dep):
{newline.join(sorted(conda_deps, key=str.casefold))}
{pip_section}""" # noqa: E501

(repo_root / "environment.yml").write_text(env)
env_file = repo_root / "environment.yml"
old_env = env_file.read_text("utf-8")
if old_env != env:
diff = "\n".join(difflib.unified_diff(old_env.splitlines(), env.splitlines()))
env_file.write_text(env, encoding="utf-8")
print(f"Updated {env_file} with diff:\n{diff}")

0 comments on commit 5905947

Please sign in to comment.