我将寻求帮助,因为对非常相似的问题[1],[2]的回答无法帮助我解决问题。
tox
在我的本地环境中运行无错误,但是在travis ci中具有相同版本的tox
,pytest
等,它引发以下异常:
pluggy.manager.PluginValidationError: Plugin 'removestalebytecode' could not be loaded: (pytest 4.4.0 (XXX/.tox/py35/lib/python3.5/site-packages), Requirement.parse('pytest<3.10'))!
来了 pytest 4.4.0
来自何处?
pytest --version
shows版本3.7.4
,由pip install 'pytest~=3.7.0' --force-reinstall
travis ci setup明确安装。
答案 0 :(得分:0)
pytest 4.4.0来自何处?
tox
完全独立于pip install 'pytest~=3.7.0' --force-reinstall
可以通过将tox
环境坚持到pytest
中特定的tox.ini
版本来解决
[py]
deps=
pytest<3.10
...
它不能解决问题
pluggy.manager.PluginValidationError: Plugin 'removestalebytecode' could not be loaded: (pytest 4.4.0 (XXX/.tox/py35/lib/python3.5/site-packages), Requirement.parse('pytest<3.10'))!
因为当前版本为3.0.1 pytest-remove-stale-bytecode,该插件不适用于py.test
3.10。
要解决此问题,tox.ini
应限制 pytest-remove-stale-bytecode
[py]
deps=
...
pytest-remove-stale-bytecode<3.0.1