File size: 1,060 Bytes
90884df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""Trusted source launcher for Music 3 evidence operations."""

from __future__ import annotations

import argparse
from pathlib import Path
import runpy
import sys


def main(argv: list[str] | None = None) -> int:
    parser = argparse.ArgumentParser(add_help=False)
    parser.add_argument("--project-root", required=True)
    parser.add_argument("--diffusers-root", required=True)
    parser.add_argument("arguments", nargs=argparse.REMAINDER)
    args = parser.parse_args(argv)
    arguments = list(args.arguments)
    if arguments and arguments[0] == "--":
        arguments.pop(0)
    project_root = Path(args.project_root).expanduser().absolute()
    diffusers_root = Path(args.diffusers_root).expanduser().absolute()
    namespace = runpy.run_path(
        project_root / "src" / "music3lab" / "bootstrap.py"
    )
    return int(
        namespace["bootstrap_main"](
            project_root=project_root,
            diffusers_root=diffusers_root,
            argv=arguments,
        )
    )


if __name__ == "__main__":
    raise SystemExit(main())