direct
preference in resolution doesn't work
#12975
Labels
state: needs discussion
This needs some more discussion
type: bug
A confirmed bug or unintended behavior
Description
I'm trying to write a fix #12973. But it occurred to me that I don't understand what the intention of this preference is. I always assumed it meant "the requirement pointed to a file, url, or VCS".
direct
was added in #10032, but in it there is no discussion ofdirect
beyond the added docstring "Prefer if any of the known requirements is "direct", e.g. points to an explicit URL."I'm fairly confident the code didn't do anything at the time:
get_candidate_lookup
always returns a tuple of(None, None)
,(Candidate, None)
, or(None, InstallRequirement)
. So assuming the simplest case where there is just 1 tuple of(None, None)
we get a tuple:So the candidate could never be None.
But let's assume we actually get a Candidate in the candidate tuple, this represents that resolution has already found a candidate for this requirement, not anything specific about the requirement.
So my question is, is that intentional? And if so, what is the expected benefit to the resolution process? Or is it meant to act like how I assumed it would act?
Code of Conduct
The text was updated successfully, but these errors were encountered: