首页 > 解决方案 > 是否可以指向 tox 从分支中提取依赖项(又名在幕后使用`pip -e`)?

问题描述

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

尝试的解决方案:

毒物

[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

标签: pytestpypitox

解决方案


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

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

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


推荐阅读