pip install --process-dependency-links app.whl不安装私有存储库(分叉库)

时间:2018-09-20 19:06:36

标签: python pip setuptools setup.py python-wheel

我有一个有关分发使用.whl创建的应用程序(而不是pypi)的问题。我想要实现的是能够做到pip install --process-dependency-links my_app.whl。到目前为止,除了我在dependency_links中定义的内容之外,新的virtualenv上的安装均按预期进行。 我的setup.py看起来像这样:

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',
    ],
    ...
)

我遵循了不同的tutorials,并查阅了一些stackoverflow帖子:1234。但是,无论我尝试使用什么--process-dependency-links标志,都不会触发查找dependency-links,相反,安装过程会导致从pypi安装vertica-python

我运行pip install --process-dependency-links app.whl --verbose来查看详细模式下是否有任何特殊之处。这就是我得到的(显而易见的确认):

 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'

如果我使用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,则将安装分叉版本,这意味着dependency_links中的setup.py将被忽略。

预先感谢,朝正确的方向前进。

1 个答案:

答案 0 :(得分:0)

我怀疑依赖项链接未以有效的软件包文件扩展名结尾这一事实使pip脱颖而出。将网址改为:

https://github.com/lv10/vertica-python/tarball/master/master.tar.gz#egg=vertica-python-0.7.3