I updated my checkout of pip, because it should be a lot easier to work with now, on account of the lack of Python 2 compatibility requirement. Yes, I forked it that long ago, and just studied it for months.
Anyway, I'm going to complain about git for a sec.
I had some unstaged changes on top of the commit that introduces the tests I wrote. I wanted those out of the way while I rebased, so I used git stash, and got everything updated. Far and away not the worst rebase I've done. Anyway, the documentation of git stash pop states "do the inverse operation of git stash push". git stash push is the interpretation of git stash on its own. So, I pop my stash of unstaged modifications, and it stages them‽ What kind of inverse is that? The documentation goes and builds up a small mental model that immediately breaks down when confronted by reality.
I haven't used Mercurial's Shelve extension, but I feel confident in stating that it can't be confusing in that particular way, because staging changes isn't a thing in Mercurial.
Anyway, I'm thinking again about how to compare Candidates against Link data. I think I was wrong yesterday about constructing the ExplicitRequirements, because the Constraint object lacks the context required to do that. The more I think about this, the more I think it needs to be a new method added to the Candidate interface.
Here's how I think this should work:
- A RequiresPythonCandidate does not match any Link.
- An ExtrasCandidate must defer to its BaseCandidate.
- The remaining questions are, how to deal with the other types.
- It seems to me that the constraint level shouldn't be mandating editable or not, so it should be possible to just define the implementation in the base class, so the only question that remains is:
- How to test this for an AlreadyInstalledCandidate, which doesn't have a link field, and has source_link as None by design. It does have a Distribution value, which has a location field, which appears to be a URL. It might not be the URL I want; I'm not sure, and I'll need to investigate.
I'll get on that within the next few days. For now, it's too late at night, again.