Dan*_*son 7 linux bash wildcard tox
出于不同的原因,我必须在我的tox.ini中执行pip install作为命令(我这样skipsdist=True做tox将不会为我安装我的依赖项,但我仍然需要将其中一些安装到虚拟环境中).
问题是我有一个本地依赖项存储为tarball,其文件名中包含其版本,例如my-module-1.0.tar.gz.因此,我需要在命令中使用通配符,例如
pip install my-module-*.tar.gz
Run Code Online (Sandbox Code Playgroud)
但是在这种意义上,tox似乎不支持bash语义,因为我得到了错误
Requirement 'my-module-*.tar.gz' looks like a filename, but the file does not exist
Run Code Online (Sandbox Code Playgroud)
我试过在文件名周围加上引号以及转出星号,但没有成功.
有任何想法吗?
Mic*_*ros 12
我不是一个tox用户,但看起来tox不使用shell来执行命令.您可以尝试显式调用shell,例如:
/bin/bash -c 'pip install my-module-*.tar.gz'
Run Code Online (Sandbox Code Playgroud)