[openstack-dev] Let tox use globally installed packages
Monty Taylor
mordred at inaugust.com
Tue Dec 4 17:03:31 UTC 2012
On 12/04/2012 08:23 AM, Sascha Peilicke wrote:
> Hello,
>
> recently, python-glanceclient seems to have moved to tox
> exclusively for running testsuites. While this is a good thing in
> general, it has some warts for distributors. For instance, we at
> SUSE create seperate test RPM packages that run unittest against
> our base packages. In this case, it doesn't make much sense for us
> to have tox create a virtualenv with modules from PyPI but rather
> it should reuse (already installed) Python RPM packages from the
> system. Also, fetching modules such as M2Crypto or lxml from PyPI
> and building them locally needs system libraries (such as
> openssl-devel, libxslt-devel and libxml-devel). These libs can't
> be tracked in pip requirements files and such modules may take a
> while to build. Thus I would like to add the following line to
> tox.ini files:
>
> [testenv] sitepackages = True
>
> This way, tox checks if a Python module is already available on
> the system path and won't fetch it from PyPI. IMO this makes sense
> for developers too, it speeds up their testing experience. Would
> that be acceptable?
We actually do that for nova, but it was the result of REALLY needing
to test libvirt and not being able to do that because it was
uninstallable via pip. Turning on sitepackages=True leads to an
unfortunately amount of getting the wrong things in the virtualenv
because of the way deps are processed.
However - there is absolutely no reason that you should be touching
tox as part of your package building. Part of the work to get us on to
tox involved making it possible to just run nosetests (and soon to run
testr instead) by itself without the need of additional special
wrapper scripts.
So if you have done the dependency management at the package level,
simply run:
nosetests
In the root directory, and you will get the appropriate equivalent for
the packages.
Monty
More information about the OpenStack-dev
mailing list