1

I have a question about distributing an app I created using a .whl (not to pypi). What I'd like to achieve is being able to do pip install --process-dependency-links my_app.whl. As of now the installation goes as expected on a new virtualenv except for what I define inside the dependency_links. My setup.py looks like this:

setup(
    ...
    install_requires=[
        'Click',
        'flask',
        ....,
        'vertica-python==0.7.3'
    ],
   dependency_links=[
        'https://github.com/lv10/vertica-python/tarball/master/#egg=vertica-python-0.7.3',
    ],
    ...
)

I followed different tutorials and consulted several stackoverflow posts: 1, 2 ,3, 4. However, no matter what I try the --process-dependency-links flag doesn't trigger looking up dependency-links instead the installation process results in the installation of vertica-python from pypi.

I run pip install --process-dependency-links app.whl --verbose to see if there was anything special in verbose mode. This is what I get out (confirmation of the obvious):

 1 location(s) to search for versions of vertica-python:
  * https://pypi.org/simple/vertica-python/
  Getting page https://pypi.org/simple/vertica-python/
  Looking up "https://pypi.org/simple/vertica-python/" in the cache
  Current age based on date: 3376
  Freshness lifetime from max-age: 600
  Freshness lifetime from request max-age: 600
  https://pypi.org:443 "GET /simple/vertica-python/ HTTP/1.1" 304 0
  Analyzing links from page https://pypi.org/simple/vertica-python/
    Found link https://files.pythonhosted.org/packages/8b/31/12613db5e58d080d532027a1689f89fdd0d1d93aed48e4674fa4683eedea/vertica-python-0.1.tar.gz#sha256=716788811f3775e76adfc4642b133a4027208e37a59fad0f8a07de1877ccdbf6 (from https://pypi.org/simple/vertica-python/), version: 0.1
    Found link https://files.pythonhosted.org/packages/33/1b/afbbadcbaa6807268de7df65d97663ee8eded3e3a4b287943dba275588d3/vertica-python-0.1.1.tar.gz#sha256=c2dc17bb8c7c8a15765c69f7295be9c0daa300740f70cb30447094a1c9552da7 (from https://pypi.org/simple/vertica-python/), version: 0.1.1

    ....

    Found link https://files.pythonhosted.org/packages/07/32/d71082d200b865ed2324b4ad4ff9f03af3115485676d2ec1a413573da96b/vertica-python-0.7.2.tar.gz#sha256=28c820ee8fd963d9015d16ee94d847620b1648e30b3f46086d645f2b28057343 (from https://pypi.org/simple/vertica-python/), version: 0.7.2
    Found link https://files.pythonhosted.org/packages/60/f6/71c1151a3fc632c55680f01f1fcbb2fc4e8ef4a86d08bb70fa0e4abf9184/vertica-python-0.7.3.tar.gz#sha256=0171a3bacdae06df4b0153d9da8adf2e591adaee818fdcb7555ff0376e4c8e11 (from https://pypi.org/simple/vertica-python/), version: 0.7.3
    Found link https://files.pythonhosted.org/packages/de/ff/4471f16ea8b9e2699ee530454d7a042a05494979480a22f1d3cd047981aa/vertica-python-0.7.4.tar.gz#sha256=67b7cf6c684ebf3b152947cc80b1e16743d8454ae5fec052420eef343e7a3617 (from https://pypi.org/simple/vertica-python/), version: 0.7.4
    Found link https://files.pythonhosted.org/packages/5a/63/0ddc75273d6437a7163ef69d3ab0670f36616f139fbe06698318b3d40474/vertica_python-0.7.4-py2.py3-none-any.whl#sha256=1869f83717d1a00585a5c6c1d45465757c1438724e4d5c125a8f75f2667b7c83 (from https://pypi.org/simple/vertica-python/), version: 0.7.4
  Using version 0.7.3 (newest of versions: 0.7.3)
  Using cached wheel link: file:///Users/username/Library/Caches/pip/wheels/fe/fe/ae/570b0448732a2e4cf4f929b797df935379a9e59092e42cc0d7/vertica_python-0.7.3-cp36-none-any.whl
  Added vertica-python==0.7.3 from file:///Users/username/Library/Caches/pip/wheels/fe/fe/ae/570b0448732a2e4cf4f929b797df935379a9e59092e42cc0d7/vertica_python-0.7.3-cp36-none-any.whl (from app==0.0.19) to build tracker '/private/var/folders/n9/p_dhgb2s3wg9ypv9nrm8k320n6s9p1/T/pip-req-tracker-eob0khnd'
  Removed vertica-python==0.7.3 from file:///Users/username/Library/Caches/pip/wheels/fe/fe/ae/570b0448732a2e4cf4f929b797df935379a9e59092e42cc0d7/vertica_python-0.7.3-cp36-none-any.whl (from app==0.0.19) from build tracker '/private/var/folders/n9/p_dhgb2s3wg9ypv9nrm8k320n6s9p1/T/pip-req-tracker-eob0khnd'

If I use pip install --process-dependency-links app.whl --find-links=https://github.com/lv10/vertica-python/tarball/master/master.tar.gz#egg=vertica-python-0.7.3 then the forked version is installed, which means dependency_links in setup.py is ignored.

Thanks in advance, I would appreciate a push in the right direction.

lv10
  • 1,469
  • 7
  • 25
  • 46

1 Answers1

0

I suspect that pip is being thrown off by the fact that the dependency link doesn't end in a valid package file extension. Set the URL instead to:

https://github.com/lv10/vertica-python/tarball/master/master.tar.gz#egg=vertica-python-0.7.3
jwodder
  • 54,758
  • 12
  • 108
  • 124
  • thanks for helping me out. I have tried using `...master/master.tar.gz#...` before I gave it a try again, to no avail. I will add the `--verbose` from pip to the question. – lv10 Sep 21 '18 at 20:32
  • using `--find-links` flag with `pip` did install `vertica_python` but I have a few other libraries to install so I do need `--process-dependency-links` to work. Do you have any other suggestion as to why this might be failing? – lv10 Sep 24 '18 at 14:20