[openstack-dev] Let tox use globally installed packages
saschpe at suse.de
Wed Dec 5 09:08:46 UTC 2012
On 12/04/2012 06:03 PM, Monty Taylor wrote:
> On 12/04/2012 08:23 AM, Sascha Peilicke wrote:
>> 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.
Can you elaborate more on the last statement? AFAIR, pip still fetches
modules from PyPI if the versions in requirements files don't match. Of
course this won't work for unversioned requirements, but that would be
wrong then anyway, no?
> 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.
Which is good.
> So if you have done the dependency management at the package level,
> simply run:
Well yes, I think we can use nose directly instead of tox.
> In the root directory, and you will get the appropriate equivalent for
> the packages.
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
With kind regards,
SUSE Linux GmbH, Maxfeldstr. 5, D-90409 Nuernberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer HRB 16746 (AG Nürnberg)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 261 bytes
Desc: OpenPGP digital signature
More information about the OpenStack-dev