def venv_resolve_deps(deps, which, project, pre=False, verbose=False, clear=False, allow_global=False):
    from . import resolver
    import json
    resolver = escape_grouped_arguments(resolver.__file__.rstrip('co'))
    cmd = '{0} {1} {2} {3} {4} {5}'.format(escape_grouped_arguments(which('python')), resolver, ('--pre' if pre else ''), ('--verbose' if verbose else ''), ('--clear' if clear else ''), ('--system' if allow_global else ''))
    os.environ['PIPENV_PACKAGES'] = '\n'.join(deps)
    c = delegator.run(cmd, block=True)
    del os.environ['PIPENV_PACKAGES']
    try:
        assert (c.return_code == 0)
    except AssertionError:
        if verbose:
            click.echo(c.out, err=True)
            click.echo(c.err, err=True)
        else:
            click.echo(c.err[(int((len(c.err) / 2)) - 1):], err=True)
        sys.exit(c.return_code)
    if verbose:
        click.echo(c.out.split('RESULTS:')[0], err=True)
    try:
        return json.loads(c.out.split('RESULTS:')[1].strip())
    except IndexError:
        raise RuntimeError('There was a problem with locking.')
def venv_resolve_deps(deps, which, project, pre=False, verbose=False, clear=False, allow_global=False):
    from . import resolver
    import json
    resolver = escape_grouped_arguments(resolver.__file__.rstrip('co'))
    cmd = '{0} {1} {2} {3} {4} {5}'.format(escape_grouped_arguments(which('python')), resolver, ('--pre' if pre else ), ('--verbose' if verbose else ), ('--clear' if clear else ), ('--system' if allow_global else ))
    os.environ['PIPENV_PACKAGES'] = '\n'.join(deps)
    c = delegator.run(cmd, block=True)
    del os.environ['PIPENV_PACKAGES']
    try:
        assert (c.return_code == 0)
    except AssertionError:
        if verbose:
            click.echo(c.out, err=True)
            click.echo(c.err, err=True)
        else:
            click.echo(c.err[(int((len(c.err) / 2)) - 1):], err=True)
        sys.exit(c.return_code)
    if verbose:
        click.echo(c.out.split('RESULTS:')[0], err=True)
    try:
        return json.loads(c.out.split('RESULTS:')[1].strip())
    except IndexError:
        raise RuntimeError('There was a problem with locking.')