[virt-tools-list] [virt-bootstrap] [PATCH v5 06/11] Use 'tox' to test agains multiple Python versions

Cedric Bosdonnat cbosdonnat at suse.com
Mon Jul 24 13:23:34 UTC 2017


On Mon, 2017-07-24 at 09:14 +0100, Radostin Stoyanov wrote:
> 'Tox' is tool which will check if the package installs correctly and all
> unit tests pass with different Python versions.
> ---
>  tox.ini | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
>  create mode 100644 tox.ini
> 
> diff --git a/tox.ini b/tox.ini
> new file mode 100644
> index 0000000..6f9f822
> --- /dev/null
> +++ b/tox.ini
> @@ -0,0 +1,23 @@
> +# 'Tox' is a tool for automating build/test cycles against
> +# multiple Python versions:
> +#   http://pypi.python.org/pypi/tox
> +#   http://tox.readthedocs.io/en/latest/
> +
> +# Running the command 'tox' while in the root of the virt-bootstrap
> +# source directory will:
> +#   - Create a source distribution (setup.py sdist)

creating a sdist doesn't work. Add a MANIFEST.in with at least
include README.md to the commit

> +#   - Then for every supported version of Python:
> +#     - Create a virtualenv in .tox/py$VERSION and install dependencies.
> +#       (These virtualenvs are cached across runs unless you use
> +#        --recreate.)
> +#     - Use pip to install the virt-bootstrap sdist into the virtualenv
> +#     - Run the virt-bootstrap tests
> +
> +# To run against a specific subset of Python versions, use:
> +#   tox -e py27
> +
> +[tox]
> +envlist = py27,py34,py35,py36
> +

Tox will fail on most systems because distro usually ship one python 3 version.
As per https://stackoverflow.com/questions/30000355/tox-envlist-using-any-python3-interpreter-exactly-once 
replace by

envlist = py27,py3

I tested here and it works

> +[testenv]
> +commands={envpython} {toxinidir}/setup.py test

ACK with the changes

--
Cedric




More information about the virt-tools-list mailing list