On 28 août 02:48, Andrey Rahmatullin wrote: > Hello. Hi,
> I package logilab modules for ALT Linux and I'm trying to run bundled > test in the build process. I was able to run logilab-common tests using the > build/ directory (I've borrowed the idea from debian/rules) but I can't do > the same with logilab-astng. Let's assume the build system has > logilab-common installed but of course doesn't have logilab-astng. It > looks like I cannot import /usr/whatever/logilab/common/__init__.py and > ./build/logilab/astng/__init__.py at the same time: if I have > ./build/logilab/__init__.py, I get > > File "/usr/bin/pytest", line 3, in <module> > from logilab.common.pytest import run > ImportError: No module named common.pytest > > And if I don't create ./build/logilab/__init__.py, I get "ImportError: No > module named astng". that's because both are in the same 'logilab' package. I can see two solutions to this: * link 'common' directory into the 'logilab' directory of your build directory, aside astng. * play with logilab's package __path__ in the __init__.py file of the build directory so that the installed package is still importable. -- Sylvain Thénault LOGILAB, Paris (France) Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations Développement logiciel sur mesure: http://www.logilab.fr/services CubicWeb, the semantic web framework: http://www.cubicweb.org _______________________________________________ Python-Projects mailing list [email protected] http://lists.logilab.org/mailman/listinfo/python-projects
