On Fri, Sep 06, 2013 at 11:02:54AM +0200, Antonio Cuni wrote:
> Hi,
> 
> On 05/09/13 17:09, vext01 wrote:
> >Log: (RichardN, Edd) Add the jitviewer path to PYTHONPATH automatically.
> >
> >diff --git a/bin/jitviewer.py b/bin/jitviewer.py
> >--- a/bin/jitviewer.py
> >+++ b/bin/jitviewer.py
> >@@ -1,4 +1,10 @@
> >  #!/usr/bin/env pypy
> >  import sys
> >+import os.path
> >+
> >+script_path = os.path.abspath(__file__)
> >+pythonpath = os.path.dirname(os.path.dirname(script_path))
> >+sys.path.append(pythonpath)
> 
> this looks wrong.
> 
> I think that the jitviewer is supposed to be installed as a normal
> package inside the pypy distribution to work well.

I was following the first installation method in the README.rst (albeit i
was using pure virtualenv without virtualenvwrapper as it doesn't work on
BSD).

> You should do:
> $ /path/to/pypy/bin/pypy /path/to/jitviewer/setup.py develop
> 
> this way, setuptools creates a link and the jitviewer package is
> installed in pypy even if it's physically in the repo (which is
> convenient for developing).

Doing the above I see that jitviewer is installed into the virtualenv.
Jitviewer can then be run from the virtualenv just fine.

>+script_path = os.path.abspath(__file__)
>+pythonpath = os.path.dirname(os.path.dirname(script_path))
>+sys.path.append(pythonpath)

Here we are appending to the path, not overriding it, hence this is safe for
either method. Right?

-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to