小编sin*_*ere的帖子

如何在 tox 中要求特定的软件包版本?

在我的tox.ini文件中,依赖项是通过requirements.txt也使用的文件安装的setup.py,如下所示:

requirements.txt文件包含可接受的包范围django,具体取决于安装的 python 版本,如下所示:

Django>=1.11,<2 ; python_version == '2.7'
Django>=1.11,<3 ; python_version > '3'
Run Code Online (Sandbox Code Playgroud)

对于 python3,我想确保测试运行django 2.0以及django 2.1+默认安装的最新版本,遵守requirements.txt文件中指定的版本约束。为此,我使用命令强制安装所需的 django 版本,如下所示:

[tox]
envlist = {py27,py3}-django111,py3-django{20,21}

[testenv]
deps =
    -r{toxinidir}/requirements.txt

commands =
    django111: pip install 'Django>=1.11,<1.12'
    py3-django20: pip install 'Django>=2.0,<2.1'
    py3-django21: pip install 'Django>=2.1'
    pytest
Run Code Online (Sandbox Code Playgroud)

理想情况下,我可以deps像这样添加到变量中:

[testenv]
deps =
    -r{toxinidir}/requirements.txt
    django111: Django>=1.11,<1.12
    py3-django20: Django>=2.0,<2.1
    py3-django21: Django>=2.1

commands =
    pytest
Run Code Online (Sandbox Code Playgroud)

pip不支持双重要求,即使版本约束的指定方式没有冲突,也会抛出错误。

commands …

python tox

7
推荐指数
1
解决办法
3343
查看次数

Vault-autocomplete-install 找不到任何 shell

在 Docker 容器中运行时vault -autocomplete-install失败。

$ docker run --privileged -ti vault:latest -autocomplete-install
Error executing CLI: Did not find any shells to install
Run Code Online (Sandbox Code Playgroud)

我尝试跑步,strace vault...但没有什么引人注目的。我也尝试查看来源,但一切似乎都很好。

任何想法?

hashicorp-vault

5
推荐指数
1
解决办法
2854
查看次数

如何为分子测试指定保险库密码文件?

使用分子运行测试时:

molecule tests
Run Code Online (Sandbox Code Playgroud)

和一些文件保护与ansible金库中,--vault密码文件必须指定提供解密其内容的密码。

尽管可以通过收敛来做到这一点

 molecule converge -- --vault-password-file ~/.vault.txt
Run Code Online (Sandbox Code Playgroud)

它在分子测试中失败了

 $ molecule test -- --vault-password-file ~/.vault.txt
 Usage: molecule test [OPTIONS]
 Error: Got unexpected extra arguments (--vault-password-file ~/.vault.txt)
Run Code Online (Sandbox Code Playgroud)

ansible molecule

4
推荐指数
1
解决办法
3245
查看次数

ansible-playbook可以从stdin读取而不是从文件读取吗?

是否可以ansible-playbook从标准输入中读取剧本?我以为连字符(-)可能是一种指定方式stdin,就像cat命令中那样,我尝试过:

$ ansible-playbook -
Run Code Online (Sandbox Code Playgroud)

但是它失败了:

ERROR! the playbook: - could not be found
Run Code Online (Sandbox Code Playgroud)

ansible

4
推荐指数
1
解决办法
555
查看次数

标签 统计

ansible ×2

hashicorp-vault ×1

molecule ×1

python ×1

tox ×1