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

Filipe Pires Alvarenga Fernandes ocefpaf at gmail.com
Wed Sep 21 19:08:21 EDT 2011

On Wed, Sep 21, 2011 at 17:29, Sandro Tosi <morph at debian.org> wrote:
> 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
> /usr/lib/python2.6/site-packages/

Yep. That's correct.

If you want to look at the whole spec file:

>> 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.

You are right, I just removed pkg_resources and things still work OK.

> 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
> Cheers,
> --
> Sandro Tosi (aka morph, morpheus, matrixhasu)
> My website: http://matrixhasu.altervista.org/
> Me at Debian: http://wiki.debian.org/SandroTosi
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion

More information about the NumPy-Discussion mailing list