How to use the resolvelib.NoVersionsAvailable 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 / play / resolve.py View on Github external
if changed:
            print('Changed pins:')
            for k in changed:
                _print_dependency(state, k)
        print()


_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()
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 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