0
我有一個Python包配置是這樣的:如何從具體GitHub的HTTPS安裝Python包提交ID
# setup.py
from setuptools import setup
setup(
name='python-package-test',
version='0.0.1',
packages=['python-package-test'],
dependency_links=[
# This repo actually exists
'git+https://github.com/nhooey/[email protected]#egg=tendo',
],
install_requires=[
'tendo',
],
)
當我安裝這個包從setup.py
:
$ virtualenv --python=python3 .venv && \
source .venv/bin/activate && \
python setup.py install
$ pip freeze | grep tendo
tendo==0.2.9 # Note that this is the *correct* version
它安裝正確的版本tendo
。
然而,當我在一個Git倉庫上傳這個包,並與pip
安裝:
# The GitHub link doesn't exist as it's private
# and it's different from the repo mentioned above
virtualenv --python=python3 .venv && \
source .venv/bin/activate && \
pip install git+ssh://[email protected]/nhooey/package.git
$ pip freeze | grep tendo
tendo==0.2.8 # Note that this is the *wrong* version
它安裝的tendo
版本錯誤。
爲什麼setup.py
的安裝行爲與pip
+ git
不同?