[Python-modules-team] building python-numpy on

Faheem Mitha faheem at faheem.info
Thu Oct 6 11:39:07 UTC 2011



On Thu, 6 Oct 2011, Sandro Tosi wrote:

> On Thu, Oct 6, 2011 at 08:40, Faheem Mitha <faheem at faheem.info> wrote:
>> Ran 3541 tests in 44.650s
>>
>> OK (KNOWNFAIL=3, SKIP=4)
>> [255665 refs]
>> Traceback (most recent call last):
>>  File "<string>", line 1, in <module>
>>  File "numpy/__init__.py", line 127, in <module>
>>    raise ImportError(msg)
>> ImportError: Error importing numpy: you should not try to import numpy from
>>        its source directory; please exit the numpy source tree, and relaunch
>>        your python intepreter from there.
>
> you have to fix the tests "trick" to avoid importing numpy from . but
> from the installed location. Or disable test completely.

Hi Sandro,

Yes, I see that the lines

ifeq (,$(findstring notest,$(DEB_BUILD_OPTIONS)))
         -for v in $(PYVERS) ; do \
                 python$$v -c "import sys ; sys.path.insert(0, '$(CURDIR)/debian/tmp/usr/lib/python$$v/dist-packages/') ; import numpy; numpy.test()" ; \
                 python$$v-dbg -c "import sys ; sys.path.insert(0, '$(CURDIR)/debian/tmp/usr/lib/python$$v/dist-packages/') ; import numpy; numpy.test()" ; \
         done
endif

are failing. Is that the problem?

I don't see why the trick here is failing. It looks like it should work. 
It does if I perform the tests manually. Ie. add the local path to 
sys.path first, and then import numpy, and run numpy.test().

To disable the tests, should I just comment out those lines, or should I 
set DEB_BUILD_OPTIONS, and if so where?

I'm not sure why the tests are run as part of the build anyway.

                                                Regards, Faheem


More information about the Python-modules-team mailing list