Commit b501f9a6 by Sébastien Eustace

Fix Python requirements when resolving lock

parent 32211b03
...@@ -275,10 +275,6 @@ class Provider: ...@@ -275,10 +275,6 @@ class Provider:
else: else:
dependencies = package.requires 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): if not self._package.python_constraint.allows_any(package.python_constraint):
return [ return [
Incompatibility( Incompatibility(
...@@ -295,6 +291,14 @@ class Provider: ...@@ -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 [ return [
Incompatibility( Incompatibility(
[Term(package.to_dependency(), True), Term(dep, False)], [Term(package.to_dependency(), True), Term(dep, False)],
...@@ -316,7 +320,7 @@ class Provider: ...@@ -316,7 +320,7 @@ class Provider:
for r in package.requires for r in package.requires
if r.is_activated() if r.is_activated()
and self._package.python_constraint.allows_any(r.python_constraint) 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 # Searching for duplicate dependencies
......
...@@ -8,18 +8,6 @@ python-versions = "*" ...@@ -8,18 +8,6 @@ python-versions = "*"
platform = "*" platform = "*"
[[package]] [[package]]
name = "B"
version = "1.1"
description = ""
category = "main"
optional = false
python-versions = "*"
platform = "*"
[package.requirements]
python = "~2.4"
[[package]]
name = "C" name = "C"
version = "1.3" version = "1.3"
description = "" description = ""
...@@ -56,6 +44,5 @@ content-hash = "123456789" ...@@ -56,6 +44,5 @@ content-hash = "123456789"
[metadata.hashes] [metadata.hashes]
A = [] A = []
B = []
C = [] C = []
D = [] 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