From: Stefan v. d. W. <st...@su...> - 2006-10-17 08:22:36
|
On Tue, Oct 17, 2006 at 10:03:03AM +0200, Francesc Altet wrote: > A Divendres 13 Octubre 2006 22:20, Lisandro Dalcin va escriure: > > On 10/13/06, Francesc Altet <fa...@ca...> wrote: > > > Is it possible to test a numpy version directly from the source > > > directory without having to install it? > > > > I usually do: > > > > $ python setup.py build > > $ python setup.py install --home=3D/tmp > > $ export PYTHONPATH=3D/tmp/lib/python >=20 > Thanks for your answer Lisandro, but what I want is to completely avoid= an=20 > installation. The idea is to be able to test the local copy version of = numpy=20 > in the development directory while doing small changes on it. Having to= do=20 > the install step slows down the testing phase when doing small > changes. It would be great if we could get this to work. One problem is that distutils won't build the C-modules in place. Does anyone know of a workaround? At the moment, if you run numpy from the source directory, you see the message In [1]: import numpy Running from numpy source directory. after which you can't access any of the numpy functions. This would be due to this snippet in __init__.py: try: from __config__ import show as show_config except ImportError: show_config =3D None if show_config is None: import sys as _sys print >> _sys.stderr, 'Running from numpy source directory.' del _sys If we declare set_package_path and restore_path in __init__.py, we can wrap all imports in numpy with set_package_path('../../..') # set path back required depth from numpy import whatever, you, need restore_path() That would take care of things on the python side, at least. Cheers St=E9fan |