On Nov 16, 2007, at 6:10 PM, Darren Dale wrote:

> Hi Rob,
>
> On Friday 16 November 2007 11:14:50 am Rob Hetland wrote:
>> Some recent changes (in the last few days) have caused my build to
>> break.  Three things:
>>
>> First of all, the line in setupext.py:  if version.version.endswith
>> ('mpl'):
>> fails.  I can comment this block out, and set the return of
>> check_provide_traits(): to True, and things seem to work well.
>
> I'm surprised by that failure, but need some more information to  
> fix it. What
> is the type and value of version.version on your machine? What  
> specifically
> did you block out to make it work?
>


The exact error is:

EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES
              configobj: matplotlib will provide
Traceback (most recent call last):
   File "setup.py", line 234, in <module>
     if check_provide_traits(): build_traits(ext_modules, packages)
   File "/Users/rob/src/python/matplotlib/matplotlib/setupext.py",  
line 468, in check_provide_traits
     if version.version.endswith('mpl'):
AttributeError: 'module' object has no attribute 'version'


The problem is that my enthough.traits.version has no version attribute:


 >>> from enthought.traits import version
 >>> version.version
------------------------------------------------------------------------ 
---
AttributeError                            Traceback (most recent call  
last)

/Users/rob/<ipython console> in <module>()

AttributeError: 'module' object has no attribute 'version'




To make it work, I changed this:

def check_provide_traits():
     if options['provide_traits'] is True:
         print_status("enthought.traits", "matplotlib will provide")
         return True
     try:
         from enthought import traits
         try:
             from enthought.traits import version
         except:
             print_status("enthought.traits", "unknown and  
incompatible version: < 2.0")
             return False
         else:
             if version.version.endswith('mpl'):
                 print_status("enthought.traits", "matplotlib will  
provide")
                 return True
             else:
                 print_status("enthought.traits", version.version)
                 return False
     except ImportError:
         if options['provide_traits']:
             print_status("enthought.traits", "matplotlib will provide")
             return True
         else:
             print_status("enthought.traits", "no")
             return False


To this:


def check_provide_traits():
     if options['provide_traits'] is True:
         print_status("enthought.traits", "matplotlib will provide")
         return True
     try:
         from enthought import traits
         try:
             from enthought.traits import version
         except:
             print_status("enthought.traits", "unknown and  
incompatible version: < 2.0")
             return False
         else:
             # if version.version.endswith('mpl'):
             #     print_status("enthought.traits", "matplotlib will  
provide")
             #     return True
             # else:
             #     print_status("enthought.traits", version.version)
             #     return False
             return True
     except ImportError:
         if options['provide_traits']:
             print_status("enthought.traits", "matplotlib will provide")
             return True
         else:
             print_status("enthought.traits", "no")
             return False


I'm not sure if this is the _really_ right thing to do, but it does  
compile fine after this change, and I assume the answer (True) is the  
right one.

-Rob

----
Rob Hetland, Associate Professor
Dept. of Oceanography, Texas A&M University
http://pong.tamu.edu/~rob
phone: 979-458-0096, fax: 979-845-6331



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to