simone cittadini
simone cittadini

Reputation: 338

run tox on different python patch versions

In short: Is there a way to have tox cycle on patch versions of python?

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

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)

Upvotes: 4

Views: 819

Answers (1)

Anthon
Anthon

Reputation: 76672

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 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 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.

Upvotes: 1

Related Questions