执行家庭助理测试用例,使用 tox 不工作。

问题描述 投票:1回答:1

我在ubuntu18.04上安装了python3.7,并尝试运行家庭助理测试案例,python和所有依赖项的安装都很成功。

所以在安装python3.7时,它内部安装了各种开发和测试python代码的包,其中一个包就是 typing 是内部安装的。(从python 3.5开始,输入法被添加为默认值)

在执行这些测试用例时,我遇到了一个错误。

File "/home/phil/repos/core/.tox/py38/lib/python3.8/site-packages/typing.py", line 1357, in <module>
      class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
    File "/home/phil/repos/core/.tox/py38/lib/python3.8/site-packages/typing.py", line 1005, in __new__
      self._abc_registry = extra._abc_registry
  AttributeError: type object 'Callable' has no attribute '_abc_registry'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /home/phil/repos/core/.tox/py38/bin/python /home/phil/repos/core/.tox/py38/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-pqbbs22j/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel Check the logs for full command output.

在这里提供了一个解决方案 SO问题55833509pip uninstall typing,这也是不行的。

  1. 有什么方法可以让我卸载这个默认的 typing 包也是?
  2. 我们可以防止安装这个 typing 包?
  3. 有什么其他的解决方案来解决这个问题吗?

python python-3.7 tox home-assistant
1个回答
1
投票

tox 是在虚拟环境中运行的。因此,删除 typing 不会有任何帮助。

我想你 script/setup 当你克隆了repos,并且你有系统的 依赖性 安装。

tox -r 会重建环境,那么。

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.