zc buildout sys.path is incorrect

Bug #438469 reported by syn66
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Thin Client Manager NG
Invalid
High
René Fleschenberg

Bug Description

buildout/bin/tcm runs the *system* tcm libs, not the testing tcm libs... as shown below

hex@Fibonacci:~/tcm-ng/buildout$ cat bin/pytcm
#!/usr/bin/python

import sys

sys.path[0:0] = [
  '/usr/lib/python2.5/site-packages',
  '/usr/lib/python2.5/site-packages',
  '/usr/lib/python2.5/site-packages',
  '/home/hex/tcm-ng/buildout/eggs/nose-0.11.1-py2.5.egg',
  '/home/hex/tcm-ng/buildout/eggs/guitest-0.3-py2.5.egg',
  '/home/hex/tcm-ng/buildout/eggs/stdeb-0.4-py2.5.egg',
  '/home/hex/tcm-ng/buildout/parts/site-packages',
  '/home/hex/tcm-ng/buildout/parts/gtkvnc/lib/python2.4/site-packages',
  '/home/hex/tcm-ng/buildout/parts/gtkvnc/lib/python2.5/site-packages',
  '/home/hex/tcm-ng/buildout/parts/gtkvnc/lib/python2.6/site-packages',
  ]

_interactive = True
if len(sys.argv) > 1:
    _options, _args = __import__("getopt").getopt(sys.argv[1:], 'ic:m:')
    _interactive = False
    for (_opt, _val) in _options:
        if _opt == '-i':
            _interactive = True
        elif _opt == '-c':
            exec _val
        elif _opt == '-m':
            sys.argv[1:] = _args
            _args = []
            __import__("runpy").run_module(
                 _val, {}, "__main__", alter_sys=True)

    if _args:
        sys.argv[:] = _args
        __file__ = _args[0]
        del _options, _args
        execfile(__file__)

if _interactive:
    del _interactive
    __import__("code").interact(banner="", local=globals())
hex@Fibonacci:~/tcm-ng/buildout$ bin/pytcm

>>> import tcm
>>> tcm.__path__
['/usr/lib/python2.5/site-packages/tcm']

It looks like the testing paths aren't even getting into the buildout.

Revision history for this message
syn66 (syn66) wrote :

Would it be possible to add a variable to zc to set a different glade path during testing? This is also a problem.

Revision history for this message
René Fleschenberg (rene.f) wrote :

Hi,

As far as I know, this is the normal behaviour. I think you have these options:

1. Make sure you don't have a system tcm installed while using buildout.
2. Don't use buildout (you can ignore the buildout folder and set up the stuff you need yourself, it's just some extra work).
3. Use a virtualenv with the --no-site-packages option to isolate your tcm buildout from the system Python.

I recommend option 3.

Changed in tcm-ng:
status: New → Invalid
Revision history for this message
syn66 (syn66) wrote :

Method 1 is not viable since the dbus configs need to be installed before tcm can be used.

Using method 3 requires that pygobject be installed so pygtk will install in the virtualenv (so I can import gtk). pygobject installation isn't supported using distutils, so it doesn't appear to be possible with zc.

method 2 requires some code changes to properly reference testing code instead of global code.

How exactly are you developing your code?

Revision history for this message
René Fleschenberg (rene.f) wrote : Re: [Bug 438469] Re: zc buildout sys.path is incorrect

Hi,

syn66:
> Method 1 is not viable since the dbus configs need to be installed
> before tcm can be used.

Right, that is an isolation violation I am living with at the moment
(see below).

> Using method 3 requires that pygobject be installed so pygtk will
> install in the virtualenv (so I can import gtk). pygobject
> installation isn't supported using distutils, so it doesn't appear
> to be possible with zc.

There is a buildout recipe for PyGTK at https://svn.thomas-
lotze.de/repos/public/tl.buildout_gtk. I took a look at it, but have
stopped using it for now. I don't remember why, but I decided it was
not worth the effort at the moment.

> method 2 requires some code changes to properly reference testing
> code instead of global code.

That sounds like a bug that should be fixed. Can you provide more
details on this one?

> How exactly are you developing your code?

So far, I manually copy the dbus configs when I need them.

--
René Fleschenberg
Phone: +49 1577 170 7363

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.