为什么tox面临Pytest版本冲突?

2024-09-27 21:26:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我要寻求帮助,因为类似问题的答案[1][2]不能帮助我解决这个问题。你知道吗

tox在本地环境中无错误运行,但在travis ci中,与toxpytest等版本相同,它引发以下异常:

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 --versionshows版本3.7.4,由pip install 'pytest~=3.7.0' --force-reinstalltravis ci setup显式安装。你知道吗


Tags: 答案版本traviscitox环境pytest错误
1条回答
网友
1楼 · 发布于 2024-09-27 21:26:38

Where comes pytest 4.4.0 from?

tox完全独立于pip install 'pytest~=3.7.0' force-reinstall安装

它可以通过将tox环境粘贴到tox.ini中的特定pytest版本来解决

[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.test3.10一起工作。你知道吗

要解决这个问题tox.ini应该约束pytest-remove-stale-bytecode的版本

[py]
deps=
    ...
    pytest-remove-stale-bytecode<3.0.1

相关问题 更多 >

    热门问题