首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在没有互联网连接的情况下运行毒理?

如何在没有互联网连接的情况下运行毒理?
EN

Stack Overflow用户
提问于 2022-07-03 08:53:25
回答 1查看 61关注 0票数 2

当我试图在没有互联网连接的情况下运行tox时,它会打印以下错误消息:

代码语言:javascript
复制
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看起来是这样的:

代码语言:javascript
复制
[tox]
envlist = py3
isolated_build = True

[testenv]
deps =
    mypy
    pytest
    types-appdirs
commands =
    mypy src/mypackage tests
    pytest

使用互联网连接运行毒物测试就像预期的那样。

我尝试了在本期中给我的tox.ini添加以下几行的建议,但似乎没有任何效果,没有互联网连接,我就无法运行毒性测试。

代码语言:javascript
复制
setenv = VIRTUALENV_DOWNLOAD=0
         PIP_DISABLE_PIP_VERSION_CHECK=1

我使用tox 3.25.0和pip 20.3.4,我在两个不同的项目中尝试过这一点,一个使用flit 3.7.1,另一个使用setuptools。

有没有人知道我怎样不用上网就能进行毒理?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-07-03 11:10:20

您需要下载前依赖项并脱机安装它们。在tox.ini中使用install_command。有点像

代码语言:javascript
复制
[testenv]
install_command=python -m pip install {opts} --no-index --find-links /path/to/download/dir/ {packages}
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72845147

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档