tox 不更新 "requires" 部分中的依赖项

tox does not update dependency in "requires" section

我有以下 tox.ini 文件:

[tox]
envlist = py36, ...
requires =
    tox-venv
    setuptools==49.2.1 # latest
    ...

[testenv:py36]
deps = ...

运行 好像不错:

tox -e py36
py36 installdeps: setuptools==49.2.1, ...

但是 setuptools 还没有正确安装(这会导致安装 py36 的 deps 时出现问题):

 .tox/py36/bin/pip list
 Package    Version
 ---------- -------
 pip        18.1
 setuptools 40.6.2

相同的诊断 运行 venv 本身:

source .tox/py36/bin/activate
python -c "import setuptools; print(setuptools.version.__version__)"
python -c "import setuptools; print (setuptools.__file__)"
40.6.2
.tox/py36/lib/python3.6/site-packages/setuptools/__init__.py

更奇怪的是,我可以“手动”更新它:

.tox/py36/bin/pip install --upgrade setuptools
Collecting setuptools
  Using cached https://files.pythonhosted.org/.../setuptools-49.2.1-py3-none-any.whl
Installing collected packages: setuptools
  Found existing installation: setuptools 40.6.2
    Uninstalling setuptools-40.6.2:
      Successfully uninstalled setuptools-40.6.2
Successfully installed setuptools-49.2.1

我错过了什么吗?我在 Linux 上使用带有 Python 3.6.10 的 tox 3.18.1。 谢谢。

好吧原来是“tox-venv”要求把事情搞砸了。