On Sun, Jun 08, 2008 at 06:13:24PM -0400, Darren Dale wrote:
> Matplotlib's setup scripts are designed to avoid this problem. There are 
> three 
> conditions under which we install traits:

> 1) Traits is not installed
> 2) A previous version of traits is installed, but it is a version installed 
> by 
> matplotlib. I added an "-mpl" to the end of traits __version__ string so we 
> can keep track.
> 3) The user explicitly askes for it in setup.cfg

> So if matplotlib is overwriting traits when it should not, I want to fix it. 
> But I need more information about what is causing it, because I don't see how 
> it could happen.

If Traits is installed after MPL, if I get it right, then the problem
occurs. IIRC, this is the problem I stumbled upon once.

> I tried this when I first started working with TConfig, and concluded
> that it was not possible because there are too many places where traits
> expects enthought to be a top level package. There were all kind of
> errors, exceptions being raised that were not named as expected,
> extension code that would need to be modified, so we settled on the
> current solution.

OK. You are right. In nipy I modified enthought.traits and
enthought.etsconfig. This was not a beautiful job, I must admit. Maybe
monkey patching sys.path is the option (it is the way eggs do it) thought
I must admit I hate it, because it puts a lot of magic, that will
take the user by surprise. Anyway, the criteria for monkey-patching
sys.path must be improved, I feel.

If I understand things correctly, the current problem can be described
by:

   * User has an old version of ETS, (the one in Enthon 1.0.4, that is a
     very old one), his code needs the old version.
   * User installs a new version of MPL.
   * His code stops working.

I agree that as you describe things, this should not happen. Maybe I have
gotten wrong the order in which the user did things. I have the feeling
things shouldn't be dependent on the order in which you do the steps
(maybe the test for monkey-patching sys.path should not be at
install time, but at load time).

Maybe the test fails for a very old version of traits. I wanted to have a
quick look at this code, but I can't find it after a quick scan of the
MPL source, and I can't devote much time to this right now.

Cheers,

Gaƫl


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to