我最终做了一些与stackoverflow.com/a/17442663/368102中的答案非常相似的事情。
我需要一个与PyPi 中requests-file
的不同包名称冲突的 github 包。requests-file
它们都有 1.0 版本,而 PyPi 版本有一些更高的版本。
我的解决方法ias_tools/setup.py
如下所示:
setup(
...
install_requires=[
'requests-file<=99.99',
],
dependency_links=[
'https://github.com/jvantuyl/requests-file/archive/b0a7b34af6e287e07a96bc7e89bac3bc855323ae.zip#egg=requests-file-99.99'
]
)
就我而言,我正在使用pip
,所以我也不得不使用--process-dependency-links
:
% pip install --process-dependency-links ./ias_tools
You are using pip version 6.0.6, however version 6.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Processing ./ias_tools
DEPRECATION: Dependency Links processing has been deprecated and will be removed in a future release.
Collecting requests-file<=99.99 (from ias-tools==0.1)
Downloading https://github.com/jvantuyl/requests-file/archive/b0a7b34af6e287e07a96bc7e89bac3bc855323ae.zip
Requirement already satisfied (use --upgrade to upgrade): requests>=1.1.0 in ./venv/lib/python2.7/site-packages (from requests-file<=99.99->ias-tools==0.1)
Installing collected packages: ias-tools, requests-file
Running setup.py install for ias-tools
Running setup.py install for requests-file
Successfully installed ias-tools-0.1 requests-file-1.0
我不太担心弃用通知,因为向 pip 提交了一个拉取请求以弃用弃用(在讨论之后)。