File: pip-wrapper

package info (click to toggle)
python-cheroot 10.0.1%2Bds1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,048 kB
  • sloc: python: 6,222; makefile: 15
file content (31 lines) | stat: -rwxr-xr-x 716 bytes parent folder | download | duplicates (2)
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
#! /usr/bin/env python
"""A pip-wrapper that injects platform-specific constraints into pip."""
import sys

from pip_constraint_helpers import (
    get_constraint_file_path,
    get_runtime_python_tag,
    make_pip_cmd,
    run_cmd,
)


def main(argv):
    """Invoke pip with the matching constraints file, if present.

    :param argv: List of command-line arguments.
    """
    constraint_file_path = get_constraint_file_path(
        req_dir=argv[1],
        toxenv=argv[0],
        python_tag=get_runtime_python_tag(),
    )
    pip_cmd = make_pip_cmd(
        pip_args=argv[2:],
        constraint_file_path=constraint_file_path,
    )
    run_cmd(pip_cmd)


if __name__ == '__main__':
    main(sys.argv[1:])