[英]run tox on different python patch versions
In short: Is there a way to have tox
cycle on patch versions of python?简而言之:有没有办法在 python 的补丁版本上设置tox
循环?
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 Long:我希望测试在 2.7.7、2.7.8 等上运行,基本上我是在 2.7.6 上进行的,想看看我是否可以摆脱这个警告
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning
before going into production.在投入生产之前。
(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) (当然,我已经用 pyenv “手动”测试了它,将 2.7.x 设置为全局构建一个 virtualenv 并对其进行测试,但是每次所有可能的组合都运行持续集成会很好)
Which exact version tox
uses when specifying -e py27
depends on your platform, default paths, and your PATH.指定-e py27
时使用哪个确切版本的tox
取决于您的平台、默认路径和您的 PATH。 If you want to have full control over which version it takes, you should install tox-globinterpreter
and run如果你想完全控制它需要哪个版本,你应该安装tox-globinterpreter
并运行
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 tox.ini
is installed.在安装tox.ini
的目录中。 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.上面假设您在/opt/python/
下安装了彼此相邻的/opt/python/
版本号作为安装目录,其他位置/方案当然是可能的,但只有当有一些规律时,您才能使用for
循环.
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. tox-globinterpreter
仍然只允许您为每个tox
版本指示器( py27
、 py35
、 py36
、 pypy
等)使用一个二进制 python 版本,但允许您微调控制选择用于每个这些的实际 python。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.