[Distutils] Path problem with zope.testing and buildout

Barry Warsaw barry at python.org
Wed Jan 21 04:55:22 CET 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm not entirely sure this is the right place to report this problem,  
but I'll give it a shot anyway.  I'm sure this is pebkac but I haven't  
figure it out yet.

My current Mailman 3 code is buildout-based.  The branch is here:

https://code.launchpad.net/~mailman-coders/mailman/3.0

Here's my buildout.cfg file:

- -----snip snip-----
[buildout]
parts =
     interpreter
     tags
     test
unzip = true
develop = .

[interpreter]
recipe = zc.recipe.egg
interpreter = py
eggs =
     lazr.config
     lazr.delegates
     locknix
     mailman
     munepy
     storm
     zope.interface

[tags]
recipe = z3c.recipe.tag:tags
eggs = mailman

[test]
recipe = zc.recipe.testrunner
eggs =
     mailman
defaults = '--tests-pattern ^tests --exit-with-status'.split()
# Hack in extra arguments to zope.testrunner.
initialization = from mailman.testing.layers import ConfigLayer;
     ConfigLayer.hack_options_parser()
- -----snip snip-----

If I build this out and then run bin/test, my test suite passes, but I  
get ImportErrors for every dependent egg that gets downloaded.  It's  
as if the eggs directory is being search for tests even though  
eggs=mailman is in the [test] section.

However, if I put the following in my ~/.buildout/default.cfg, I don't  
those ImportErrors, presumably because the eggs are so far distant  
that Zope's testrunner doesn't find them.

- -----snip snip-----
[buildout]
eggs-directory=/Users/barry/.buildout/eggs
download-cache=/Users/barry/.buildout/download-cache
- -----snip snip-----

Here's an excerpt from the bin/test output (with extra blank lines  
suppressed):

Test-module import failures:
Module: eggs.lazr.config-1.1-py2.6.egg.lazr.config.tests
ImportError: No module named eggs.lazr.config-1.1- 
py2.6.egg.lazr.config.tests
Module: eggs.lazr.delegates-1.0-py2.6.egg.lazr.delegates.tests
ImportError: No module named eggs.lazr.delegates-1.0- 
py2.6.egg.lazr.delegates.tests
Module: eggs.zc.buildout-1.1.1-py2.6.egg.zc.buildout.tests
ImportError: No module named eggs.zc.buildout-1.1.1- 
py2.6.egg.zc.buildout.tests
Module: eggs.zc.buildout-1.1.1-py2.6.egg.zc.buildout.testselectingpython
ImportError: No module named eggs.zc.buildout-1.1.1- 
py2.6.egg.zc.buildout.testselectingpython
Module: eggs.zc.recipe.egg-1.1.0-py2.6.egg.zc.recipe.egg.tests
ImportError: No module named eggs.zc.recipe.egg-1.1.0- 
py2.6.egg.zc.recipe.egg.tests
Module: eggs.zc.recipe.testrunner-1.1.0- 
py2.6.egg.zc.recipe.testrunner.tests
ImportError: No module named eggs.zc.recipe.testrunner-1.1.0- 
py2.6.egg.zc.recipe.testrunner.tests
Module: eggs.zope.interface-3.5.0-py2.6-macosx-10.3- 
i386.egg.zope.interface.common.tests.test_idatetime
ImportError: No module named eggs.zope.interface-3.5.0-py2.6- 
macosx-10.3-i386.egg.zope.interface.common.tests.test_idatetime
Module: eggs.zope.interface-3.5.0-py2.6-macosx-10.3- 
i386.egg.zope.interface.common.tests.test_import_interfaces
ImportError: No module named eggs.zope.interface-3.5.0-py2.6- 
macosx-10.3-i386.egg.zope.interface.common.tests.test_import_interfaces
Module: eggs.zope.interface-3.5.0-py2.6-macosx-10.3- 
i386.egg.zope.interface.tests.test_adapter
ImportError: No module named eggs.zope.interface-3.5.0-py2.6- 
macosx-10.3-i386.egg.zope.interface.tests.test_adapter
Module: eggs.zope.interface-3.5.0-py2.6-macosx-10.3- 
i386.egg.zope.interface.tests.test_advice
ImportError: No module named eggs.zope.interface-3.5.0-py2.6- 
macosx-10.3-i386.egg.zope.interface.tests.test_advice
Module: eggs.zope.interface-3.5.0-py2.6-macosx-10.3- 
i386.egg.zope.interface.tests.test_declarations
ImportError: No module named eggs.zope.interface-3.5.0-py2.6- 
macosx-10.3-i386.egg.zope.interface.tests.test_declarations
Module: eggs.zope.interface-3.5.0-py2.6-macosx-10.3- 
i386.egg.zope.interface.tests.test_document
ImportError: No module named eggs.zope.interface-3.5.0-py2.6- 
macosx-10.3-i386.egg.zope.interface.tests.test_document
Module: eggs.zope.interface-3.5.0-py2.6-macosx-10.3- 
i386.egg.zope.interface.tests.test_element
ImportError: No module named eggs.zope.interface-3.5.0-py2.6- 
macosx-10.3-i386.egg.zope.interface.tests.test_element
Module: eggs.zope.interface-3.5.0-py2.6-macosx-10.3- 
i386.egg.zope.interface.tests.test_interface
ImportError: No module named eggs.zope.interface-3.5.0-py2.6- 
macosx-10.3-i386.egg.zope.interface.tests.test_interface
Module: eggs.zope.interface-3.5.0-py2.6-macosx-10.3- 
i386.egg.zope.interface.tests.test_odd_declarations
ImportError: No module named eggs.zope.interface-3.5.0-py2.6- 
macosx-10.3-i386.egg.zope.interface.tests.test_odd_declarations
Module: eggs.zope.interface-3.5.0-py2.6-macosx-10.3- 
i386.egg.zope.interface.tests.test_sorting
ImportError: No module named eggs.zope.interface-3.5.0-py2.6- 
macosx-10.3-i386.egg.zope.interface.tests.test_sorting
Module: eggs.zope.interface-3.5.0-py2.6-macosx-10.3- 
i386.egg.zope.interface.tests.test_verify
ImportError: No module named eggs.zope.interface-3.5.0-py2.6- 
macosx-10.3-i386.egg.zope.interface.tests.test_verify
Module: eggs.zope.testing-3.7.1-py2.6.egg.zope.testing.tests
ImportError: No module named eggs.zope.testing-3.7.1- 
py2.6.egg.zope.testing.tests
Module: eggs.zope.testing-3.7.1-py2.6.egg.zope.testing.testrunner.tests
ImportError: No module named eggs.zope.testing-3.7.1- 
py2.6.egg.zope.testing.testrunner.tests


The same behavior occurs on Linux.

Does anybody have any suggestions for making bin/test work without  
putting your eggs outside the source tree?  Or if it's not possible,  
I'll update my README.txt to explain that you have to have a  
~/.buildout/default.cfg.

Thanks,
Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iQCVAwUBSXacqnEjvBPtnXfVAQIfoQP+NmPMyOlky4rqSF9UWF/cOi4K/G++YYRO
DodibIMefqhoX+2SEjfavm9NN9nIVt0Wrvaty0acnZ1FHc7pPwN+szUV6is1QAao
Q7WQbZyQewPVk+3tucuBD7UtcMoBpHScq4afL4u4crSozf3DpVI0YwqhYf4hvvo8
XrFTINdDfCI=
=E5eP
-----END PGP SIGNATURE-----


More information about the Distutils-SIG mailing list