OpenStack uses pbr and tox together all the time, but they wrote pbr. Further, I wouldn't recommend it but it does have some nice features so I wouldn't strongly advise against it

Sent from my phone with my typo-happy thumbs. Please excuse my brevity

On Wed, May 2, 2018, 15:58 Oliver Bestwalter <> wrote:
Hello Fred,

you are entering this on the deep end and there is a lot of things that might yield interesting results, so you are definitely not doinng something ridiculous, but a lot of unusual things and some things that give me the feeling that the tox docs need some serious TLC :)

Just shooting a few things from the hip here without having time to look in more detail, but I will try to give you some pointers:

The main red flag for me is pbr. Never having used it myself - I have no idea what it is doing exactly and how that might interfer with tox and "normal" virtualenvs, but I can remember dimly reading a discussion where someone struggled with getting this to work together with tox, so you should maybe first try to get some simpler project working without using pbr and then work your way up. The pbr folks use tox themselves, so if you are still running into problems them, mabye they might be better suited to help you.

Now for some more obvious things:

> install_command = pip install -r tox-requirements.txt {opts} {packages}

should be:

deps = -rtox-requirements.txt

or even simper: listing the packages directly in tox deps instead of a special tox requirements file. Or you csan have the test deps as extras or tests_require as part of your Read up about it here:

simplest way for now would be

deps =
    # or whatever stuff you only need to run tests with in tox envs


> basepython = /op/...all kind of interesting interpreters

basepython chooses the python that the venv should be built with, so you might have a different expectation here and I am not even quite sure what is supposed to happen here, as I never have played around with interesting basepython settings yet. So. Have a look at and decide for yourself and observe with tox -vvv what exactly is happening.

Having the indexes in the requirements file is another interesting setting that I personally have never used. You can set the index also in tox, so maybe you want to experiment with that:


On Wed, 2 May 2018 at 19:51 Fred Drake <> wrote:
So for years I worked in a buildout shop, and now I'm in a
Debian-packages-are-good-enough shop, and I'm looking to improve that

For some of my libraries at work, I want to get cross-version testing
straightened out a bit, and tox seems to be the state of the art.
(Yes, Python 2.7 is part of the mix, but getting past that means
getting library tests running on Python 3 before we tackle

I'm using a fairly simple tox.ini file, defining three environments
built on top of "clean" Python installations:

envlist = py27,py35,py36

commands =
    python -m unittest discover -p * -p *

install_command = pip install -r tox-requirements.txt {opts} {packages}

basepython = /opt/kt-python27/bin/python2

basepython = /opt/kt-python35/bin/python3

basepython = /opt/kt-python36/bin/python3

The tox-requirements.txt is pretty minimal, and doesn't do anything
particularly interesting, but does include options to use a local
DevPI server instead of PyPI.

My project has a venv based on my clean python 3.6 installation.  tox
is installed into the venv.

When running bin/tox, tox creates an sdist for my library package,
then creates the venvs and installs my package into them.  When nearly
complete, the installation fails because of an attempt to write a
script into the system /usr/bin, which shouldn't happen in the venv:

GLOB sdist-make: /home/fdrake/p/ks3.mediaflux/
py27 create: /home/fdrake/p/ks3.mediaflux/.tox/py27
py27 inst: /home/fdrake/p/ks3.mediaflux/.tox/dist/
ERROR: invocation failed (exit code 1), logfile:
ERROR: actionid: py27
msg: installpkg
cmdargs: ['/home/fdrake/p/ks3.mediaflux/.tox/py27/bin/pip', 'install',
'-r', 'tox-requirements.txt',

Looking in indexes: http://devpi/root/pypi/+simple/,
Processing ./.tox/dist/
Successfully built ks3.mediaflux
Installing collected packages: six, funcsigs, pbr, mock, idna,
chardet, certifi, urllib3, requests, kt.testing, zc.lockfile,
kt.common, pytz, itsdangerous, Werkzeug, click, MarkupSafe, Jinja2,
Flask, aniso8601, flask-RESTful, netaddr, kt.restful, ks3.mediaflux
Could not install packages due to an EnvironmentError: [Errno 13]
Permission denied: '/usr/bin/pbr'
Consider using the `--user` option or check the permissions.

If I manually cd into .tox/py27 and running bin/pip install -r
../../tox-requirements.txt succeeds, and there's no attempt to write
into /usr/bin/.  Doing that for each of the environments allows tox to
run the tests and produce the expected summary.

At this point, I presume I've done some ridiculous in my configuration
somewhere.  Is there something obvious to others that I'm just missing
because I'm not familiar with the tools?



Fred L. Drake, Jr.    <fred at>
"A storm broke loose in my mind."  --Albert Einstein
tox-dev mailing list
tox-dev mailing list