是否可以指出tox从分支中提取依赖项(在幕后使用`pip -e`)?

时间:2019-05-08 17:32:50

标签: pytest pypi tox

当未将py37更改打包到pypi时,如何在tox中测试py27和py37

  • 回购分支中存在与py3.7兼容的更改。

  • 可以通过pip -e手动运行它们,安装它们并在没有tox的情况下运行pytest。

  • 我想通过tox运行它们,但我无法找出正确的字符串来提供deps列表,或者这可能是通过另一种方式完成的。

尝试的解决方案:

tox.ini

[tox]
envlist = py27,py37


[testenv:py27]
deps =
    pytest
    pytest-cov
    pytest-mock
    pylint
    ; packages specified by the setup.py cover the other dependencies for py2.7
commands =
    pytest -v


[testenv:py37]
deps =
    pytest
    pytest-cov
    pytest-mock
    pylint
    git+ssh//repo_url/location1.git@branchname_that_supports_py37
    git+ssh//repo_url/location2.git@branchname_that_supports_py37
    git+ssh//repo_url/location3.git@branchname_that_supports_py37
    git+ssh//repo_url/location4.git@branchname_that_supports_py37
    git+ssh//repo_url/location5.git@branchname_that_supports_py37
    git+ssh//repo_url/location6.git@branchname_that_supports_py37
    git+ssh//repo_url/location7.git@branchname_that_supports_py37
    git+ssh//repo_url/location8.git@branchname_that_supports_py37

commands =
    pytest -v

1 个答案:

答案 0 :(得分:3)

对于VCS URL,pip需要知道#egg=name应当提供的软件包名称:

    git+ssh//repo_url/location1.git@branchname_that_supports_py37#egg=package1

否则,您的tox.ini看起来不错。例如,我use使用相同的方法。