[pypy-dev] new autopath logic?
hpk at trillke.net
Wed May 5 18:42:37 CEST 2004
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 line
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?
More information about the Pypy-dev