diff --git a/src/poetry/puzzle/provider.py b/src/poetry/puzzle/provider.py index e4cefee244e..de0e8d1b782 100644 --- a/src/poetry/puzzle/provider.py +++ b/src/poetry/puzzle/provider.py @@ -631,7 +631,9 @@ def fmt_warning(d: Dependency) -> str: dep_other.set_constraint( dep_other.constraint.intersect(dep_any.constraint) ) - elif not inverted_marker.is_empty(): + elif not inverted_marker.is_empty() and self._python_constraint.allows_any( + get_python_constraint_from_marker(inverted_marker) + ): # if there is no any marker dependency # and the inverted marker is not empty, # a dependency with the inverted union of all markers is required