conferences | speakers | series

Guix-tox, a functional version of tox

home

Guix-tox, a functional version of tox
FOSDEM 2016

Tox is a very well-known tool, written in Python, that allows users to run tests inside various virtual environments created using virtualenv. This approach prevents tests from being truly reproducible. We will see in this talk how virtualenv can be replaced by GNU Guix, a functional package manager, in order to improve tox. We will give real-life examples using Python packages from the OpenStack project.

Using virtualenv in tox raises a few issues:

  • only the packages available on PyPI can be installed, which means users sometimes have to "manually" install some packages using their distribution's package manager (for instance, lib*-dev on Debian, gcc...);
  • when multiple virtual environments need to install the same package, it is duplicated in each of the virtualenvs, wasting disk space;
  • bad level of abstraction: nowadays, every language come with its own package manager (pip, npm, cpan...) instead of using a single, robust package manager;
  • tests are not really reproducible because the test environments are not completely isolated from the rest of the system (think of environment variables, of the whole filesystem, etc.).

GNU Guix is a functional package manager (as in "functional programming") based on Nix. It allows users to build packages in a completely isolated environment. We will introduce this tool and show how the "guix environment" command can be used to create an isolated environment similar to a virtualenv.

Last but not least, we will see how virtualenv can be replaced with Guix in tox so that users can benefit from all the features of Guix without changing their usual workflow. We will show some examples using packages from the OpenStack project, such as python-keystoneclient.

Speakers: Cyril Roelandt