Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When working on for tests for #598 (and possibly #571), I noticed when using -U and --find-links together, it would always re-install pkgs and never return "Requirement already up-to-date"
What I found to be the issue was the version sorting in PackageFinder.find_requirement. The sorting was only coincidentally accurate most of the time due to the order the various lists were put together.
There seemed to be an intention in the code to somehow be using the "Inf" object for sorting, but it wasn't actually using it, as best I could tell. In this change, I tried to change as little possible to fulfill the intention of using the Inf object. I did pull the sorting out into a specific method to make it easy to unit test.
Also, I discovered a condition, that would never evaluate to true. I added a FIXME comment.
I am aware that tests are failing with this.
This change seems to be exposing other cases where things were ok only by coincidence. I'll look at that tomorrow.
Posting this in incomplete form to possibly get feedback to make sure I'm not off the track with this change.