[pypy-dev] new autopath logic?

holger krekel hpk at trillke.net
Wed May 5 18:46:39 CEST 2004

[Laura Creighton Wed, May 05, 2004 at 06:44:21PM +0200]
> In a message of Wed, 05 May 2004 18:42:37 +0200, holger krekel writes:
> >Hi, 
> >
> >as many of you may know, we are using copies of pypy/tool/autopath.py in
> >a couple of places in order to insert a correct Python search path for
> >'import pypy.xxx.yyy' to succeed.  With "import autopath" as the first li
> >ne
> >all the test_*.py can be invoked directly from the commandline and
> >directly run.  However, autopath.py needs the information about the
> >top-directory ('pypy' in our case) to be encoded.  It would be nicer
> >to have an autopath.py that is independent from a particular project. 
> >
> >So what about trying to automize it completly like this: Start from the
> >directory where the invoked script/test is in and look upwards for a
> >directory *not* containing __init__.py anymore: This would be the
> >directory that needs to be ensured to be in sys.path. The last
> >one would we the autopath.projectdir so you can reference non-python 
> >resource files in the project. 
> >
> >I checked a bit and for pypy this should work as well as for
> >the other projects that use a clone of autopath.py.  Opinions? 
> >
> >cheers,
> >
> >    holger
> Sounds good.  Maybe we write a PEP and get it into the standard library,
> too.

wow, that took 2 minutes roundtrip :-) 

Yes, putting it in a standard place would be nicer than having to 
distribute it all over the project. For the time beeing this needs
to be done, though. 



More information about the Pypy-dev mailing list