import argparse
import contextlib
-import subprocess
import sys
from datetime import datetime
-from devscripts.utils import read_version, write_file
+from devscripts.utils import read_version, run_process, write_file
def get_new_version(version, revision):
def get_git_head():
with contextlib.suppress(Exception):
- return subprocess.check_output(['git', 'rev-parse', 'HEAD'], text=True).strip() or None
+ return run_process('git', 'rev-parse', 'HEAD').stdout.strip()
VERSION_TEMPLATE = '''\
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Update the version.py file')
parser.add_argument(
- '-c', '--channel', choices=['stable', 'nightly'], default='stable',
+ '-c', '--channel', default='stable',
help='Select update channel (default: %(default)s)')
parser.add_argument(
'-o', '--output', default='yt_dlp/version.py',