mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-09-10 02:35:55 +00:00
[build] Harden build/release workflows (#16358)
Challenge Tests / Challenge Tests (ubuntu-latest, 3.10) (push) Has been cancelled
Challenge Tests / Challenge Tests (ubuntu-latest, 3.11) (push) Has been cancelled
Challenge Tests / Challenge Tests (ubuntu-latest, 3.12) (push) Has been cancelled
Challenge Tests / Challenge Tests (ubuntu-latest, 3.13) (push) Has been cancelled
Challenge Tests / Challenge Tests (ubuntu-latest, 3.14) (push) Has been cancelled
Challenge Tests / Challenge Tests (ubuntu-latest, pypy-3.11) (push) Has been cancelled
Challenge Tests / Challenge Tests (windows-latest, 3.10) (push) Has been cancelled
Challenge Tests / Challenge Tests (windows-latest, 3.11) (push) Has been cancelled
Challenge Tests / Challenge Tests (windows-latest, 3.12) (push) Has been cancelled
Challenge Tests / Challenge Tests (windows-latest, 3.13) (push) Has been cancelled
Challenge Tests / Challenge Tests (windows-latest, 3.14) (push) Has been cancelled
Challenge Tests / Challenge Tests (windows-latest, pypy-3.11) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Core Tests / Core Tests (ubuntu-latest, 3.11) (push) Has been cancelled
Core Tests / Core Tests (ubuntu-latest, 3.12) (push) Has been cancelled
Core Tests / Core Tests (ubuntu-latest, 3.13) (push) Has been cancelled
Core Tests / Core Tests (ubuntu-latest, 3.14) (push) Has been cancelled
Core Tests / Core Tests (ubuntu-latest, pypy-3.11) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.10) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.11) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.12) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.13) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.14) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, pypy-3.11) (push) Has been cancelled
Quick Test / Core Test (push) Has been cancelled
Quick Test / Code check (push) Has been cancelled
Release (master) / Publish Github release (push) Has been cancelled
Test and lint workflows / Check workflows (push) Has been cancelled
Test and lint workflows / Run zizmor (push) Has been cancelled
Release (master) / Publish to PyPI (push) Has been cancelled
Release (nightly) / Check for new commits (push) Has been cancelled
Release (nightly) / Publish Github release (push) Has been cancelled
Release (nightly) / Publish to PyPI (push) Has been cancelled
Challenge Tests / Challenge Tests (ubuntu-latest, 3.10) (push) Has been cancelled
Challenge Tests / Challenge Tests (ubuntu-latest, 3.11) (push) Has been cancelled
Challenge Tests / Challenge Tests (ubuntu-latest, 3.12) (push) Has been cancelled
Challenge Tests / Challenge Tests (ubuntu-latest, 3.13) (push) Has been cancelled
Challenge Tests / Challenge Tests (ubuntu-latest, 3.14) (push) Has been cancelled
Challenge Tests / Challenge Tests (ubuntu-latest, pypy-3.11) (push) Has been cancelled
Challenge Tests / Challenge Tests (windows-latest, 3.10) (push) Has been cancelled
Challenge Tests / Challenge Tests (windows-latest, 3.11) (push) Has been cancelled
Challenge Tests / Challenge Tests (windows-latest, 3.12) (push) Has been cancelled
Challenge Tests / Challenge Tests (windows-latest, 3.13) (push) Has been cancelled
Challenge Tests / Challenge Tests (windows-latest, 3.14) (push) Has been cancelled
Challenge Tests / Challenge Tests (windows-latest, pypy-3.11) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Core Tests / Core Tests (ubuntu-latest, 3.11) (push) Has been cancelled
Core Tests / Core Tests (ubuntu-latest, 3.12) (push) Has been cancelled
Core Tests / Core Tests (ubuntu-latest, 3.13) (push) Has been cancelled
Core Tests / Core Tests (ubuntu-latest, 3.14) (push) Has been cancelled
Core Tests / Core Tests (ubuntu-latest, pypy-3.11) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.10) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.11) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.12) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.13) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.14) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, pypy-3.11) (push) Has been cancelled
Quick Test / Core Test (push) Has been cancelled
Quick Test / Code check (push) Has been cancelled
Release (master) / Publish Github release (push) Has been cancelled
Test and lint workflows / Check workflows (push) Has been cancelled
Test and lint workflows / Run zizmor (push) Has been cancelled
Release (master) / Publish to PyPI (push) Has been cancelled
Release (nightly) / Check for new commits (push) Has been cancelled
Release (nightly) / Publish Github release (push) Has been cancelled
Release (nightly) / Publish to PyPI (push) Has been cancelled
Authored by: bashonly, Grub4K Co-authored-by: Simon Sawicki <[email protected]>
This commit is contained in:
co-authored by
Simon Sawicki
parent
f01e1a1ced
commit
87eaf886f5
@@ -25,8 +25,8 @@ def parse_args():
|
||||
'-e', '--exclude-dependency', metavar='DEPENDENCY', action='append',
|
||||
help='exclude a dependency (can be used multiple times)')
|
||||
parser.add_argument(
|
||||
'-i', '--include-extra', metavar='EXTRA', action='append',
|
||||
help='include an extra/optional-dependencies list (can be used multiple times)')
|
||||
'-i', '--include', '--include-extra', '--include-group', metavar='EXTRA/GROUP', action='append', dest='includes',
|
||||
help='include an extra/group (can be used multiple times)')
|
||||
parser.add_argument(
|
||||
'-c', '--cherry-pick', metavar='DEPENDENCY', action='append',
|
||||
help=(
|
||||
@@ -50,29 +50,41 @@ def uniq(arg) -> dict[str, None]:
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
project_table = parse_toml(read_file(args.input))['project']
|
||||
toml_data = parse_toml(read_file(args.input))
|
||||
project_table = toml_data['project']
|
||||
recursive_pattern = re.compile(rf'{project_table["name"]}\[(?P<extra_name>[\w-]+)\]')
|
||||
extras = project_table['optional-dependencies']
|
||||
groups = toml_data['dependency-groups']
|
||||
|
||||
excludes = uniq(args.exclude_dependency)
|
||||
only_includes = uniq(args.cherry_pick)
|
||||
include_extras = uniq(args.include_extra)
|
||||
includes = uniq(args.includes)
|
||||
|
||||
def yield_deps(extra):
|
||||
def yield_deps_from_extra(extra):
|
||||
for dep in extra:
|
||||
if mobj := recursive_pattern.fullmatch(dep):
|
||||
yield from extras.get(mobj.group('extra_name'), ())
|
||||
else:
|
||||
yield dep
|
||||
|
||||
def yield_deps_from_group(group):
|
||||
for dep in group:
|
||||
if isinstance(dep, dict):
|
||||
yield from yield_deps_from_group(groups[dep['include-group']])
|
||||
else:
|
||||
yield dep
|
||||
|
||||
targets = {}
|
||||
if not args.omit_default:
|
||||
# legacy: 'dependencies' is empty now
|
||||
targets.update(dict.fromkeys(project_table['dependencies']))
|
||||
targets.update(dict.fromkeys(yield_deps(extras['default'])))
|
||||
targets.update(dict.fromkeys(yield_deps_from_extra(extras['default'])))
|
||||
|
||||
for include in filter(None, map(extras.get, include_extras)):
|
||||
targets.update(dict.fromkeys(yield_deps(include)))
|
||||
for include in filter(None, map(extras.get, includes)):
|
||||
targets.update(dict.fromkeys(yield_deps_from_extra(include)))
|
||||
|
||||
for include in filter(None, map(groups.get, includes)):
|
||||
targets.update(dict.fromkeys(yield_deps_from_group(include)))
|
||||
|
||||
def target_filter(target):
|
||||
name = re.match(r'[\w-]+', target).group(0).lower()
|
||||
|
||||
Reference in New Issue
Block a user