Diff for /python/pyGiNaC/setup3.py between versions 1.5 and 1.6

version 1.5, 2001/04/25 19:22:25 version 1.6, 2001/04/26 19:44:48
Line 12 Line 12
 # Usage:  # Usage:
 #   > python setup.py doc install  # this will generate ginac.doc, builds _ginac  #   > python setup.py doc install  # this will generate ginac.doc, builds _ginac
 #                                  # and installs the package.  #                                  # and installs the package.
 #   > python setup.py test -v      # this will generate and run test/test_dt.py  #   > python setup.py test -v      # this will generate and run doctests.
 #  #
 # In Python `import ginac'. Module `ginac' extension classes exposing  # In Python `import ginac'. Module `ginac' extension classes exposing
 # almost all GiNaC classes to Python.  # almost all GiNaC classes to Python.
Line 32 Line 32
 # 23 April 2001  # 23 April 2001
   
 __credits__ = """\  __credits__ = """\
 GiNaC people (www.ginac.de), for the GiNaC library.  GiNaC group (www.ginac.de), for the GiNaC library.
 Boost.Python people (www.boost.org), for BPL that considerably  Boost.Python group (www.boost.org), for BPL that considerably
 simplified the wrapping of GiNaC C++ classes to Python.  simplified in exposing GiNaC C++ classes to Python.
 """  """
   
 import sys,os,string,time  import sys,os,string,time
   
   __today__ = time.asctime(time.localtime())
   __author__ = 'Pearu Peterson <pearu@cens.ioc.ee>'
   
 #++++++++++++++ Require Python 2.x +++++++++++++  #++++++++++++++ Require Python 2.x +++++++++++++
   
 if eval(sys.version[0])<2:  if eval(sys.version[0])<2:
Line 49  if eval(sys.version[0])<2: Line 52  if eval(sys.version[0])<2:
 rebuild = 0  rebuild = 0
 gendoc = 0  gendoc = 0
 gentest = 0  gentest = 0
 disable_opt = 1 # set 0 for final compilation  disable_opt = 0 # set 0 for final compilation
   
 if 'test' in sys.argv:  if 'test' in sys.argv:
     i = sys.argv.index('test')      i = sys.argv.index('test')
Line 91  wrap_input = ['symbol','numeric','consta Line 94  wrap_input = ['symbol','numeric','consta
   
 wrap_input = ['ex','symbol','numeric','lst','add','mul','power',  wrap_input = ['ex','symbol','numeric','lst','add','mul','power',
               'inifcns','function','relational','seq',                'inifcns','function','relational','seq',
               'constant','matrix']                'constant','matrix','pseries','ncmul']
   
 #++++++++++++++++ Parameters ++++++++++++++++  #++++++++++++++++ Parameters ++++++++++++++++
 #nof_lst_params = 10   # max 15 for ginac, max 10 for boost.python, min 1  #nof_lst_params = 10   # max 15 for ginac, max 10 for boost.python, min 1
Line 156  ex_src = [ Line 159  ex_src = [
     os.path.join(wrapper_dir,'slice.c'),      os.path.join(wrapper_dir,'slice.c'),
     ]      ]
   
 if gentest:  if gentest or gendoc:
     import re      import re
     dt_match = re.compile(r'\s*/[*]DT(?P<text>.*?)[*]/',re.M|re.S)      dt_match = re.compile(r'\s*/[*]DT(?P<text>.*?)[*]/',re.M|re.S)
     mdt_match = re.compile(r'\s*/[*]M_DT(?P<text>.*?)[*]/',re.M|re.S)      mdt_match = re.compile(r'\s*/[*]M_DT(?P<text>.*?)[*]/',re.M|re.S)
Line 165  if gentest: Line 168  if gentest:
     fon = os.path.join(lib_dir,'doc','__init__.py')      fon = os.path.join(lib_dir,'doc','__init__.py')
     fo = open(fon,'w')      fo = open(fon,'w')
     ftodo = open('TODO_py.txt','w')      ftodo = open('TODO_py.txt','w')
     fo.write('''#!/usr/bin/env python      
 import sys,os      fo.write('#!/usr/bin/env python\n')
 from distutils import util      fo.write('"""PyGiNaC class documentation."""\n')
 sys.path.insert(0,os.path.abspath(os.path.join("build","lib.%s-%s" % (util.get_platform(),sys.version[0:3]))))      fo.write('__version__ = '+`version`+'\n')
 ''')      fo.write('__date__ = '+`__today__`+'\n')
       fo.write('__author__ = '+`__author__`+'\n')
       fo.write('__credits__ = '+`__credits__`+'\n')
       fo.write('''\
   # This file (ginac/doc/.__init__.py) is auto-generated with
   # a command "cd pyGiNaC && ./setup.py test"
   # Website: http://cens.ioc.ee/projects/pyginac/\n''')
       fo.write('''\
   if __name__ == "__main__":
       import sys,os
       from distutils import util
       sys.path.insert(0,os.path.abspath(os.path.join("build","lib.%s-%s" % (util.get_platform(),sys.version[0:3]))))\n''')
     ex_methods = []      ex_methods = []
     i = 0      i = 0
     for s in wrap_input:      for s in wrap_input:
Line 199  sys.path.insert(0,os.path.abspath(os.pat Line 213  sys.path.insert(0,os.path.abspath(os.pat
     fo.write('''\      fo.write('''\
 class ex:  class ex:
 %s  %s
 def _test():  if __name__ == "__main__":
     import doctest      import doctest
     import __init__ as tt      import __init__ as tt
     return doctest.testmod(tt)      doctest.testmod(tt)\n'''%('\n'.join(ex_methods)))
 if __name__ == "__main__":  
     _test()\n'''%('\n'.join(ex_methods)))  
     fo.close()      fo.close()
     ftodo.close()      ftodo.close()
     if gentest==2:      if gentest==2:
         os.system('%s %s -v'%(sys.executable,fon))          os.system('%s %s -v'%(sys.executable,fon))
     else:      elif gentest==1:
         os.system('%s %s'%(sys.executable,fon))          os.system('%s %s'%(sys.executable,fon))
       if gendoc:
           os.system('cd doc && pydoc -w ginac.html ginac')
           os.system('cd doc && pydoc -w ginac.doc.html ginac.doc')
 if len(sys.argv)==1:  if len(sys.argv)==1:
     print "PyGiNaC Version",version      print "PyGiNaC Version",version
     sys.exit()      sys.exit()
Line 269  if rebuild: Line 283  if rebuild:
     f.write('#endif\n')      f.write('#endif\n')
     f.close()       f.close() 
                         
 ginac_ext = Extension('ginac._ginac3',  ginac_ext = Extension('ginac._ginac',
                       sources=ex_src+bpl_src,                        sources=ex_src+bpl_src,
                       include_dirs=[boost_dir,wrapper_dir],                        include_dirs=[boost_dir,wrapper_dir],
                       libraries=['ginac','cln'],                        libraries=['ginac','cln'],

Removed from v.1.5  
changed lines
  Added in v.1.6


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>