From: Gael V. <gae...@no...> - 2008-06-08 20:58:33
|
Hey guys, Just got back from 3 weeks holydays (that feels really good, I should try this more often). I a fighting with a mountain of emails, but I just wanted to give a little heads up. Tout is working on the codebase that I originally wrote and got me addicted to the ETS, at the university of Toronto. He tried updating and did run in some minor incompatibility (some ".api" added, not the end of the word, I believe). However, more working (Darren Dale is Cced about that) is that matplotib includes its own version of Traits and tends to be quite light on the policy to decide when to overide the system one. As a result, and recent version of MPL make the code base die in the ETS parts. I have already mentioned this problem, and I believe it is a really evil one. I don't have time to do some lobbying about this right now, could someone make sure this is solved (Darren?). IMHO one temporary solution, less ugly then the current one, is the one we used in nipy: define a matplotlib.externals.traits that can point either to a system-wide traits, or to the embedded traits. Using some code in matplotlib.externals similar to: """ def import_traits(): """ Import traits, either from a system-wide location, or from our copy. """ try: from enthought import traits except ImportError: from matplotlib.externals.enthought import traits return traits traits = import_traits() """ You can put as much logics as you want in "import_traits" to check eg for version numbers. If in MPL you only import traits from matplotlib.traits, you can thus use traits and not have side effects on other libraries. IMHO, the current situation is untenable. Cheers, Gaël On Tue, Jun 03, 2008 at 01:51:40PM -0500, Dave Peterson wrote: > Tout Wang wrote: > That worked to resolve the ImportError for View but now it gets stuck > at ui. I think ui is still imported from enthought.traits.ui because > from enthought.traits.ui import ui > works just fine. It seems that the main problem is that the latest > version of Enthought has changed how things are imported, which is a > little annoying because I expected that newer versions would be almost > entirely backwards compatible. I wonder why this is? > Anyway, I have reverted to Enthon 1.0.0 (Python 2.4.3) and everything > imports just fine now from TraitsUI with the original code. > Enthon 1.0.0 was released in August of 2006. At that time (about 7,000 > svn revisions ago!) Traits was reporting itself as version 1.0.2. EPD > includes enthought.traits 2.0.4 as you've already seen. Even though our > policy on version numbers didn't come into being until well after Enthon > 1.0.0 was released, I think it reasonable that there would be some > API-incompatible changes between version 1 and version 2. > IIRC, the changes between these versions are more about adding features > than they are about breaking or leaving behind functionality. Yes, the > locations of where to import some things may have changed (centralized to > an api.py rather than in __init__.py) but in general most everything else > should work pretty much the same. |