Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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()
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
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