How to use the resolvelib.ResolutionImpossible function in resolvelib

To help you get started, we’ve selected a few resolvelib 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 sarugaku / resolvelib / tests / functional / cocoapods / test_resolvers_cocoapods.py View on Github external
def test_resolver(provider, base_reporter):
    resolver = Resolver(provider, base_reporter)

    if provider.expected_conflicts:
        with pytest.raises(ResolutionImpossible) as ctx:
            result = resolver.resolve(provider.root_requirements)
            print(_format_resolution(result))  # Provide some debugging hints.
        assert _format_conflicts(ctx.value) == provider.expected_conflicts
    else:
        result = resolver.resolve(provider.root_requirements)
        assert _format_resolution(result) == provider.expected_resolution
github pypa / pipenv / pipenv / vendor / passa / operations / lock.py View on Github external
def lock(locker):
    success = False
    try:
        locker.lock()
    except NoVersionsAvailable as e:
        print("\nCANNOT RESOLVE. NO CANDIDATES FOUND FOR:")
        print("{:>40}".format(e.requirement.as_line(include_hashes=False)))
        if e.parent:
            line = e.parent.as_line(include_hashes=False)
            print("{:>41}".format("(from {})".format(line)))
        else:
            print("{:>41}".format("(user)"))
    except ResolutionImpossible as e:
        print("\nCANNOT RESOLVE.\nOFFENDING REQUIREMENTS:")
        for r in e.requirements:
            print_requirement(r)
    else:
        success = True
    return success
github sarugaku / passa / src / passa / operations / lock.py View on Github external
def lock(locker):
    success = False
    try:
        locker.lock()
    except NoVersionsAvailable as e:
        print("\nCANNOT RESOLVE. NO CANDIDATES FOUND FOR:")
        print("{:>40}".format(e.requirement.as_line(include_hashes=False)))
        if e.parent:
            line = e.parent.as_line(include_hashes=False)
            print("{:>41}".format("(from {})".format(line)))
        else:
            print("{:>41}".format("(user)"))
    except ResolutionImpossible as e:
        print("\nCANNOT RESOLVE.\nOFFENDING REQUIREMENTS:")
        for r in e.requirements:
            print_requirement(r)
    else:
        success = True
    return success
github sarugaku / resolvelib / play / resolve.py View on Github external
_print_title(' User requirements ')
for r in requirements:
    _print_requirement(r)


r = Resolver(RequirementsLibProvider(requirements), StdOutReporter())
try:
    state = r.resolve(requirements)
except NoVersionsAvailable as e:
    print('\nCANNOT RESOLVE. NO CANDIDATES FOUND FOR:')
    print('{:>40}'.format(e.requirement.as_line()))
    if e.parent:
        print('{:>41}'.format('(from {})'.format(e.parent.as_line())))
    else:
        print('{:>41}'.format('(root dependency)'))
except ResolutionImpossible as e:
    print('\nCANNOT RESOLVE.\nOFFENDING REQUIREMENTS:')
    for r in e.requirements:
        _print_requirement(r)
else:
    _print_title(' STABLE PINS ')
    for k in sorted(state.mapping):
        _print_dependency(state, k)

print()