I've been trying to install a package with the following setup configured:
setup(
    packages=find_packages(),
    include_package_data=True,
    install_requires=[
        'Django==1.5.1',
        'xhtml2pdf',
    ],
    dependency_links=[
        'https://github.com/chrisglass/xhtml2pdf/zipball/28d12fcaafc4c47b13f1f6f42c2bfb73f90cc947#egg=xhtml2pdf',
    ],
)
However it installs the XHTML2PDF package from PyPi, instead of using the specified link. According to the output (I ran the install using pip install -vvv package.tar.gz), it could either not parse the version from the link (at // 1 in code), or I've not specified the correct project name (at // 2 in code):
Downloading/unpacking xhtml2pdf (from mypackage==1.3)
  Getting page https://pypi.python.org/simple/xhtml2pdf/
  URLs to search for versions for xhtml2pdf (from mypackage==1.3):
  * https://pypi.python.org/simple/xhtml2pdf/
  * https://github.com/chrisglass/xhtml2pdf/zipball/28d12fcaafc4c47b13f1f6f42c2bfb73f90cc947#egg=xhtml2pdf
  Getting page https://github.com/chrisglass/xhtml2pdf/zipball/28d12fcaafc4c47b13f1f6f42c2bfb73f90cc947
  Analyzing links from page https://pypi.python.org/simple/xhtml2pdf/
    Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.1.tar.gz#md5=9f83a2bcb67858aca9e058761f3bea7b (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.1
    Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.2.tar.gz#md5=d640ccb9470942fd2e6d3ae740c27dc1 (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.2
    Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.1.zip#md5=4ad41c845735ae14da99085311d84c00 (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.1
    Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.4.zip#md5=5f035cd6532bef99b7d35054caaa6ef7 (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.4
    Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.3.zip#md5=32599c74f26f57ebd002765741ec64f7 (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.3
    Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.2.zip#md5=4047a8234eb6b77591d526dcb1f60161 (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.2
    Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.3.tar.gz#md5=13b0d6059b72c994473fddfa7a528451 (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.3
    Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.5.zip#md5=8db99aae8536436a2b7b0b3987197b99 (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.5
    Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.5.tar.gz#md5=1ef268b40c11bf966f7c6c5504299e3e (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.5
    Found link https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.4.tar.gz#md5=36b015a4e2918460711cbc5eebe026ce (from https://pypi.python.org/simple/xhtml2pdf/), version: 0.0.4
  Analyzing links from page https://codeload.github.com/chrisglass/xhtml2pdf/legacy.zip/28d12fcaafc4c47b13f1f6f42c2bfb73f90cc947
  Could not parse version from link: https://github.com/chrisglass/xhtml2pdf/zipball/28d12fcaafc4c47b13f1f6f42c2bfb73f90cc947#egg=xhtml2pdf  // 1
  Skipping link https://github.com/chrisglass/xhtml2pdf/zipball/28d12fcaafc4c47b13f1f6f42c2bfb73f90cc947#egg=xhtml2pdf; wrong project name (not xhtml2pdf)  // 2
  Using version 0.0.5 (newest of versions: 0.0.5, 0.0.5, 0.0.4, 0.0.4, 0.0.3, 0.0.3, 0.0.2, 0.0.2, 0.0.1, 0.0.1)
  Downloading xhtml2pdf-0.0.5.zip (118kB): 
  Downloading from URL https://pypi.python.org/packages/source/x/xhtml2pdf/xhtml2pdf-0.0.5.zip#md5=8db99aae8536436a2b7b0b3987197b99 (from https://pypi.python.org/simple/xhtml2pdf/)
...Downloading xhtml2pdf-0.0.5.zip (118kB): 118kB downloaded
If I add the version number to the package (xhtml2pdf-0.0.5) in both install_requires and dependency_links it finds the Git links and doesn't complain about them, but still installs from PyPi.
I've been searching for an answer for a while now, but haven't been able to find the solution. I need the Git version, because it has fixes that the PyPi version doesn't have yet.
 
    