Skip to content

Commit

Permalink
appease ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed Nov 1, 2023
1 parent 0c45c55 commit ee017c0
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/poetry/puzzle/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,18 +580,18 @@ def complete_package(
# the requirements will be merged.
#
# For instance:
# - enum34; python_version=="2.7"
# - enum34; python_version=="3.3"
# enum34; python_version=="2.7"
# enum34; python_version=="3.3"
#
# will become:
# - enum34; python_version=="2.7" or python_version=="3.3"
# enum34; python_version=="2.7" or python_version=="3.3"
#
# If the duplicate dependencies have different constraints
# we have to split the dependency graph.
#
# An example of this is:
# - pypiwin32 (220); sys_platform == "win32" and python_version >= "3.6"
# - pypiwin32 (219); sys_platform == "win32" and python_version < "3.6"
# pypiwin32 (220); sys_platform == "win32" and python_version >= "3.6"
# pypiwin32 (219); sys_platform == "win32" and python_version < "3.6"
duplicates: dict[str, list[Dependency]] = defaultdict(list)
for dep in dependencies:
duplicates[dep.complete_name].append(dep)
Expand All @@ -617,13 +617,13 @@ def complete_package(
# tell the solver to make new resolutions with specific overrides.
#
# For instance, if the foo (1.2.3) package has the following dependencies:
# - bar (>=2.0) ; python_version >= "3.6"
# - bar (<2.0) ; python_version < "3.6"
# bar (>=2.0) ; python_version >= "3.6"
# bar (<2.0) ; python_version < "3.6"
#
# then the solver will need to make two new resolutions
# with the following overrides:
# - {<Package foo (1.2.3): {"bar": <Dependency bar (>=2.0)>}
# - {<Package foo (1.2.3): {"bar": <Dependency bar (<2.0)>}
# {<Package foo (1.2.3): {"bar": <Dependency bar (>=2.0)>}
# {<Package foo (1.2.3): {"bar": <Dependency bar (<2.0)>}

def fmt_warning(d: Dependency) -> str:
dependency_marker = d.marker if not d.marker.is_any() else "*"
Expand Down Expand Up @@ -915,10 +915,10 @@ def _resolve_overlapping_markers(
# This is an edge case where the dependency is not required
# for the resulting marker. However, we have to consider it anyway
# in order to not miss other dependencies later, for instance:
# - foo (1.0) ; python == 3.7
# - foo (2.0) ; python == 3.8
# - bar (2.0) ; python == 3.8
# - bar (3.0) ; python == 3.9
# foo (1.0) ; python == 3.7
# foo (2.0) ; python == 3.8
# bar (2.0) ; python == 3.8
# bar (3.0) ; python == 3.9
# the last dependency would be missed without this,
# because the intersection with both foo dependencies is empty.

Expand Down

0 comments on commit ee017c0

Please sign in to comment.