How to use the pipupgrade.cli.format function in pipupgrade

To help you get started, we’ve selected a few pipupgrade examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github achillesrasquinha / pipupgrade / tests / pipupgrade / util / test_string.py View on Github external
def test_strip_ansi():
    assert strip_ansi(cli.format("foobar", cli.GREEN)) == "foobar"
    assert strip_ansi(cli.format("barfoo", cli.BOLD))  == "barfoo"
github achillesrasquinha / pipupgrade / tests / pipupgrade / cli / test_cli_util.py View on Github external
def _assert_format(string, type_):
        assert cli.format(string, type_) == "{}{}{}".format(type_, string, cli.CLEAR)
github achillesrasquinha / pipupgrade / tests / pipupgrade / util / test_string.py View on Github external
def test_strip_ansi():
    assert strip_ansi(cli.format("foobar", cli.GREEN)) == "foobar"
    assert strip_ansi(cli.format("barfoo", cli.BOLD))  == "barfoo"
github achillesrasquinha / pipupgrade / src / pipupgrade / commands / util.py View on Github external
def cli_format(string, type_):
    args = get_args(as_dict = False)
    
    if hasattr(args, "no_color") and not args.no_color:
        string = cli.format(string, type_)

    return string