[Python-modules-commits] r30987 - in packages/python-traits/trunk/debian (8 files)

jcjaskula-guest at users.alioth.debian.org jcjaskula-guest at users.alioth.debian.org
Sat Oct 11 18:30:20 UTC 2014


    Date: Saturday, October 11, 2014 @ 18:30:19
  Author: jcjaskula-guest
Revision: 30987

Dropped cdbs and starts building python3 package

Added:
  packages/python-traits/trunk/debian/patches/
  packages/python-traits/trunk/debian/patches/py3_sort_fix.patch
  packages/python-traits/trunk/debian/patches/remove_testing_dependencies_class.patch
  packages/python-traits/trunk/debian/patches/series
Modified:
  packages/python-traits/trunk/debian/changelog
  packages/python-traits/trunk/debian/compat
  packages/python-traits/trunk/debian/control
  packages/python-traits/trunk/debian/rules

Modified: packages/python-traits/trunk/debian/changelog
===================================================================
--- packages/python-traits/trunk/debian/changelog	2014-10-11 18:29:57 UTC (rev 30986)
+++ packages/python-traits/trunk/debian/changelog	2014-10-11 18:30:19 UTC (rev 30987)
@@ -1,3 +1,13 @@
+python-traits (4.5.0-0.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * New upstream release
+  * Building a python3 package
+  * Bump Standards-Version to 3.9.6 (no changes needed)
+  * Dropped cdbs in favor of dh-* and pybuild
+
+ -- Jean-Christophe Jaskula <jchristophe.debian at gmail.com>  Mon, 06 Oct 2014 23:08:11 -0400
+
 python-traits (4.4.0-1) unstable; urgency=low
 
   [ Jakub Wilk ]

Modified: packages/python-traits/trunk/debian/compat
===================================================================
--- packages/python-traits/trunk/debian/compat	2014-10-11 18:29:57 UTC (rev 30986)
+++ packages/python-traits/trunk/debian/compat	2014-10-11 18:30:19 UTC (rev 30987)
@@ -1 +1 @@
-7
+9

Modified: packages/python-traits/trunk/debian/control
===================================================================
--- packages/python-traits/trunk/debian/control	2014-10-11 18:29:57 UTC (rev 30986)
+++ packages/python-traits/trunk/debian/control	2014-10-11 18:30:19 UTC (rev 30987)
@@ -3,10 +3,11 @@
 Priority: optional
 Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
 Uploaders: Varun Hiremath <varun at debian.org>
-Build-Depends: cdbs (>= 0.4.90~), debhelper (>= 7), python-all-dev (>= 2.6.6-3~), python-setupdocs
-Standards-Version: 3.9.5
+Build-Depends: debhelper (>= 9), dh-python, python-all (>= 2.6.6-3~), python-all-dev, python-setuptools, python3-all, python3-all-dev, python3-setuptools, quilt
+Standards-Version: 3.9.6
 Homepage: http://pypi.python.org/pypi/traits
-X-Python-Version: >=2.5
+X-Python-Version: >= 2.6
+X-Python3-Version: >= 3.2
 Vcs-Svn: svn://anonscm.debian.org/python-modules/packages/python-traits/trunk/
 Vcs-Browser: http://anonscm.debian.org/viewvc/python-modules/packages/python-traits/trunk/
 
@@ -14,7 +15,7 @@
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}
 Suggests: python-traitsui
-Description: Manifest typing and reactive programming for Python
+Description: Manifest typing and reactive programming for Python (Python 2)
  The traits package provides a metaclass with special attributes that
  are called traits. A trait is a type definition that can be used for
  normal Python object attributes, giving the attributes some
@@ -27,3 +28,27 @@
     callbacks
   * Visualization: With the TraitsUI package, GUIs can be generated
     automatically from traited objects.
+ .
+ This is the Python 2 version of the package.
+
+
+Package: python3-traits
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}
+Suggests: python3-traitsui
+Description: Manifest typing and reactive programming for Python (Python 3)
+ The traits package provides a metaclass with special attributes that
+ are called traits. A trait is a type definition that can be used for
+ normal Python object attributes, giving the attributes some
+ additional characteristics:
+  * Initialization: A trait attribute can have a default value
+  * Validation: A trait attribute is manifestly typed.
+  * Delegation: The value of a trait attribute can be contained in another
+    object
+  * Notification: Setting the value of a trait attribute can fired
+    callbacks
+  * Visualization: With the TraitsUI package, GUIs can be generated
+    automatically from traited objects.
+ .
+ This is the Python 3 version of the package.
+

Added: packages/python-traits/trunk/debian/patches/py3_sort_fix.patch
===================================================================
--- packages/python-traits/trunk/debian/patches/py3_sort_fix.patch	                        (rev 0)
+++ packages/python-traits/trunk/debian/patches/py3_sort_fix.patch	2014-10-11 18:30:19 UTC (rev 30987)
@@ -0,0 +1,76 @@
+Description: Fix TraitListObject.sort for Python 3, along with tests.
+ Complete the support of python 3
+ .
+
+Origin: upstream, https://github.com/enthought/traits/pull/176
+Last-Update: 2014-06-22
+
+--- a/traits/tests/test_list.py
++++ b/traits/tests/test_list.py
+@@ -255,3 +255,42 @@ class ListTestCase(unittest.TestCase):
+ 
+             f.strs = array(("abc", "def", "ghi"))
+             self.failUnlessEqual(f.strs, ["abc", "def", "ghi"])
++
++
++    def test_sort_no_args(self):
++        f = Foo()
++        f.l = ["a", "c", "b", "d"]
++        f.l.sort()
++        self.assertEqual(f.l, ["a", "b", "c", "d"])
++
++    def test_sort_key(self):
++        f = Foo()
++        f.l = ["a", "c", "b", "d"]
++        f.l.sort(key=lambda x: -ord(x))
++        self.assertEqual(f.l, ["d", "c", "b", "a"])
++
++    def test_sort_reverse(self):
++        f = Foo()
++        f.l = ["a", "c", "b", "d"]
++        f.l.sort(reverse=True)
++        self.assertEqual(f.l, ["d", "c", "b", "a"])
++
++    def test_sort_key_reverse(self):
++        f = Foo()
++        f.l = ["a", "c", "b", "d"]
++        f.l.sort(key=lambda x: -ord(x), reverse=True)
++        self.assertEqual(f.l, ["a", "b", "c", "d"])
++
++    @unittest.skipIf(sys.version_info[0] >= 3, "Not for Python 3")
++    def test_sort_cmp(self):
++        f = Foo()
++        f.l = ["a", "c", "b", "d"]
++        f.l.sort(cmp=lambda x, y: ord(x) - ord(y))
++        self.assertEqual(f.l, ["a", "b", "c", "d"])
++
++    @unittest.skipIf(sys.version_info[0] < 3, "Not for Python 2")
++    def test_sort_cmp_error(self):
++        f = Foo()
++        f.l = ["a", "c", "b", "d"]
++        with self.assertRaises(TypeError):
++            f.l.sort(cmp=lambda x, y: ord(x) - ord(y))
+--- a/traits/trait_handlers.py
++++ b/traits/trait_handlers.py
+@@ -2561,10 +2561,18 @@ class TraitListObject ( list ):
+         else:
+             self.len_error( len( self ) - 1 )
+ 
+-    def sort ( self, cmp = None, key = None, reverse = False ):
+-        removed = self[:]
+-        list.sort( self, cmp = cmp, key = key, reverse = reverse )
++    if sys.version_info[0] < 3:
++        def sort ( self, cmp = None, key = None, reverse = False ):
++            removed = self[:]
++            list.sort( self, cmp = cmp, key = key, reverse = reverse )
++            self._sort_common(removed)
++    else:
++        def sort ( self, key = None, reverse = False ):
++            removed = self[:]
++            list.sort( self, key = key, reverse = reverse )
++            self._sort_common(removed)
+ 
++    def _sort_common ( self, removed ):
+         if (getattr(self, 'name_items', None) is not None and
+             getattr(self, 'trait', None) is not None):
+             self._send_trait_items_event( self.name_items,

Added: packages/python-traits/trunk/debian/patches/remove_testing_dependencies_class.patch
===================================================================
--- packages/python-traits/trunk/debian/patches/remove_testing_dependencies_class.patch	                        (rev 0)
+++ packages/python-traits/trunk/debian/patches/remove_testing_dependencies_class.patch	2014-10-11 18:30:19 UTC (rev 30987)
@@ -0,0 +1,763 @@
+Description: Remove unused, undocumented ImportManager and ImportSpy classes.
+ Commit from upstreal that avoid py2 print function error when
+ installing the python3 package
+ .
+
+Origin: upstream, https://github.com/enthought/traits/commit/c1d097b25682f70819c3a5e95e58c794faa8fc6e
+Last-Update: 2014-10-07
+
+Index: python-traits/traits/testing/dependencies/ImportManager.py
+===================================================================
+--- python-traits.orig/traits/testing/dependencies/ImportManager.py	2014-10-07 11:23:08.000000000 -0400
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,260 +0,0 @@
+-""" This code was found on http://www.webwareforpython.org/. The only
+-    modifications are for the explicit purpose of tracking circular
+-    dependencies.
+-"""
+-
+-"""ImportManager
+-
+-Manages imported modules and protects against concurrent imports.
+-
+-Keeps lists of all imported Python modules and templates as well as other
+-config files used by Webware for Python. For modules which are not directly
+-imported, ImportManager can use ImportSpy to keep track of them. This can
+-be used to detect changes in source files, templates or config files in order
+-to reload them automatically by the AutoReloadingAppServer. The use of
+-ImportSpy can be suppressed with the``UseImportSpy`` setting.
+-
+-"""
+-
+-
+-#from Common import *
+-import os
+-import sys
+-import imp
+-
+-
+-class ImportLock:
+-    """Lock for multi-threaded imports.
+-
+-    Provides a lock for protecting against concurrent imports. This is
+-    necessary because WebKit is multithreaded and uses its own import hook.
+-
+-    This class abstracts the difference between using the Python interpreter's
+-    global import lock, and using our own RLock. The global lock is the correct
+-    solution, but is only available in Python since version 2.2.3. If it's not
+-    available, we fall back to using an RLock (which is not as good, but better
+-    than nothing).
+-
+-    """
+-
+-    def __init__(self):
+-        """Create the lock.
+-
+-        Aliases the `acquire` and `release` methods to
+-        `imp.acquire_lock` and `imp.release_lock` (if available),
+-        or to acquire and release our own RLock.
+-
+-        """
+-        if hasattr(imp, 'acquire_lock'):
+-            self.acquire = imp.acquire_lock
+-            self.release = imp.release_lock
+-        else: # fallback for Python < 2.3
+-            from threading import RLock
+-            self._lock = RLock()
+-            self.acquire = self._lock.acquire
+-            self.release = self._lock.release
+-
+-
+-class ImportManager(object):
+-    """The import manager.
+-
+-    Keeps track of the Python modules and other system files that have been
+-    imported and are used by Webware.
+-
+-    """
+-
+-    _imp = _spy = None
+-
+-    def __init__(self):
+-        """Create import hook."""
+-        assert not self._imp, "Only one instance of ImportManager is possible."
+-        self._imp = True
+-#        Object.__init__(self)
+-        self._lock = ImportLock()
+-        self._fileList = {}
+-        self._moduleFiles = {}
+-        self._otherFiles = set()
+-        self._notifyHook = None
+-
+-    def load_module(self, name, file, filename, info):
+-        """Replaces imp.load_module."""
+-        try:
+-            try:
+-                self._lock.acquire()
+-                mod = imp.load_module(name, file, filename, info)
+-            finally:
+-                self._lock.release()
+-            self.recordModule(mod)
+-        except:
+-            # Also record filepaths which weren't successfully loaded, which
+-            # may happen due to a syntax error in a servlet, because we also
+-            # want to know when such a file is modified:
+-            self.recordFile(filename)
+-            raise
+-        return mod
+-
+-    def find_module(self, name, path=None):
+-        """Replaces imp.find_module."""
+-        return imp.find_module(name, path)
+-
+-    def activateImportSpy(self):
+-        """Activate ImportSpy to keep track of modules loaded elsewhere."""
+-        if not self._spy:
+-            from ImportSpy import activate
+-            self._spy = activate(self)
+-        return self._spy
+-
+-    def fileList(self, update=True):
+-        """Return the list of tracked files."""
+-        if not self._spy and update:
+-            # Update list of files of imported modules
+-            moduleNames = []
+-            for modname in sys.modules:
+-                if not modname in self._moduleFiles:
+-                    moduleNames.append(modname)
+-            if moduleNames:
+-                self.recordModules(moduleNames)
+-        return self._fileList
+-
+-    def notifyOfNewFiles(self, hook):
+-        """Register notification hook.
+-
+-        Called by someone else to register that they'd like to be know
+-        when a new file is imported.
+-
+-        """
+-        self._notifyHook = hook
+-
+-    def watchFile(self, path, modname=None, getmtime=os.path.getmtime):
+-        """Add more files to watch without importing them."""
+-        modtime = getmtime(path)
+-        self._fileList[path] = modtime
+-        if modname:
+-            self._moduleFiles[modname] = path
+-        else:
+-            self._otherFiles.add(path)
+-        # send notification that this file was imported
+-        if self._notifyHook:
+-            self._notifyHook(path, modtime)
+-
+-    def recordModule(self, mod, isfile=os.path.isfile):
+-        """Record a module."""
+-        modname = getattr(mod, '__name__', None)
+-        if not modname or not modname in sys.modules:
+-            return
+-        fileList = self._fileList
+-        # __orig_file__ is used for PSP, Kid and Cheetah templates; we want
+-        # to record the source filenames, not the auto-generated modules:
+-        f = getattr(mod, '__orig_file__', None)
+-        if f and not f in fileList:
+-            try:
+-                if isfile(f):
+-                    self.watchFile(f, modname)
+-            except OSError:
+-                pass
+-        else:
+-            f = getattr(mod, '__file__', None)
+-            if f and not f in fileList:
+-                # record the .py file corresponding to each .pyc or .pyo
+-                if f[-4:].lower() in ['.pyc', '.pyo']:
+-                    f = f[:-1]
+-                try:
+-                    if isfile(f):
+-                        self.watchFile(f, modname)
+-                    else:
+-                        self.watchFile(os.path.join(f, '__init__.py'))
+-                except OSError:
+-                    pass
+-
+-    def recordModules(self, moduleNames=None):
+-        """Record a list of modules (or all modules)."""
+-        if moduleNames is None:
+-            moduleNames = sys.modules.keys()
+-        for modname in moduleNames:
+-            mod = sys.modules[modname]
+-            self.recordModule(mod)
+-
+-    def recordFile(self, filename, isfile=os.path.isfile):
+-        """Record a file."""
+-        if isfile(filename):
+-            self.watchFile(filename)
+-
+-    def fileUpdated(self, filename, update=True, getmtime=os.path.getmtime):
+-        """Check whether file has been updated."""
+-        fileList = self.fileList(update)
+-        try:
+-            mtime = fileList[filename]
+-        except KeyError:
+-            return True
+-        try:
+-            newmtime = getmtime(filename)
+-        except OSError:
+-            return True
+-        if mtime < newmtime:
+-            fileList[filename] = newmtime
+-            for modname, modfile in self._moduleFiles.items():
+-                if modfile == filename:
+-                    break
+-            else:
+-                return True # it's not a module, we must reload
+-            mod = sys.modules.get(modname, None)
+-            if not mod or not getattr(mod, '__donotreload__', None):
+-                return True # it's a module that needs to be reloaded
+-        return False
+-
+-    def updatedFile(self, update=True, getmtime=os.path.getmtime):
+-        """Check whether one of the files has been updated."""
+-        fileList = self.fileList(update)
+-        for filename, mtime in fileList.items():
+-            try:
+-                newmtime = getmtime(filename)
+-            except OSError:
+-                return filename
+-            if mtime < newmtime:
+-                fileList[filename] = newmtime
+-                for modname, modfile in self._moduleFiles.items():
+-                    if modfile == filename:
+-                        break
+-                else:
+-                    return filename # it's not a module, we must reload
+-                mod = sys.modules.get(modname, None)
+-                if not mod or not getattr(mod, '__donotreload__', None):
+-                    return filename # it's a module that needs to be reloaded
+-        return False
+-
+-    def delModules(self, includePythonModules=False, excludePrefixes=[]):
+-        """Delete imported modules.
+-
+-        Deletes all the modules that the ImportSpy has ever imported unless
+-        they are part of WebKit. This in support of DebugAppServer's useful
+-        (yet imperfect) support for AutoReload.
+-
+-        """
+-        moduleFiles = self._moduleFiles
+-        moduleNames = moduleFiles.keys()
+-        fileList = self._fileList
+-        for modname in moduleNames:
+-            if modname == __name__:
+-                continue
+-            filename = self._moduleFiles[modname]
+-            if not includePythonModules:
+-                if not filename or filename.startswith(sys.prefix):
+-                    continue
+-            for prefix in excludePrefixes:
+-                if modname.startswith(prefix):
+-                    break
+-            else:
+-                try:
+-                    del sys.modules[modname]
+-                except KeyError:
+-                    pass
+-                try:
+-                    del moduleFiles[modname]
+-                except KeyError:
+-                    pass
+-                try:
+-                    del fileList[filename]
+-                except KeyError:
+-                    pass
+-
+-
+Index: python-traits/traits/testing/dependencies/ImportSpy.py
+===================================================================
+--- python-traits.orig/traits/testing/dependencies/ImportSpy.py	2014-10-07 11:23:08.000000000 -0400
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,198 +0,0 @@
+-""" This code was found on http://www.webwareforpython.org/. The only
+-    modifications are for the explicit purpose of tracking circular
+-    dependencies.
+-"""
+-
+-
+-"""ImportSpy
+-
+-Keeps track of modules not imported directly by Webware for Python.
+-
+-This module helps save the filepath of every module which is imported.
+-This is used by the `AutoReloadingAppServer` (see doc strings for more
+-information) to restart the server if any source files change.
+-
+-Other than keeping track of the filepaths, the behaviour of this module
+-loader is identical to Python's default behaviour.
+-
+-If the system supports FAM (file alteration monitor) and python-fam is
+-installed, then the need for reloading can be monitored very effectively
+-with the use of ImportSpy. Otherwise, ImportSpy will not have much benefit.
+-
+-Note that ImportSpy is based on the new import hooks of Python 2.3 described in
+-PEP 302, falling back to the old ihooks module if the new hooks are not available.
+-In some cases this may become problematic, when other templating systems are
+-used with Webware which are also using ihook support to load their templates,
+-or if they are using zipimports. Therefore, it is possible to suppress the use
+-of ImportSpy by setting `UseImportSpy` in AppServer.config to False.
+-
+-"""
+-
+-
+-try: # if possible, use new (PEP 302) import hooks
+-    from sys import path_hooks, path_importer_cache
+-except ImportError:
+-    path_hooks = None
+-
+-import os.path
+-import sys
+-
+-incomplete_imports = []
+-find_module_chain = []
+-dependency_map = {}
+-indent = 0
+-debug = False
+-
+-def path_could_be_package(path, package):
+-   parts = package.split('.')
+-   parts.reverse()
+-   for part in parts:
+-      basename, ext = os.path.splitext(os.path.basename(path))
+-      if ext == ".so":
+-         if basename != part:
+-            part += "module"
+-      elif basename != part:
+-         return False
+-      path = os.path.dirname(path)
+-   return True
+-
+-def circular_tester(path, modtime):
+-   if len(find_module_chain) == 0:
+-      return
+-   elif path_could_be_package(path, find_module_chain[-1]):
+-      return
+-
+-   for m in incomplete_imports:
+-      try:
+-          n,p,d = ImportSpy._imp.find_module(m)
+-      except ImportError:
+-          print "  import stack: " + str(incomplete_imports)
+-          sys.exit(65)
+-
+-
+-
+-if path_hooks is not None:
+-
+-    from os.path import isdir
+-
+-
+-    class ImportSpy(object):
+-        """New style import tracker."""
+-
+-        _imp = None
+-
+-        def __init__(self, path=None):
+-            """Create importer."""
+-            assert self._imp
+-            if path and isdir(path):
+-                self.path = path
+-            else:
+-                raise ImportError
+-
+-        def find_module(self, fullname):
+-            """Replaces imp.find_module."""
+-            global indent
+-            if debug: print '  '*indent + "Find module(self, %s)" % fullname
+-            indent += 1
+-
+-            try:
+-                self.file, self.filename, self.info = self._imp.find_module(
+-                    fullname.split('.')[-1], [self.path])
+-                if (os.path.isdir(self.filename)):
+-                   find_module_chain.append(fullname)
+-
+-            except ImportError:
+-                self.file = None
+-            if self.file:
+-                find_module_chain.append(fullname)
+-                indent -= 1
+-                return self
+-            else:
+-                indent -= 1
+-                return None
+-
+-        def load_module(self, fullname):
+-            """Replaces imp.load_module."""
+-            global indent
+-            global find_module_chain
+-            if debug: print '  '*indent + "Load module %s" % fullname
+-            indent += 1
+-
+-            # build the dependency map
+-            if len(find_module_chain) > 1:
+-                parent = find_module_chain[-2]
+-                if parent in dependency_map:
+-                    dependency_map[parent].append(fullname)
+-                else:
+-                    dependency_map[parent] = [fullname]
+-            else:
+-                if len(incomplete_imports) == 0:
+-                    # this is a top level node
+-                    pass
+-                else:
+-                    parent = incomplete_imports[-1]
+-                    if parent in dependency_map:
+-                        dependency_map[parent].append(fullname)
+-                    else:
+-                        dependency_map[parent] = [fullname]
+-
+-            incomplete_imports.append(fullname)
+-            mod = self._imp.load_module(fullname, self.file, self.filename, self.info)
+-            incomplete_imports.remove(fullname)
+-            find_module_chain = []
+-            indent -= 1
+-            if debug: print '  '*indent + "Complete loading %s" % fullname
+-            if mod:
+-                mod.__loader__ = self
+-            return mod
+-
+-    def activate(imp_manager):
+-        """Activate ImportSpy."""
+-        assert not ImportSpy._imp
+-        ImportSpy._imp = imp_manager
+-        path_hooks.append(ImportSpy)
+-        path_importer_cache.clear()
+-        imp_manager.recordModules()
+-        return 'new import hooks'
+-
+-
+-else: # Python < 2.3, fall back to using the old ihooks module
+-
+-    import ihooks
+-
+-
+-    class ImportSpy(ihooks.ModuleLoader):
+-        """Old style import tracker."""
+-
+-        _imp = None
+-
+-        def __init__(self):
+-            """Create import hook."""
+-            assert self._imp
+-            ihooks.ModuleLoader.__init__(self)
+-            self._lock = self._imp._lock
+-            imp = ihooks.ModuleImporter(loader=self)
+-            ihooks.install(imp)
+-            self._imp.recordModules()
+-
+-        def load_module(self, name, stuff):
+-            """Replaces imp.load_module."""
+-            file, filename, info = stuff
+-            try:
+-                try:
+-                    self._lock.acquire()
+-                    mod = ihooks.ModuleLoader.load_module(self, name, stuff)
+-                finally:
+-                    self._lock.release()
+-                self._imp.recordModule(mod)
+-            except:
+-                self._imp.recordFile(filename)
+-                raise
+-            return mod
+-
+-    def activate(imp_manager):
+-        """Activate ImportSpy."""
+-        assert not ImportSpy._imp
+-        ImportSpy._imp = imp_manager
+-        ImportSpy()
+-        return 'ihooks'
+Index: python-traits/traits/testing/dependencies/circular_test.py
+===================================================================
+--- python-traits.orig/traits/testing/dependencies/circular_test.py	2014-10-07 11:23:08.000000000 -0400
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,92 +0,0 @@
+-import ImportSpy
+-import ImportManager
+-import sys
+-import os
+-import getopt
+-
+-
+-
+-def usage():
+-    print "usage: %s [--chart] [-p] input" % sys.argv[0]
+-
+-def generate_dot(parent, dependents):
+-    # omit standard python modules
+-    import distutils.sysconfig
+-    dirs_to_omit = [ os.path.realpath(os.path.join(distutils.sysconfig.get_python_lib(), '..')) ]
+-    if 'win32' == sys.platform:
+-        for i in range(len(dirs_to_omit)):
+-            dir = dirs_to_omit[i]
+-            dirs_to_omit[i] = dir.lower()
+-
+-    s = ''
+-    for d in dependents:
+-        try:
+-            __import__(d)
+-            file = sys.modules[d].__file__
+-            if 'win32' == sys.platform:
+-                file = file.lower()
+-            if os.path.dirname(file) not in dirs_to_omit:
+-                s += '  "' + parent + '" -> "' + d + '";\n'
+-            else:
+-                print "omitting " + d
+-        except Exception, ex:
+-            print "importing %s failed" % d
+-    return s
+-
+-def generate_dot_file(top, dep_map, filename):
+-   s = 'digraph dependencies {\n'
+-   s += generate_dot(top, dep_map.keys())
+-   for key,value in dep_map.items():
+-      s += generate_dot(key, value)
+-   s += '}\n'
+-
+-   f = open(filename, "w")
+-   f.write(s)
+-   f.close()
+-
+-def main():
+-
+-    try:
+-        opts, args = getopt.getopt(sys.argv[1:], "p", ["chart"])
+-    except getopt.GetoptError, ex:
+-        print ex
+-        usage()
+-        sys.exit(65)
+-
+-    if len(args) != 1:
+-        usage()
+-        sys.exit(65)
+-
+-    package_flag = False
+-    chart_flag = False
+-    for opt,arg in opts:
+-        if opt == "-p":
+-            package_flag = True
+-        if opt == "--chart":
+-            chart_flag = True
+-
+-    import_manager = ImportManager.ImportManager()
+-    import_manager.notifyOfNewFiles(ImportSpy.circular_tester)
+-    ImportSpy.activate(import_manager)
+-
+-    if package_flag:
+-        __import__(args[0])
+-    else:
+-        #todo: tinker with __name__
+-        execfile(args[0])
+-
+-    sys.path_hooks = sys.path_hooks[:-1]
+-
+-    if chart_flag:
+-        dot_file = "dependencies.dot"
+-        generate_dot_file(args[0], ImportSpy.dependency_map, dot_file)
+-
+-        #try to find 'dot'
+-        import subprocess
+-        if 0 == subprocess.call('dot -T svg -o %s %s' % (args[0] + ".svg", dot_file)):
+-            os.unlink(dot_file)
+-
+-
+-if __name__ == "__main__":
+-    main()
+-
+Index: python-traits/traits/testing/dependencies/deptrack.py
+===================================================================
+--- python-traits.orig/traits/testing/dependencies/deptrack.py	2014-10-07 11:23:08.000000000 -0400
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,185 +0,0 @@
+-import os
+-import sys
+-import subprocess
+-import pickle
+-import operator
+-
+-dependent_pickle_name = "dependents.pickle"
+-
+-def get_dependent(module_name):
+-   if os.path.exists(dependent_pickle_name):
+-      dep_map = pickle.load(open(dependent_pickle_name, "r"))
+-      if module_name in dep_map:
+-         return dep_map[module_name]
+-
+-   return None
+-
+-def store_dependent(module_name, module):
+-   if os.path.exists(dependent_pickle_name):
+-      dep_map = pickle.load(open(dependent_pickle_name, "r"))
+-   else:
+-      dep_map = {}
+-   dep_map[module_name] = module
+-   pickle.dump(dep_map, open(dependent_pickle_name, "w"))
+-
+-def print_dependencies(module_name):
+-   dep_map = pickle.load(open(dependent_pickle_name, "r"))
+-   print dep_map[module_name].pretty_print(0)
+-
+-def generate_dot_file(filename):
+-   s = 'digraph dependencies {\n'
+-   dep_map = pickle.load(open(dependent_pickle_name, "r"))
+-   for key,value in dep_map.items():
+-      s += value.generate_dot()
+-   s += '}\n'
+-
+-   f = open(filename, "w")
+-   f.write(s)
+-   f.close()
+-
+-
+-class Dependent(object):
+-   def __init__(self, name, path, script=False):
+-      self.name = name
+-      self.path = path
+-      if script:
+-         self.dependents = self._exec_script()
+-      else:
+-         self.dependents = self._find_dependencies_subprocess()
+-         store_dependent(self.name, self)
+-
+-   def _exec_script(self):
+-      global_dict = globals()
+-      global_dict['__name__'] = self.name
+-      global_dict['__file__'] = self.path
+-      global_dict['sys.argv'] = self.path
+-
+-      before = sys.modules.keys()
+-      sys.path.append(os.path.dirname(self.path))
+-      execfile(self.path, global_dict)
+-
+-      after = sys.modules.keys()
+-
+-      dependents = []
+-      for key in after:
+-         if key not in before:
+-            m = sys.modules[key]
+-            if (m is not None) and ('__path__' in dir(m)):
+-               dependent = get_dependent(m.__name__)
+-               if (dependent is None):
+-                  new_dependent = Dependent(m.__name__, m.__path__)
+-                  dependents.append(new_dependent)
+-                  store_dependent(m.__name__, new_dependent)
+-
+-      return dependents
+-
+-
+-   def _find_dependencies_subprocess(self):
+-      dependent = get_dependent(self.name)
+-      if dependent is None:
+-
+-         # put something in the map now & pickle it so
+-         # subprocesses wont get stuck in a loop
+-         store_dependent(self.name, '')
+-
+-         subprocess.call([sys.executable, sys.argv[0], "-m", self.name])
+-
+-         store_dependent(self.name, self)
+-
+-         f = open(self.name + ".pickle", "r")
+-         return pickle.load(f)
+-      else:
+-         return d.dependents
+-
+-   def __str__(self):
+-      return self.__format_str__(0)
+-
+-   def pretty_print(self, indent):
+-      s = operator.repeat(' ', indent) + self.name + "\n"
+-      indent = indent + 2
+-      for d in self.dependents:
+-         s += operator.repeat(' ', indent) + d.name + "\n"
+-
+-      for d in self.dependents:
+-         s += d.pretty_print(indent) + "\n"
+-
+-      #trim the last newline off
+-      return s[:-1]
+-
+-   def generate_dot(self):
+-      s = ''
+-      for d in self.dependents:
+-         s += '  "' + self.name + '" -> "' + d.name + '";\n'
+-      return s
+-
+-def find_dependencies_script(filename):
+-   script = Dependent(os.path.basename(filename).split(".")[0], filename, script=True)
+-   store_dependent(script.name, script)
+-
+-   return
+-
+-def find_dependencies_module(module):
+-   dependents = []
+-   before = sys.modules.keys()
+-   try:
+-      __import__(module)
+-   except:
+-      print "[ERROR] importing %s failed" % module
+-   after = sys.modules.keys()
+-
+-   for key in after:
+-      if key not in before:
+-         m = sys.modules[key]
+-         if (m is not None) and ('__path__' in dir(m)):
+-            dependent = get_dependent(m.__name__)
+-            if (dependent is None):
+-               new_dependent = Dependent(m.__name__, m.__path__)
+-               dependents.append(new_dependent)
+-               store_dependent(m.__name__, new_dependent)
+-
+-   f = open(module + ".pickle", "w")
+-   pickle.dump(dependents, f)
+-
+-   return dependents
+-
+-def clean_pickles():
+-   import glob
+-   pickles = glob.glob("*.pickle")
+-   for pickle in pickles:
+-      os.unlink(pickle)
+-
+-def usage():
+-   print "usage:"
+-   print "  %s: <-m|-s> <module|script> [[-o] [filename]]" % sys.argv[0]
+-   sys.exit(65)
+-
+-
+-if __name__ == "__main__":
+-   if len(sys.argv) < 3:
+-      usage()
+-
+-   if "-m" == sys.argv[1]:
+-      dependencies = find_dependencies_module(sys.argv[2])
+-   elif "-s" == sys.argv[1]:
+-      clean_pickles()
+-      find_dependencies_script(sys.argv[2])
+-   else:
+-      usage()
+-
+-   if len(sys.argv) > 3:
+-      if sys.argv[3] == '-o':
+-         if len(sys.argv) > 4:
+-            generate_dot_file(sys.argv[4])
+-         else:
+-            name,ext = os.path.splitext(sys.argv[2])
+-            print_dependencies(name)
+-      else:
+-         usage()
+-
+-   # only clean the pickles up if its a script, so the module subprocesses can find
+-   # them later
+-   #
+-   # TODO: add a command line flag for keeping the pickles
+-   #
+-   elif "-s" == sys.argv[1]:
+-      clean_pickles()

Added: packages/python-traits/trunk/debian/patches/series
===================================================================
--- packages/python-traits/trunk/debian/patches/series	                        (rev 0)
+++ packages/python-traits/trunk/debian/patches/series	2014-10-11 18:30:19 UTC (rev 30987)
@@ -0,0 +1,2 @@
+remove_testing_dependencies_class.patch
+py3_sort_fix.patch

Modified: packages/python-traits/trunk/debian/rules
===================================================================
--- packages/python-traits/trunk/debian/rules	2014-10-11 18:29:57 UTC (rev 30986)
+++ packages/python-traits/trunk/debian/rules	2014-10-11 18:30:19 UTC (rev 30987)
@@ -1,10 +1,13 @@
 #!/usr/bin/make -f
 
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/class/python-distutils.mk
+#export DH_VERBOSE=1
+export PYBUILD_NAME=traits
 
-DEB_COMPRESS_EXCLUDE		:= .py
-DEB_PYTHON_INSTALL_ARGS_ALL 	+= --single-version-externally-managed
+# Install egg-info directories
+DEB_PYTHON_INSTALL_ARGS_ALL += --single-version-externally-managed
 
-get-orig-source:
-	-uscan --force-download --rename
+%:
+	dh $@ --with python2,python3 --buildsystem=pybuild --with quilt	
+
+override_dh_compress:
+	dh_compress -X.py




More information about the Python-modules-commits mailing list