[Numpy-discussion] How to run unittests at build time?

Sandro Tosi morph at debian.org
Wed Sep 21 17:29:40 EDT 2011

On Wed, Sep 21, 2011 at 23:20, Robert Kern <robert.kern at gmail.com> wrote:
> On Wed, Sep 21, 2011 at 16:15, Filipe Pires Alvarenga Fernandes
> <ocefpaf at gmail.com> wrote:
>> Don't know about about Debian, but this works OK for RPM distros:
>> PYTHONPATH="%{buildroot}%{py_sitedir}" %{__python} -c \
>>                                    "import pkg_resources, numpy ; numpy.test()"
>> The only thing you are missing is the "import pkg_resources", let me
>> know if that works for you.
> What does py_sitedir expand to, usually?

I suppose the site-packages directory location, so something like

> I don't think pkg_resources
> has anything to do with it. numpy doesn't use it, and I don't think
> nosetests does either (well, only for its plugin mechanism, but that's
> neither here nor there).

ack, I didn't use it in my tests: it works fine the python -c "import
numpy; numpy.test()"

> In any case, I've tried importing
> pkg_resources while running from the build/lib.*/ directory and still
> get the same errors as reported by Sandro.

Yep, the different with my approach and Felipe's one is I ran from the
build directory Felipe from the installation directory. It works, so
I'll use the latter

Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

More information about the NumPy-Discussion mailing list