Exemplo n.º 1
0
def main(args):
    with maybe_transient_venv_dir(args.venv, args.keep) as venv:
        quickstart.setup_virtualenv(venv, use_site=False)
        quickstart.venv_call(venv, 'pip', 'install', '-r', args.template)
        if args.out is None:
            freeze(venv, sys.stdout)
        else:
            with open(args.out, 'w') as out:
                freeze(venv, out)
Exemplo n.º 2
0
def main(args):
    with maybe_transient_venv_dir(args.venv, args.keep) as venv:
        quickstart.setup_virtualenv(venv, use_site=False)
        quickstart.venv_call(venv, 'pip', 'install', '-r', args.template)
        if args.out is None:
            freeze(venv, sys.stdout)
        else:
            with open(args.out, 'w') as out:
                freeze(venv, out)
Exemplo n.º 3
0
def freeze(venv, out):
    """
    this one a frozen requirement file from a virtualenv
    for sanity it adds a comment about the freeze_all script
    """
    print("""\
# this requirement file is autogenerated, please run requirements/freeze_all.py to upgrade correctly

""", file=out)
    quickstart.venv_call(venv,
        'pip', 'freeze',
        stdout=out,
        call=subprocess.check_call)
Exemplo n.º 4
0
def freeze(venv, out):
    """
    this one a frozen requirement file from a virtualenv
    for sanity it adds a comment about the freeze_all script
    """
    print(
        """\
# this requirement file is autogenerated, please run requirements/freeze_all.py to upgrade correctly
# currently requirements/freeze_all.py needs to be executed for both python2 and python3 !
# to upgrade a single package use requirements/freeze_all.py --upgrade-only apackage

""",
        file=out,
    )
    out.flush()  # no print(flush) for py2 support
    quickstart.venv_call(venv, "pip", "freeze", stdout=out, call=subprocess.check_call)
Exemplo n.º 5
0
def main(args):
    with maybe_transient_venv_dir(args.venv, args.keep) as venv:
        quickstart.setup_virtualenv(venv, use_site=False)
        if args.upgrade_only is None:
            quickstart.venv_call(venv, "pip", "install", "-r", args.template)
        elif args.out and args.upgrade_only:
            quickstart.venv_call(venv, "pip", "install", "-r", args.template, "-c", args.out)
            quickstart.venv_call(venv, "pip", "install", "-U", "--no-deps", args.upgrade_only)
        else:
            raise ValueError("can't use stdout as constraint")
        if args.out is None:
            freeze(venv, sys.stdout)
        else:
            with open(args.out, "w") as out:
                freeze(venv, out)