File: update_requirements.py

package info (click to toggle)
nipype 1.9.2-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,260 kB
  • sloc: python: 156,463; javascript: 9,246; tcl: 608; sh: 485; makefile: 168
file content (18 lines) | stat: -rwxr-xr-x 466 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python3
from runpy import run_path
from pathlib import Path

repo_root = Path(__file__).parent.parent
info_file = repo_root / "nipype" / "info.py"
reqs = repo_root / "requirements.txt"

info = run_path(info_file)
requirements = info["REQUIRES"]

script_name = Path(__file__).relative_to(repo_root)

lines = [f"# Auto-generated by {script_name}", ""]

# Write requirements
lines[1:-1] = requirements
reqs.write_text("\n".join(lines), encoding='utf-8')