pytest - 是否可以指向 tox 从分支中提取依赖项(又名在幕后使用`pip -e`)?
问题描述
当py37更改未打包到pypi时如何在tox中测试py27和py37
py3.7 兼容更改存在于 repo 分支中。
它们可以通过 pip -e 手动运行,安装它们并运行 pytest 而不使用 tox。
我想通过 tox 运行它们,但我无法找出正确的字符串来提供 deps 列表,或者这可能是以另一种方式完成的。
尝试的解决方案:
毒物
[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
解决方案
对于 VCS URL pip
,需要知道应该提供的包的名称#egg=name
:
git+ssh//repo_url/location1.git@branchname_that_supports_py37#egg=package1
否则你tox.ini
看起来不错。例如,我使用相同的方法。
推荐阅读
- c# - ASP NET MVC 5:会话突然结束
- node.js - 是否可以使用代理网址提供视频内容?
- laravel - 动态子域 Laravel
- java - 在 Play (Java) 中实现 OAuth2 的密码所有者资源流程
- java - Spring Boot 和 Docker-compose 设置参数
- azure-cognitive-search - Azure 搜索:Orderby 如何处理空整数值?
- android - Android 找不到 Build Tools 修订版 X
- angular - Angular 5 - 将模板从祖父母传递给孩子
- templates - 通过列表/字典传递 Jinja2 宏参数
- apostrophe - 在撇号无头中检索带有slug的单页