#5060: setup.py dependency checking detects unexpected dependencies
-------------------------+--------------------------------------------------
 Reporter:  sbarthelemy  |        Owner:  mabshoff
     Type:  defect       |       Status:  new     
 Priority:  major        |    Milestone:          
Component:  build        |   Resolution:          
 Keywords:               |  
-------------------------+--------------------------------------------------
Comment (by sbarthelemy):

 some more thoughts

 1. the include keyword is deprecated
 [http://docs.cython.org/docs/language_basics.html?highlight=include#the-
 include-statement cython doc],

 2. the current regexp misses other cython patterns that involve
 dependancies:
 {{{
 cimport mod1, mod2
 }}}
 and
 {{{
 cdef extern from "toto.h":
     ....
 }}}
 Here is a first attempt to fix this,
 {{{
 import re
 dep_regex = re.compile(r'^ *(?:(?:(?:(?:include)|(?:cdef +extern + from))
 +[\'"]([^\'"]+)[\'"])|(?:from +(\w+) *cimport)|(?:cimport +([^
 \t\n\r\f\v,]+)(?: *, *([^ \t\n\r\f\v,]+))*))',  re.MULTILINE)

 teststr = """include "yes1.h"
 include "yes2.h"
  include "yes3.h"
  include 'yes4.h'
 #include "no5.h"
  # include "no6.h"
 cimport yes7
  cimport yes8
 #cimport no9
 # cimport no10
 from yes11 cimport toto
 from yes12 cimport toto as tata
 #from no13 cimport toto as tata
 cdef extern from "yes14.h"
 cimport yes15 , yes15b
 cimport yes16, yes16b
 cimport yes17, yes17b , yes17c

 """

 print 'toto'
 for m in dep_regex.finditer(teststr):
     print m.groups()
 }}}

 However, for some reason, it doesn't catch yes14.h nor yes17b. So this is
 not yet functional (nor elegant). Any suggestion is welcome.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5060#comment:2>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to