
This role currently does which tox || pip install --user tox and then sets "tox_exectuable" iff it has installed tox into the user's pip environment. This isn't idempotent -- if you run ensure-tox again, it will again run "which tox" and miss that it already installed tox in the private pip environment. Instead, make it look for "which {{ tox_executable }}" ... this way it will find the install it just did if it runs again. There seems to be no reason to only set "tox_exectuable" in the case this role had to install tox. Make this *always* set tox_exectuable so that you can run ensure-tox and then be sure tox_exectuable is something sane. The current testing assumes that tox is installed in the base image. We are working to remove this assumption; remove this part of the test. Rework the testing to first clear out any existing tox, which is present on most images but will have no effect on the -plain images. Then test when we install fresh it goes into the user pip install area, and then test if we explicitly set tox_exectuable it overrides. Change-Id: I36cfb62f2a2e2b9c2bbe92b46ed0b8098a873732
Ensure tox is installed
Look for tox
, and if not found, install it via
pip
in the user install directory (i.e.,
pip install --user
).
After running this role, tox_executable
will be set as
the path to a valid tox
.
Role Variables