对于持续集成,我们像往常一样在每次推送GitHub后,使用appveyor测试我们的Windows操作系统脚本。测试是针对python 3.5,3.6和3.7启动的。对于3.6和3.7,一切正常。对于3.5,由于没有找到SIP包,测试结果如下:
searching for SIP
Reading https://pypi.python.org/simple/SIP/
No local packages or working download links found for SIP
error: Could not find suitable distribution for Requirement.parse('SIP')
Command exited with code 1
这很奇怪,因为:
Searching for SIP
Reading https://pypi.org/simple/SIP/
Downloading https://files.pythonhosted.org/packages/7a/49/67cc7955baf2ec5b67e141da2ab2a436cbf0f8d7c9fcab54e35df21d056b/sip-4.19.8-cp36-none-win32.whl#sha256=74da4ddd20c5b35c19cda753ce1e8e1f71616931391caeac2de7a1715945c679
Best match: sip 4.19.8
Processing sip-4.19.8-cp36-none-win32.whl
Installing sip-4.19.8-cp36-none-win32.whl to c:\python36\lib\site-packages
Adding sip 4.19.8 to easy-install.pth file
Searching for SIP
Reading https://pypi.org/simple/SIP/
Downloading https://files.pythonhosted.org/packages/89/34/056db01926839dd05f80a08a579ee2f4f6625913b0620580ee580fa05fbf/sip-4.19.8-cp37-none-win32.whl#sha256=1bb10aac55bd5ab0e2ee74b3047aa2016cfa7932077c73f602a6f6541af8cd51
Best match: sip 4.19.8
Processing sip-4.19.8-cp37-none-win32.whl
Installing sip-4.19.8-cp37-none-win32.whl to c:\python37\lib\site-packages
Adding sip 4.19.8 to easy-install.pth file
似乎问题来自于pip install ...
命令和setup (install_requires=...)
命令使用的python setup.py install
方法之间的处理差异。
由于我在python setup.py install
安装命令之前编辑了appveyor.yml文件以使用pip安装所有必需软件包,因此工作正常。
这很快又很脏(我确信通过更好地配置可以做得更优雅和熟练),但它确实有效!
setup.py文件。
info.py文件。
前appveyor.yml文件。
新的appveyor.yml文件。
编辑:可能更快,更清洁。从pip和setuptools之间观察到的差异开始,我观察到构建以一个非常古老的setuptools版本开始:
pip list
Package Version
---------- -------
pip 19.1
setuptools 28.8.0
virtualenv 15.0.1
所以我刚刚对setuptools进行了更新:
pip install --upgrade -vv setuptools
现在一切正常,没有在install_requires中添加两次请求的存储库。
前appveyor.yml文件。
新的appveyor.yml文件。