aboutsummaryrefslogtreecommitdiffstats
path: root/devscripts
diff options
context:
space:
mode:
Diffstat (limited to 'devscripts')
-rwxr-xr-xdevscripts/make_contributing.py2
-rw-r--r--devscripts/make_issue_template.py76
-rw-r--r--[-rwxr-xr-x]devscripts/make_readme.py0
-rw-r--r--devscripts/prepare_manpage.py2
-rw-r--r--devscripts/update-formulae.py39
-rw-r--r--devscripts/update-version.py56
6 files changed, 2 insertions, 173 deletions
diff --git a/devscripts/make_contributing.py b/devscripts/make_contributing.py
index a06f8a616..d74462a3c 100755
--- a/devscripts/make_contributing.py
+++ b/devscripts/make_contributing.py
@@ -20,7 +20,7 @@ def main():
bug_text = re.search(
r'(?s)#\s*BUGS\s*[^\n]*\s*(.*?)#\s*COPYRIGHT', readme).group(1)
dev_text = re.search(
- r'(?s)(#\s*DEVELOPER INSTRUCTIONS.*?)#\s*EMBEDDING yt-dlp', readme).group(1)
+ r'(?s)(#\s*DEVELOPER INSTRUCTIONS.*?)#\s*EMBEDDING YT-DLP', readme).group(1)
out = bug_text + dev_text
diff --git a/devscripts/make_issue_template.py b/devscripts/make_issue_template.py
deleted file mode 100644
index fd964c6c6..000000000
--- a/devscripts/make_issue_template.py
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/usr/bin/env python3
-
-# Allow direct execution
-import os
-import sys
-
-sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-
-
-import re
-
-from devscripts.utils import (
- get_filename_args,
- read_file,
- read_version,
- write_file,
-)
-
-VERBOSE_TMPL = '''
- - type: checkboxes
- id: verbose
- attributes:
- label: Provide verbose output that clearly demonstrates the problem
- options:
- - label: Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- required: true
- - label: Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below
- required: true
- - type: textarea
- id: log
- attributes:
- label: Complete Verbose Output
- description: |
- It should start like this:
- placeholder: |
- [debug] Command-line config: ['-vU', 'test:youtube']
- [debug] Portable config "yt-dlp.conf": ['-i']
- [debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8
- [debug] yt-dlp version %(version)s [9d339c4] (win32_exe)
- [debug] Python 3.8.10 (CPython 64bit) - Windows-10-10.0.22000-SP0
- [debug] Checking exe version: ffmpeg -bsfs
- [debug] Checking exe version: ffprobe -bsfs
- [debug] exe versions: ffmpeg N-106550-g072101bd52-20220410 (fdk,setts), ffprobe N-106624-g391ce570c8-20220415, phantomjs 2.1.1
- [debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
- [debug] Proxy map: {}
- [debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
- Latest version: %(version)s, Current version: %(version)s
- yt-dlp is up to date (%(version)s)
- <more lines>
- render: shell
- validations:
- required: true
-'''.strip()
-
-NO_SKIP = '''
- - type: checkboxes
- attributes:
- label: DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
- description: Fill all fields even if you think it is irrelevant for the issue
- options:
- - label: I understand that I will be **blocked** if I remove or skip any mandatory\\* field
- required: true
-'''.strip()
-
-
-def main():
- fields = {'version': read_version(), 'no_skip': NO_SKIP}
- fields['verbose'] = VERBOSE_TMPL % fields
- fields['verbose_optional'] = re.sub(r'(\n\s+validations:)?\n\s+required: true', '', fields['verbose'])
-
- infile, outfile = get_filename_args(has_infile=True)
- write_file(outfile, read_file(infile) % fields)
-
-
-if __name__ == '__main__':
- main()
diff --git a/devscripts/make_readme.py b/devscripts/make_readme.py
index fad993a19..fad993a19 100755..100644
--- a/devscripts/make_readme.py
+++ b/devscripts/make_readme.py
diff --git a/devscripts/prepare_manpage.py b/devscripts/prepare_manpage.py
index 9b12e71e5..a393d33e1 100644
--- a/devscripts/prepare_manpage.py
+++ b/devscripts/prepare_manpage.py
@@ -20,7 +20,7 @@ from devscripts.utils import (
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
README_FILE = os.path.join(ROOT_DIR, 'README.md')
-PREFIX = r'''%yt-dlp(1)
+PREFIX = r'''%YT-DLP(1)
# NAME
diff --git a/devscripts/update-formulae.py b/devscripts/update-formulae.py
deleted file mode 100644
index e79297f53..000000000
--- a/devscripts/update-formulae.py
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env python3
-
-"""
-Usage: python3 ./devscripts/update-formulae.py <path-to-formulae-rb> <version>
-version can be either 0-aligned (yt-dlp version) or normalized (PyPi version)
-"""
-
-# Allow direct execution
-import os
-import sys
-
-sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-
-
-import json
-import re
-import urllib.request
-
-from devscripts.utils import read_file, write_file
-
-filename, version = sys.argv[1:]
-
-normalized_version = '.'.join(str(int(x)) for x in version.split('.'))
-
-pypi_release = json.loads(urllib.request.urlopen(
- 'https://pypi.org/pypi/yt-dlp/%s/json' % normalized_version
-).read().decode())
-
-tarball_file = next(x for x in pypi_release['urls'] if x['filename'].endswith('.tar.gz'))
-
-sha256sum = tarball_file['digests']['sha256']
-url = tarball_file['url']
-
-formulae_text = read_file(filename)
-
-formulae_text = re.sub(r'sha256 "[0-9a-f]*?"', 'sha256 "%s"' % sha256sum, formulae_text, count=1)
-formulae_text = re.sub(r'url "[^"]*?"', 'url "%s"' % url, formulae_text, count=1)
-
-write_file(filename, formulae_text)
diff --git a/devscripts/update-version.py b/devscripts/update-version.py
deleted file mode 100644
index 9cf8b42e6..000000000
--- a/devscripts/update-version.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/env python3
-
-# Allow direct execution
-import os
-import sys
-
-sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-
-
-import contextlib
-import subprocess
-import sys
-from datetime import datetime
-
-from devscripts.utils import read_version, write_file
-
-
-def get_new_version(revision):
- version = datetime.utcnow().strftime('%Y.%m.%d')
-
- if revision:
- assert revision.isdigit(), 'Revision must be a number'
- else:
- old_version = read_version().split('.')
- if version.split('.') == old_version[:3]:
- revision = str(int((old_version + [0])[3]) + 1)
-
- return f'{version}.{revision}' if revision else version
-
-
-def get_git_head():
- with contextlib.suppress(Exception):
- sp = subprocess.Popen(['git', 'rev-parse', '--short', 'HEAD'], stdout=subprocess.PIPE)
- return sp.communicate()[0].decode().strip() or None
-
-
-VERSION = get_new_version((sys.argv + [''])[1])
-GIT_HEAD = get_git_head()
-
-VERSION_FILE = f'''\
-# Autogenerated by devscripts/update-version.py
-
-__version__ = {VERSION!r}
-
-RELEASE_GIT_HEAD = {GIT_HEAD!r}
-
-VARIANT = None
-
-UPDATE_HINT = None
-'''
-
-write_file('yt_dlp/version.py', VERSION_FILE)
-github_output = os.getenv('GITHUB_OUTPUT')
-if github_output:
- write_file(github_output, f'ytdlp_version={VERSION}\n', 'a')
-print(f'\nVersion = {VERSION}, Git HEAD = {GIT_HEAD}')