06ad3eef8a
We can't do this all the time, because of rootless environments. But sometimes people have root and want to be able to use something from scripts from normal path. Change-Id: I3f57a6108f8f53ebfdd12f04ecb3d8c68c5b4a60
43 lines
1.3 KiB
ReStructuredText
43 lines
1.3 KiB
ReStructuredText
Ensure tox is installed
|
|
|
|
Look for ``tox``, and if not found, install it via ``pip`` into a
|
|
virtual environment for the current user.
|
|
|
|
**Role Variables**
|
|
|
|
.. zuul:rolevar:: tox_prefer_python2
|
|
:default: False
|
|
|
|
If tox is not detected, prefer to install tox inside Python 2
|
|
instead of Python 3.
|
|
|
|
If set,
|
|
:zuul:rolevar:`ensure-pip.ensure_pip_from_packages_with_python2`
|
|
will be automatically set to `True` to enable a Python 2
|
|
installation of `pip`.
|
|
|
|
.. zuul:rolevar:: ensure_global_symlinks
|
|
:default: False
|
|
|
|
Install a symlink to the tox executable into ``/usr/local/bin/tox``.
|
|
This can be useful when scripts need to be run that expect to find
|
|
tox in a more standard location and plumbing through the value
|
|
of ``tox_executable`` would be onerous.
|
|
|
|
Setting this requires root access, so should only be done in
|
|
circumstances where root access is available.
|
|
|
|
**Output Variables**
|
|
|
|
.. zuul:rolevar:: tox_executable
|
|
:default: tox
|
|
|
|
After running this role, ``tox_executable`` will be set as the path
|
|
to a valid ``tox``.
|
|
|
|
At role runtime, look for an existing ``tox`` at this specific
|
|
path. Note the default (``tox``) effectively means to find tox in
|
|
the current ``$PATH``. For example, if your base image
|
|
pre-installs tox in an out-of-path environment, set this so the
|
|
role does not attempt to install the user version.
|