【问题标题】:Python/tox Install a dependency as editablePython/tox 将依赖项安装为可编辑
【发布时间】:2015-05-30 19:27:32
【问题描述】:

tox.ini 中,您指定希望tox 安装在它创建的virtualenvs 中的包。

[testenv]
deps =
    mock
    pytest
commands =
    python setup.py test -q
    python setup.py flake8

此示例告诉 tox 在运行测试之前将 mock 和 pytest 安装到每个 virtualenv 中。 Tox 将使用 pip 从 PyPI 安装这些依赖项。

如何将 tox 告诉 pip install -e 一个来自本地结帐而不是来自 PyPI 的依赖项?我仍然希望从 PyPI 安装其余的依赖项。

【问题讨论】:

    标签: python testing tox


    【解决方案1】:

    一种方法是从 deps 变量中删除依赖项,然后运行本地 pip install 作为 tox 在其测试运行中将执行的第一个命令。

    [testenv]
    deps =
        mock
    commands =
        pip install -e ~/path/to/pytest
        python setup.py test -q
        python setup.py flake8
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-04-06
      • 2020-05-06
      • 2015-07-04
      • 1970-01-01
      • 2021-10-17
      • 2016-10-20
      • 2014-05-13
      相关资源
      最近更新 更多