Skip to content

Commit

Permalink
perf(solver): reduce the number of overrides by avoiding adding dummy…
Browse files Browse the repository at this point in the history
… dependencies if the project's python constraint does not allow any version compatible with the marker of the dependency
  • Loading branch information
radoering authored and neersighted committed May 17, 2022
1 parent 02dbe01 commit ea335b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/poetry/puzzle/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ea335b5

Please sign in to comment.