当我试图在没有互联网连接的情况下运行tox时,它会打印以下错误消息:
py3 inst-nodeps: mypackage/.tox/.tmp/package/1/mypackage-0.1.1.dev0.tar.gz
ERROR: invocation failed (exit code 1), logfile: mypackage/.tox/py3/log/py3-12.log
=================================================================================== log start ===================================================================================
Processing ./.tox/.tmp/package/1/mypackage-0.1.1.dev0.tar.gz
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbb577c1dc0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flit-core/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbb577c1e50>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flit-core/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbb577c1b20>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flit-core/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbb577c1760>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flit-core/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbb5783fc10>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flit-core/
ERROR: Could not find a version that satisfies the requirement flit_core<4,>=3.2 (from versions: none)
ERROR: No matching distribution found for flit_core<4,>=3.2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
==================================================================================== log end ====================================================================================
____________________________________________________________________________________ summary ____________________________________________________________________________________
ERROR: py3: InvocationError for command mypackage/.tox/py3/bin/python -m pip install --no-deps -U .tox/.tmp/package/1/mypackage-0.1.1.dev0.tar.gz (exited with code 1)我的tox.ini看起来是这样的:
[tox]
envlist = py3
isolated_build = True
[testenv]
deps =
mypy
pytest
types-appdirs
commands =
mypy src/mypackage tests
pytest使用互联网连接运行毒物测试就像预期的那样。
我尝试了在本期中给我的tox.ini添加以下几行的建议,但似乎没有任何效果,没有互联网连接,我就无法运行毒性测试。
setenv = VIRTUALENV_DOWNLOAD=0
PIP_DISABLE_PIP_VERSION_CHECK=1我使用tox 3.25.0和pip 20.3.4,我在两个不同的项目中尝试过这一点,一个使用flit 3.7.1,另一个使用setuptools。
有没有人知道我怎样不用上网就能进行毒理?
发布于 2022-07-03 11:10:20
您需要下载前依赖项并脱机安装它们。在tox.ini中使用install_command。有点像
[testenv]
install_command=python -m pip install {opts} --no-index --find-links /path/to/download/dir/ {packages}https://stackoverflow.com/questions/72845147
复制相似问题