Skip to content

Commit 0f3250e

Browse files
committed
Update docs
1 parent 0f1f5fe commit 0f3250e

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

docs/html/topics/more-dependency-resolution.md

+15-6
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ operations:
132132
* `get_preference` - this provides information to the resolver to help it choose
133133
which requirement to look at "next" when working through the resolution
134134
process.
135+
* `narrow_requirement_selection` - this provides a way to limit the number of
136+
identifiers passed to `get_preference`.
135137
* `find_matches` - given a set of constraints, determine what candidates exist
136138
that satisfy them. This is essentially where the finder interacts with the
137139
resolver.
@@ -140,19 +142,26 @@ operations:
140142
* `get_dependencies` - get the dependency metadata for a candidate. This is
141143
the implementation of the process of getting and reading package metadata.
142144

143-
Of these methods, the only non-trivial one is the `get_preference` method. This
144-
implements the heuristics used to guide the resolution, telling it which
145-
requirement to try to satisfy next. It's this method that is responsible for
146-
trying to guess which route through the dependency tree will be most productive.
147-
As noted above, it's doing this with limited information. See the following
148-
diagram
145+
Of these methods, the only non-trivial ones are the `get_preference` and
146+
`narrow_requirement_selection` methods. These implement heuristics used
147+
to guide the resolution, telling it which requirement to try to satisfy next.
148+
It's these methods that are responsible for trying to guess which route through
149+
the dependency tree will be most productive. As noted above, it's doing this
150+
with limited information. See the following diagram:
149151

150152
![](deps.png)
151153

152154
When the provider is asked to choose between the red requirements (A->B and
153155
A->C) it doesn't know anything about the dependencies of B or C (i.e., the
154156
grey parts of the graph).
155157

158+
Pip's current implementation of the provider implements
159+
`narrow_requirement_selection` as follows:
160+
161+
* If Requires-Python is present only consider that
162+
* If there are causes of resolution conflict (backtrack causes) then
163+
only consider them until there are no longer any resolution conflicts
164+
156165
Pip's current implementation of the provider implements `get_preference` as
157166
follows:
158167

0 commit comments

Comments
 (0)