From eee9e2834079439ce451c64e4ae2dfbfe6d1fccb Mon Sep 17 00:00:00 2001 From: Phil Dawson Date: Thu, 14 Feb 2019 11:48:14 +0000 Subject: tox.ini: Add 'venv' environment to run arbitrary commands in a venv This is a handy way for developers to make use of the venvs we're constructing for our test suite to run in. --- CONTRIBUTING.rst | 9 +++++++++ tox.ini | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 6a3fbf05f..c7ab1b8ab 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -1589,6 +1589,15 @@ can run ``tox`` with ``-r`` or ``--recreate`` option. ./setup.py test --addopts 'tests/frontend/buildtrack.py::test_build_track' +.. tip:: + + We also have an environment called 'venv' which takes any arguments + you give it and runs them inside the same virtualenv we use for our + tests:: + + tox -e venv -- + + Any commands after ``--`` will be run a virtualenv managed by tox. Observing coverage ~~~~~~~~~~~~~~~~~~ diff --git a/tox.ini b/tox.ini index 9183e023f..dbbbf8880 100644 --- a/tox.ini +++ b/tox.ini @@ -91,3 +91,14 @@ commands = deps = click-man >= 0.3.0 -rrequirements/requirements.txt + +# +# Usefull for running arbitrary scripts in a BuildStream virtual env +# +[testenv:venv] +commands = {posargs} +deps = + -rrequirements/requirements.txt + -rrequirements/dev-requirements.txt + -rrequirements/plugin-requirements.txt +whitelist_externals = * -- cgit v1.2.1