[Python-modules-commits] [fparser] 02/03: Add dependencies on python*-six for python3 support

Alastair McKinstry mckinstry at moszumanska.debian.org
Mon Sep 18 13:24:31 UTC 2017


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch debian/master
in repository fparser.

commit 1d1bf2149d9a3c8bc13e59a6b0b19da075b78f53
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Sat Jul 29 10:17:40 2017 +0100

    Add dependencies on python*-six for python3 support
---
 debian/changelog             |   1 +
 debian/control               |   2 +-
 debian/patches/python3.patch | 100 +++++++++++++++++++++++++++++++++----------
 3 files changed, 79 insertions(+), 24 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index a552e8b..fdd778d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 fparser (0.0.5-2) unstable; urgency=medium
 
   * Add python3 support
+  * Add dependencies on python*-six for python3 support
   * Add link to Git rep to debian/control
   * Change Arch from any to all
   * Add Vcs-Git: to  debian repo
diff --git a/debian/control b/debian/control
index 8ca5fad..91ca44e 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: python
 Priority: optional
 Maintainer: Alastair McKinstry <mckinstry at debian.org>
 Build-Depends: debhelper (>= 10), python-all, dh-python, python-setuptools,
- python3-all, python3-setuptools
+ python3-all, python3-setuptools, python-six, python3-six
 Standards-Version: 4.0.0
 Homepage: https://github.com/stfc/fparser
 Vcs-Git: git://anonscm.debian.org/python-modules/packages/fparser.git
diff --git a/debian/patches/python3.patch b/debian/patches/python3.patch
index 4681667..1605516 100644
--- a/debian/patches/python3.patch
+++ b/debian/patches/python3.patch
@@ -56,7 +56,7 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
 ===================================================================
 --- fparser-0.0.5.orig/src/fparser/base_classes.py
 +++ fparser-0.0.5/src/fparser/base_classes.py
-@@ -73,10 +73,11 @@ import re
+@@ -73,10 +73,12 @@ import re
  import sys
  import copy
  import logging
@@ -68,10 +68,11 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
 +from .utils import split_comma, specs_split_comma, is_int_literal_constant
 +from .utils import classes
 +from functools import reduce
++from six import with_metaclass
  
  logger = logging.getLogger('fparser')
  
-@@ -91,7 +92,7 @@ class AttributeHolder(object):
+@@ -91,7 +93,7 @@ class AttributeHolder(object):
      def __init__(self, **kws):
          self._attributes = {}
          self._readonly = []
@@ -80,7 +81,7 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
              self._attributes[k] = v
              if callable(v):
                  self._readonly.append(k)
-@@ -99,10 +100,10 @@ class AttributeHolder(object):
+@@ -99,10 +101,10 @@ class AttributeHolder(object):
  
      def __getattr__(self, name):
          if name not in self._attributes:
@@ -93,7 +94,7 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
          value = self._attributes[name]
          if callable(value):
              value = value()
-@@ -114,16 +115,16 @@ class AttributeHolder(object):
+@@ -114,16 +116,16 @@ class AttributeHolder(object):
              self.__dict__[name] = value
              return
          if name in self._readonly:
@@ -115,7 +116,7 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
              v = getattr(self,k)
              if v: return False
          return True
-@@ -134,20 +135,20 @@ class AttributeHolder(object):
+@@ -134,20 +136,20 @@ class AttributeHolder(object):
          if depth==0: return tab + self.__class__.__name__
          l = [self.__class__.__name__+':']
          ttab = tab + '    '
@@ -139,16 +140,16 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
              v = getattr(self, k)
              d[k] = v
          return d
-@@ -158,7 +159,7 @@ def get_base_classes(cls):
+@@ -158,7 +160,7 @@ def get_base_classes(cls):
          bases += get_base_classes(c)
      return bases + cls.__bases__ + (cls,)
  
 -class Variable(object):
-+class Variable(object, metaclass=classes):
++class Variable(with_metaclass(classes, object)):
      """
      Variable instance has attributes:
        name
-@@ -168,8 +169,6 @@ class Variable(object):
+@@ -168,8 +170,6 @@ class Variable(object):
        intent
        parent - Statement instances defining the variable
      """
@@ -157,7 +158,7 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
      
      def __init__(self, parent, name):
          self.parent = parent
-@@ -227,7 +226,7 @@ class Variable(object):
+@@ -227,7 +227,7 @@ class Variable(object):
          return self.typedecl
  
      def add_parent(self, parent):
@@ -166,7 +167,7 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
              self.parents.append(parent)
          self.parent = parent
          return
-@@ -361,26 +360,26 @@ class Variable(object):
+@@ -361,26 +361,26 @@ class Variable(object):
              lattr = attr.lower()
              uattr = attr.upper()
              if lattr.startswith('dimension'):
@@ -198,18 +199,18 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
                  self.check.extend(split_comma(l[1:-1].strip(), self.parent.item))
                  continue
              if uattr not in attributes:
-@@ -483,18 +482,17 @@ class Variable(object):
+@@ -483,18 +483,17 @@ class Variable(object):
      def info(self, message):
          return self.parent.info(message)
  
 -class ProgramBlock(object):
-+class ProgramBlock(object, metaclass=classes):
++class ProgramBlock(with_metaclass(classes,object)):
  
 -    __metaclass__ = classes
 +    pass
  
 -class Statement(object):
-+class Statement(object, metaclass=classes):
++class Statement(with_metaclass(classes, object)):
      """
      Statement instance has attributes:
        parent  - Parent BeginStatement or FortranParser instance
@@ -220,7 +221,7 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
  
      modes = ['free','fix','f77','pyf']
      _repr_attr_names = []
-@@ -746,7 +744,7 @@ class BeginStatement(Statement):
+@@ -746,7 +745,7 @@ class BeginStatement(Statement):
                  # TODO: FIX ME, Comment content is a string
                  self.content.append(classes.Comment(self, item))
              else:
@@ -229,6 +230,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
              item = self.get_item()
  
          if not end_flag:
+Index: fparser-0.0.5/src/fparser/Fortran2003.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/Fortran2003.py
 +++ fparser-0.0.5/src/fparser/Fortran2003.py
 @@ -69,11 +69,12 @@
@@ -537,6 +540,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
          subclasses = Base.subclasses.get(cls.__name__,[])
          subclasses_names = [c.__name__ for c in subclasses]
          subclass_names = getattr(cls,'subclass_names', [])
+Index: fparser-0.0.5/src/fparser/block_statements.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/block_statements.py
 +++ fparser-0.0.5/src/fparser/block_statements.py
 @@ -80,10 +80,10 @@ __all__ = ['BeginSource', 'Module', 'Pyt
@@ -792,6 +797,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
  
  f2py_stmt = [Threadsafe, FortranName, Depend, Check, CallStatement,
               CallProtoArgument]
+Index: fparser-0.0.5/src/fparser/parsefortran.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/parsefortran.py
 +++ fparser-0.0.5/src/fparser/parsefortran.py
 @@ -68,6 +68,8 @@
@@ -872,6 +879,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
  
  if __name__ == "__main__":
      #test_f77()
+Index: fparser-0.0.5/src/fparser/pattern_tools.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/pattern_tools.py
 +++ fparser-0.0.5/src/fparser/pattern_tools.py
 @@ -75,6 +75,8 @@ Created: Oct 2006
@@ -967,6 +976,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
  
  if __name__ == '__main__':
      _test()
+Index: fparser-0.0.5/src/fparser/readfortran.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/readfortran.py
 +++ fparser-0.0.5/src/fparser/readfortran.py
 @@ -80,20 +80,20 @@ Examples
@@ -1184,6 +1195,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
              sys.stdout.flush()
              pass
  
+Index: fparser-0.0.5/src/fparser/scripts/f2003.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/scripts/f2003.py
 +++ fparser-0.0.5/src/fparser/scripts/f2003.py
 @@ -82,11 +82,11 @@ def runner (parser, options, args):
@@ -1203,6 +1216,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
              return
  
  def main ():
+Index: fparser-0.0.5/src/fparser/scripts/parse.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/scripts/parse.py
 +++ fparser-0.0.5/src/fparser/scripts/parse.py
 @@ -63,6 +63,7 @@
@@ -1227,6 +1242,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
          
  
  def main ():
+Index: fparser-0.0.5/src/fparser/scripts/read.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/scripts/read.py
 +++ fparser-0.0.5/src/fparser/scripts/read.py
 @@ -63,6 +63,7 @@
@@ -1250,6 +1267,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
          
  
  def main ():
+Index: fparser-0.0.5/src/fparser/sourceinfo.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/sourceinfo.py
 +++ fparser-0.0.5/src/fparser/sourceinfo.py
 @@ -75,6 +75,7 @@ Author: Pearu Peterson <pearu at cens.ioc.e
@@ -1269,6 +1288,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
  
  if __name__ == '__main__':
      simple_main()
+Index: fparser-0.0.5/src/fparser/splitline.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/splitline.py
 +++ fparser-0.0.5/src/fparser/splitline.py
 @@ -72,6 +72,8 @@ First version created: May 2006
@@ -1344,6 +1365,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
  
  if __name__ == '__main__':
      test()
+Index: fparser-0.0.5/src/fparser/statements.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/statements.py
 +++ fparser-0.0.5/src/fparser/statements.py
 @@ -66,6 +66,7 @@
@@ -1650,6 +1673,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
          stripped = self.item.comment.lstrip()
          self.is_blank = not stripped
          self.content = stripped[1:] if stripped else ''
+Index: fparser-0.0.5/src/fparser/tests/test_Fortran2003.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/tests/test_Fortran2003.py
 +++ fparser-0.0.5/src/fparser/tests/test_Fortran2003.py
 @@ -62,6 +62,7 @@
@@ -5301,6 +5326,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
 +    print ('Nof tests needs:',nof_needed_tests,'out of',total_needs)
 +    print ('Total number of classes:',total_classes)
 +    print ('-----')
+Index: fparser-0.0.5/src/fparser/tests/test_api.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/tests/test_api.py
 +++ fparser-0.0.5/src/fparser/tests/test_api.py
 @@ -65,6 +65,7 @@
@@ -5332,6 +5359,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
      for stmt, depth in api.walk(tree, 1):
 -        print depth, stmt.item
 +        print (depth, stmt.item)
+Index: fparser-0.0.5/src/fparser/tests/test_blank_lines.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/tests/test_blank_lines.py
 +++ fparser-0.0.5/src/fparser/tests/test_blank_lines.py
 @@ -62,6 +62,7 @@
@@ -5351,6 +5380,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
      assert str(tree).strip().split('\n')[1:] == '''
        !      BEGINSOURCE <cStringIO.StringI object at 0x3723710> mode=f77
          SUBROUTINE bl(a, b, c)
+Index: fparser-0.0.5/src/fparser/tests/test_issue11.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/tests/test_issue11.py
 +++ fparser-0.0.5/src/fparser/tests/test_issue11.py
 @@ -62,6 +62,7 @@
@@ -5370,6 +5401,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
      return
      assert str(tree).strip().split('\n')[1:]=='''
      '''.strip().split('\n')[1:]
+Index: fparser-0.0.5/src/fparser/tests/test_issue25.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/tests/test_issue25.py
 +++ fparser-0.0.5/src/fparser/tests/test_issue25.py
 @@ -104,4 +104,4 @@ END MODULE testa
@@ -5378,6 +5411,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
    END MODULE testa
 -    '''.strip().split('\n')[1:],`r`
 +    '''.strip().split('\n')[1:],repr(r)
+Index: fparser-0.0.5/src/fparser/tests/test_issue26.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/tests/test_issue26.py
 +++ fparser-0.0.5/src/fparser/tests/test_issue26.py
 @@ -107,4 +107,4 @@ END MODULE testa
@@ -5386,6 +5421,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
  
 -    '''.strip().split('\n')[1:],`r`
 +    '''.strip().split('\n')[1:],repr(r)
+Index: fparser-0.0.5/src/fparser/tests/test_issue33.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/tests/test_issue33.py
 +++ fparser-0.0.5/src/fparser/tests/test_issue33.py
 @@ -86,4 +86,4 @@ end module foo
@@ -5394,6 +5431,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
    END MODULE foo
 -    '''.strip().split('\n')[1:],`r`
 +    '''.strip().split('\n')[1:],repr(r)
+Index: fparser-0.0.5/src/fparser/tests/test_issue5.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/tests/test_issue5.py
 +++ fparser-0.0.5/src/fparser/tests/test_issue5.py
 @@ -78,14 +78,14 @@ def test_reproduce_issue():
@@ -5413,6 +5452,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
      assert b.name =='b'
      assert b.typedecl.selector==('2','')
  
+Index: fparser-0.0.5/src/fparser/tests/test_issue7.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/tests/test_issue7.py
 +++ fparser-0.0.5/src/fparser/tests/test_issue7.py
 @@ -79,10 +79,10 @@ C
@@ -5519,6 +5560,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
 +    assert ab.span==(2,6),repr(a.span)
 +    assert comment.span==(3,3),repr(comment.span)
      assert end.span==(7,7)
+Index: fparser-0.0.5/src/fparser/tests/test_mod_private.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/tests/test_mod_private.py
 +++ fparser-0.0.5/src/fparser/tests/test_mod_private.py
 @@ -74,9 +74,9 @@ end subroutine
@@ -5534,6 +5577,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
  
  def test_access_spec():
      src = '''\
+Index: fparser-0.0.5/src/fparser/tests/test_parser.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/tests/test_parser.py
 +++ fparser-0.0.5/src/fparser/tests/test_parser.py
 @@ -81,7 +81,7 @@ def parse(cls, line, label='', isfree=Tr
@@ -5545,6 +5590,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
      if not cls.match(item.get_line()):
          raise ValueError('%r does not match %s pattern'%(line, cls.__name__))
      stmt = cls(item, item)
+Index: fparser-0.0.5/src/fparser/tests/test_select.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/tests/test_select.py
 +++ fparser-0.0.5/src/fparser/tests/test_select.py
 @@ -66,7 +66,7 @@
@@ -5646,6 +5693,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
      assert "expected class-construct-name 'not_a_name' but got " in output
  
  
+Index: fparser-0.0.5/src/fparser/tests/test_utils.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/tests/test_utils.py
 +++ fparser-0.0.5/src/fparser/tests/test_utils.py
 @@ -36,7 +36,7 @@
@@ -5695,6 +5744,8 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
      assert items[0] == "well(1)"
      assert items[1] == "this(is)"
      assert items[2] == "it"
+Index: fparser-0.0.5/src/fparser/typedecl_statements.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/typedecl_statements.py
 +++ fparser-0.0.5/src/fparser/typedecl_statements.py
 @@ -74,9 +74,9 @@ __all__ = ['Integer', 'Real', 'DoublePre
@@ -5865,17 +5916,20 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
              items.append((stmt,specs))
          self.items = items
          return
+Index: fparser-0.0.5/src/fparser/utils.py
+===================================================================
 --- fparser-0.0.5.orig/src/fparser/utils.py
 +++ fparser-0.0.5/src/fparser/utils.py
-@@ -74,6 +74,7 @@ Author: Pearu Peterson <pearu at cens.ioc.e
+@@ -74,6 +74,8 @@ Author: Pearu Peterson <pearu at cens.ioc.e
  Created: May 2006
  -----
  """
 +from __future__ import print_function
++from six import with_metaclass
  
  __all__ = ['split_comma', 'specs_split_comma',
             'ParseError','AnalyzeError',
-@@ -195,7 +196,7 @@ def parse_bind(line, item = None):
+@@ -195,7 +197,7 @@ def parse_bind(line, item = None):
          newitem = None
      newline = newline[4:].lstrip()
      i = newline.find(')')
@@ -5884,7 +5938,7 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
      args = []
      for a in specs_split_comma(newline[1:i].strip(), newitem, upper=True):
          args.append(a)
-@@ -209,9 +210,9 @@ def parse_result(line, item = None):
+@@ -209,9 +211,9 @@ def parse_result(line, item = None):
          return None, line
      line = line[6:].lstrip()
      i = line.find(')')
@@ -5896,7 +5950,7 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
      return name, line[i+1:].lstrip()
  
  def filter_stmts(content, classes):
-@@ -243,7 +244,7 @@ def get_module_files(directory, _cache={
+@@ -243,7 +245,7 @@ def get_module_files(directory, _cache={
          for name in module_line.findall(f.read()):
              name = name[1]
              if name in d:
@@ -5905,7 +5959,7 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
                  continue
              d[name] = fn
      _cache[directory] = d
-@@ -283,8 +284,8 @@ def module_in_file(name, filename):
+@@ -283,8 +285,8 @@ def module_in_file(name, filename):
  def str2stmt(string, isfree=True, isstrict=False):
      """ Convert Fortran code to Statement tree.
      """
@@ -5916,7 +5970,7 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
      reader = FortranStringReader(string, isfree, isstrict)
      parser = FortranParser(reader)
      parser.parse()
-@@ -314,13 +315,13 @@ def show_item_on_failure(func, _exceptio
+@@ -314,13 +316,13 @@ def show_item_on_failure(func, _exceptio
      def new_func(self):
          try:
              func(self)
@@ -5933,16 +5987,16 @@ Index: fparser-0.0.5/src/fparser/base_classes.py
              _exception_depth[0] += 1
              if _exception_depth[0]==1:
                  self.error('exception triggered here: %s %s' % (Exception, msg))
-@@ -340,7 +341,7 @@ class meta_classes(type):
+@@ -340,7 +342,7 @@ class meta_classes(type):
              raise AttributeError('instance does not have attribute %r' % (name))
          return cls
  
 -class classes(type):
-+class classes(type, metaclass = meta_classes):
++class classes(with_metaclass(meta_classes, type)):
      """Make classes available as attributes of this class.
  
      To add a class to the attributes list, one must use::
-@@ -354,7 +355,6 @@ class classes(type):
+@@ -354,7 +356,6 @@ class classes(type):
      * decorate analyze methods with show_item_on_failure
      """
  

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/fparser.git



More information about the Python-modules-commits mailing list