在不同的python补丁版本上运行tox [英] run tox on different python patch versions
问题描述
简而言之:有没有办法让python补丁版本的tox
循环?
In short: Is there a way to have tox
cycle on patch versions of python?
长:我希望测试可以在2.7.7、2.7.8等上运行,基本上我是在2.7.6上进行的,并希望了解是否可以消除此警告
Long: I want the tests to be run on 2.7.7, 2.7.8, and so on, basically I'm staging on 2.7.6 and want to see if I can get rid of this warning
https://urllib3.readthedocs.org/en/latest/security .html#insecureplatformwarning
投入生产之前.
(当然,我已经使用pyenv对其进行了手工"测试,将2.7.x设置为全局构建一个virtualenv并对其进行测试,但是每次进行所有可能的组合时都可以进行连续集成会很不错)
(Of course I've already tested it "by hand" with pyenv, setting 2.7.x as global building a virtualenv and testing into it, but it would be nice to have continuous integration run every time all the possible combinations)
推荐答案
-e py27
在指定-e py27
时使用的确切版本取决于您的平台,默认路径和PATH.如果要完全控制使用哪个版本,则应安装tox-globinterpreter
并运行
Which exact version tox
uses when specifying -e py27
depends on your platform, default paths, and your PATH. If you want to have full control over which version it takes, you should install tox-globinterpreter
and run
for x in $(seq 7 12); do
tox --scan /opt/python/2.7."$x"/bin/python
tox -r -e py27
done
.上面假设您在 in the directory where your 这篇关于在不同的python补丁版本上运行tox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!/opt/python/
下将python安装在一起,并且版本号作为该目录下的安装目录,其他位置/方案当然也是可能的,但是只有在有一定规律性的情况下,您才可以使用for
循环tox.ini
is installed. The above assumes you have your python installation next to each other under /opt/python/
with the version number as install directory under that, other locations/schemes are of course possible, but only when there is some regularity you can use a for
loop.tox-globinterpreter
仍然仅允许每个tox
版本指示器(py27
,py35
,py36
,pypy
等)使用一个二进制python版本,但允许您对选择实际的python进行微调控制用于每个.tox-globinterpreter
still only allows you one binary python version per tox
version indicator (py27
, py35
, py36
, pypy
, etc) but allows you fine tuned control over selecting the actual python used for each of these.