描述
我将讨论特定的程序包,因为已经在野外发现了这种情况(HypothesisWorks / hypothesis#2113):我们最近将对attrs>=16.0
的install_requires
依赖关系更新为attrs>=19.2
,安装最新版本的假设的基础也将更新用户的属性。
pip install hypothesis
确实可以工作。pip install pytest hypothesis
可以工作。看起来,当一个安装命令中列出了多个软件包时,仅针对列出的第一个软件包评估已安装依赖关系的兼容性,而对于以后的软件包,则检查存在关系而不检查依赖关系的版本。 这也会影响需求文件的使用。
预期行为
无论列出要安装或已经存在的其他软件包, pip install hypothesis
都应该导致安装兼容的软件包集或出现错误消息-而不是损坏的环境。
如何繁殖
[tox]
skipsdist=True
[testenv]
deps =
pip
attrs==19.1.0
commands =
## Execute the problematic install command
# pip install hypothesis # works
# pip install hypothesis pytest # works
pip install pytest hypothesis # fails, as does `pip install attrs hypothesis` !
# pip install --upgrade pytest hypothesis # works
## Check that the installed packages are compatible
python -c "import hypothesis"
然后运行tox --recreate
以重新创建虚拟环境并运行命令。
(感谢所有在pip
,它非常有价值,非常感谢😍)
感谢您提供详细信息并轻松复制! 非常感激!
这基本上是#988。 快速总结:
ERROR
。
ERROR: hypothesis 4.38.2 has requirement attrs>=19.2.0, but you'll have attrs 19.1.0 which is incompatible.
pip check
作为CI的一部分,以确保pip不会做一些愚蠢的事情。pip-tools
(用更好的解析器包扎点)或pipenv
(使用pip-tools
)或poetry
(具有自己的解析器)来避免这种情况点子解析器的怪癖。啊,我明白了! 我检查了问题的最后几页,但没有回过头...很高兴以重复的形式结束此问题,因为我认为它没有任何额外的信息?
关闭为#988的重复项。