Skip to content

Commit 9568c77

Browse files
committed
review comments addressed
1 parent 2656e1d commit 9568c77

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

news/13545.bugfix.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Include user-supplied constraints in dependency conflict resolution logs for consistency with error reporting.
1+
Include relevant user-supplied constraints in logs when reporting dependency conflicts.

src/pip/_internal/resolution/resolvelib/provider.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,15 @@ def __init__(
100100
self._upgrade_strategy = upgrade_strategy
101101
self._user_requested = user_requested
102102

103+
@property
104+
def constraints(self) -> dict[str, Constraint]:
105+
"""Public view of user-specified constraints.
106+
107+
Exposes the provider's constraints mapping without encouraging
108+
external callers to reach into private attributes.
109+
"""
110+
return self._constraints
111+
103112
def identify(self, requirement_or_candidate: Requirement | Candidate) -> str:
104113
return requirement_or_candidate.name
105114

src/pip/_internal/resolution/resolvelib/resolver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def resolve(
8787
if "PIP_RESOLVER_DEBUG" in os.environ:
8888
reporter: BaseReporter[Requirement, Candidate, str] = PipDebuggingReporter()
8989
else:
90-
reporter = PipReporter(constraints=provider._constraints)
90+
reporter = PipReporter(constraints=provider.constraints)
9191

9292
resolver: RLResolver[Requirement, Candidate, str] = RLResolver(
9393
provider,

0 commit comments

Comments
 (0)