[pypy-dev] new autopath logic?

Laura Creighton lac at strakt.com
Wed May 5 18:44:21 CEST 2004

In a message of Wed, 05 May 2004 18:42:37 +0200, holger krekel writes:
>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
>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? 
>    holger

Sounds good.  Maybe we write a PEP and get it into the standard library,


More information about the Pypy-dev mailing list