File: audit_wheel_wrapper.py

package info (click to toggle)
python-sdbus 0.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 980 kB
  • sloc: python: 7,783; ansic: 2,524; makefile: 9; sh: 4
file content (27 lines) | stat: -rw-r--r-- 732 bytes parent folder | download | duplicates (3)
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
# SPDX-License-Identifier: MPL-2.0
# SPDX-FileCopyrightText: 2024 igo95862
from __future__ import annotations

from argparse import ArgumentParser
from unittest.mock import patch

from auditwheel.main import main as auditwheel_main  # type: ignore


def main(arch: str, wrapped_args: list[str]) -> None:
    with patch("sys.argv", [""] + wrapped_args), patch(
        "platform.machine", return_value=arch
    ):
        auditwheel_main()


if __name__ == "__main__":
    arg_parse = ArgumentParser()
    arg_parse.add_argument(
        "--arch",
        choices=("x86_64", "i686", "aarch64", "armv7l"),
        default="x86_64",
    )
    arg_parse.add_argument("wrapped_args", nargs="*")

    main(**vars(arg_parse.parse_args()))