Commit b501f9a6 by Sébastien Eustace

Fix Python requirements when resolving lock

parent 32211b03
......@@ -275,10 +275,6 @@ class Provider:
else:
dependencies = package.requires
dependencies = [
dep for dep in dependencies if dep.name not in self.UNSAFE_PACKAGES
]
if not self._package.python_constraint.allows_any(package.python_constraint):
return [
Incompatibility(
......@@ -295,6 +291,14 @@ class Provider:
)
]
dependencies = [
dep
for dep in dependencies
if dep.name not in self.UNSAFE_PACKAGES
and self._package.python_constraint.allows_any(dep.python_constraint)
and self._package.platform_constraint.matches(dep.platform_constraint)
]
return [
Incompatibility(
[Term(package.to_dependency(), True), Term(dep, False)],
......@@ -316,7 +320,7 @@ class Provider:
for r in package.requires
if r.is_activated()
and self._package.python_constraint.allows_any(r.python_constraint)
and self._package.platform_constraint.matches(package.platform_constraint)
and self._package.platform_constraint.matches(r.platform_constraint)
]
# Searching for duplicate dependencies
......
......@@ -8,18 +8,6 @@ python-versions = "*"
platform = "*"
[[package]]
name = "B"
version = "1.1"
description = ""
category = "main"
optional = false
python-versions = "*"
platform = "*"
[package.requirements]
python = "~2.4"
[[package]]
name = "C"
version = "1.3"
description = ""
......@@ -56,6 +44,5 @@ content-hash = "123456789"
[metadata.hashes]
A = []
B = []
C = []
D = []
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment