11
我試圖讓一個項目依賴於git依賴。但是,我似乎無法讓它工作。我基本上要實現的是下面的,但它不工作:取決於setup.py中的git存儲庫
#!/usr/bin/env python3
from setuptools import setup
setup(
name='spam',
version='0.0.0',
install_requires=[
'git+https://github.com/remcohaszing/pywakeonlan.git'
])
我嘗試上述幾種變化,如添加@master
或#egg=wakeonlan-0.2.2
,但這並不有所作爲。
下工作,但使用過時pip
標誌時,才--process-dependency-links
:
#!/usr/bin/env python3
from setuptools import setup
setup(
name='spam',
version='0.0.0',
install_requires=[
'wakeonlan'
],
dependency_links=[
'git+https://github.com/remcohaszing/pywakeonlan.git#egg=wakeonlan-0.2.2'
])
此輸出:
$ pip install --no-index -e . --process-dependency-links
Obtaining file:///home/remco/Downloads/spam
DEPRECATION: Dependency Links processing has been deprecated and will be removed in a future release.
Collecting wakeonlan (from spam==0.0.0)
Cloning https://github.com/remcohaszing/pywakeonlan.git to /tmp/pip-build-mkhpjcjf/wakeonlan
DEPRECATION: Dependency Links processing has been deprecated and will be removed in a future release.
Installing collected packages: wakeonlan, spam
Running setup.py install for wakeonlan ... done
Running setup.py develop for spam
Successfully installed spam wakeonlan-0.2.2
下不工作:
pip install 'git+https://github.com/remcohaszing/pywakeonlan.git'
還加入需求文件中的git url正常工作。
是否有任何未棄用方法取決於使用setup.py
文件的git url?
不,該答案建議使用已棄用的dependency_links。 –
一個相關的github問題:https://github.com/pypa/pip/issues/2023 - 但是我還沒有看到解決方案。 – cel
目前,似乎沒有一種不被棄用的方式來做到這一點:\ –