'Choose one of two URLs where both are candidates for distribution
archives for the same version of a distribution (for example,
.tar.gz vs. zip).
The current implement favours http:// URLs over https://, archives
from PyPI over those from other locations and then the archive name.'

def prefer_url(self, url1, url2):

    result = url2
    if url1:
        s1 = self.score_url(url1)
        s2 = self.score_url(url2)
        if (s1 > s2):
            result = url1
        if (result != url2):
            logger.debug('Not    replacing    %r    with    %r', url1, url2)
        else:
            logger.debug('Replacing    %r    with    %r', url1, url2)
    return result
