1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Merge pull request #8039 from uranusjr/new-resolver-reject-constraints-for-now

Block user from unfinished parts of the resolver
This commit is contained in:
Pradyun Gedam 2020-04-13 19:37:36 +05:30 committed by GitHub
commit d49fcab9f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,7 @@ from pip._vendor.packaging.utils import canonicalize_name
from pip._vendor.resolvelib import BaseReporter
from pip._vendor.resolvelib import Resolver as RLResolver
from pip._internal.exceptions import InstallationError
from pip._internal.req.req_set import RequirementSet
from pip._internal.resolution.base import BaseResolver
from pip._internal.resolution.resolvelib.provider import PipProvider
@ -53,6 +54,11 @@ class Resolver(BaseResolver):
def resolve(self, root_reqs, check_supported_wheels):
# type: (List[InstallRequirement], bool) -> RequirementSet
# FIXME: Implement constraints.
if any(r.constraint for r in root_reqs):
raise InstallationError("Constraints are not yet supported.")
provider = PipProvider(
factory=self.factory,
ignore_dependencies=self.ignore_dependencies,
@ -109,7 +115,11 @@ class Resolver(BaseResolver):
# FIXME: This check will fail if there are unbreakable cycles.
# Implement something to forcifully break them up to continue.
assert progressed, "Order calculation stuck in dependency loop."
if not progressed:
raise InstallationError(
"Could not determine installation order due to cicular "
"dependency."
)
sorted_items = sorted(
req_set.requirements.items(),