File: update_helptext.py

package info (click to toggle)
smart-open 7.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 980 kB
  • sloc: python: 8,054; sh: 90; makefile: 14
file content (16 lines) | stat: -rwxr-xr-x 480 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python3
"""Write out help.txt based on the current codebase."""

import subprocess
from pathlib import Path

# get the latest helptext
helptext = subprocess.check_output(
    ["/usr/bin/env", "python3", "-c", 'help("smart_open")'],
    text=True,
).strip()

# remove the user-specific FILE and VERSION section at the bottom to make this script reproducible
lines = helptext.splitlines()[:-5]

Path("help.txt").write_text("\n".join(line.rstrip() for line in lines))