From: Matthew S. <gld...@us...> - 2005-02-24 03:44:31
|
Stephen Waterbury wrote: > Mike, > > You may be aware that Phillip Eby's PEAK package has a > sub-package called 'dispatch', which unfortunately (and, > IMO, rather arrogantly ;) PEAK installs into the > top-level site-packages namespace. So, since I already > had PEAK installed when I installed PyDispatcher, I > did an 'import dispatch' and 'help(dispatch)' and was > completely astonished at the result until I realized > it was coming from PEAK's dispatch package. I think it does this because PEAK collects a lot of other packages. PJE's predicate dispatch package seems to be a "sister" package to the 'protocols' package in PyProtocols -- so this problem would exist for those using just PyProtocols and not just those using the entirety of PEAK. > Anyway, I realize that may or may not have practical > consequences, but it does make me uncomfortable. I need > both PEAK and PyDispatch in my application, so I was > wondering if anyone had tried that and, if so, whether > they had experienced anything untoward. Pat O'Brien and I ran into this namespace clash in developing Schevo, because we too use both PyDispatcher and PyProtocols' predicate-dispatch generic functions. We ended up solving the problem by a) including most Python dependencies within Schevo in a manner that doesn't clash with site-packages, and b) renaming the PyDispatch package from 'dispatch' to 'pydispatch' within those included dependencies. This turns out to work pretty well for us even though there is some sleight of hand involved, since we depend on the CVS/SVN HEAD versions of both PEAK and the 'py' library -- it ensures that the correct versions are used, users working out of our Subversion repository don't have to get their hands dirty with a lot of dependencies, and anything installed in site-packages is left untouched. -- Matthew R. Scott |