Merge pull request #2288 from xavfernandez/fix_dependency_links_log

fix finder debug log for dependency links
(cherry picked from commit 6531a2db3e)
This commit is contained in:
Donald Stufft 2014-12-30 14:06:54 -05:00
parent e7944284ed
commit 841ebe4bfe
3 changed files with 21 additions and 1 deletions

View File

@ -7,6 +7,9 @@
* Fix an issue where using -v would cause an exception saying "TypeError: not
all arguments converted during string formatting".
* Fix an issue where using -v with dependency links would cause an exception
saying ``TypeError: 'InstallationCandidate' object is not iterable``.
**6.0.3 (2014-12-23)**

View File

@ -360,7 +360,7 @@ class PackageFinder(object):
logger.debug(
'dependency_links found: %s',
', '.join([
link.url for p, link, version in dependency_versions
version.location.url for version in dependency_versions
])
)
file_versions = list(

View File

@ -273,6 +273,23 @@ def test_finder_priority_file_over_page(data):
assert link.url.startswith("file://")
def test_finder_deplink():
"""
Test PackageFinder with dependency links only
"""
req = InstallRequirement.from_line('gmpy==1.15', None)
finder = PackageFinder(
[],
[],
process_dependency_links=True,
session=PipSession(),
)
finder.add_dependency_links(
['https://pypi.python.org/packages/source/g/gmpy/gmpy-1.15.zip'])
link = finder.find_requirement(req, False)
assert link.url.startswith("https://pypi"), link
def test_finder_priority_page_over_deplink():
"""
Test PackageFinder prefers page links over equivalent dependency links