MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / generate_homebrew_formula

Function generate_homebrew_formula

tasks/scripts/release.py:371–397  ·  view source on GitHub ↗
(
    *,
    release_tag: str,
    release_dir: Path,
    output: Path,
)

Source from the content-addressed store, hash-verified

369
370
371def generate_homebrew_formula(
372 *,
373 release_tag: str,
374 release_dir: Path,
375 output: Path,
376) -> None:
377 checksums_path = release_dir / "openshell-checksums-sha256.txt"
378 gateway_checksums_path = release_dir / "openshell-gateway-checksums-sha256.txt"
379 checksums = _parse_sha256_file(checksums_path)
380 gateway_checksums = _parse_sha256_file(gateway_checksums_path)
381
382 formula = render_homebrew_formula(
383 release_tag=release_tag,
384 cli_sha256=_required_checksum(checksums, HOMEBREW_CLI_ASSET, checksums_path),
385 gateway_sha256=_required_checksum(
386 gateway_checksums,
387 HOMEBREW_GATEWAY_ASSET,
388 gateway_checksums_path,
389 ),
390 driver_vm_sha256=_required_checksum(
391 checksums,
392 HOMEBREW_DRIVER_VM_ASSET,
393 checksums_path,
394 ),
395 )
396 output.parent.mkdir(parents=True, exist_ok=True)
397 output.write_text(formula, encoding="utf-8")
398
399
400def build_parser() -> argparse.ArgumentParser:

Callers 1

mainFunction · 0.85

Calls 3

_parse_sha256_fileFunction · 0.85
render_homebrew_formulaFunction · 0.85
_required_checksumFunction · 0.85

Tested by

no test coverage detected