[Python-modules-commits] [celery] 02/11: Remove upstream detection of installed celery

Brian May bam at moszumanska.debian.org
Wed Nov 18 22:21:06 UTC 2015


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

bam pushed a commit to branch master
in repository celery.

commit cd840962cd287350d34263441ea2bbb608330c4d
Author: Michael Fladischer <fladi at debian.org>
Date:   Thu Oct 8 08:37:01 2015 -0700

    Remove upstream detection of installed celery
    
     Upstream tries to detect already installed versions of celery.app in order to
     remove the whole directory. This leads to ImportErrors during the tests.
    Last-Update: 2013-09-03
    Forwarded: no
    
    Patch-Name: drop_downgrade.patch
---
 setup.py | 32 --------------------------------
 1 file changed, 32 deletions(-)

diff --git a/setup.py b/setup.py
index 4ba98eb..a4c2729 100644
--- a/setup.py
+++ b/setup.py
@@ -23,38 +23,6 @@ CELERY_COMPAT_PROGRAMS = int(os.environ.get('CELERY_COMPAT_PROGRAMS', 1))
 if sys.version_info < (2, 6):
     raise Exception('Celery 3.1 requires Python 2.6 or higher.')
 
-downgrade_packages = [
-    'celery.app.task',
-]
-orig_path = sys.path[:]
-for path in (os.path.curdir, os.getcwd()):
-    if path in sys.path:
-        sys.path.remove(path)
-try:
-    import imp
-    import shutil
-    for pkg in downgrade_packages:
-        try:
-            parent, module = pkg.rsplit('.', 1)
-            print('- Trying to upgrade %r in %r' % (module, parent))
-            parent_mod = __import__(parent, None, None, [parent])
-            _, mod_path, _ = imp.find_module(module, parent_mod.__path__)
-            if mod_path.endswith('/' + module):
-                print('- force upgrading previous installation')
-                print('  - removing {0!r} package...'.format(mod_path))
-                try:
-                    shutil.rmtree(os.path.abspath(mod_path))
-                except Exception:
-                    sys.stderr.write('Could not remove {0!r}: {1!r}\n'.format(
-                        mod_path, sys.exc_info[1]))
-        except ImportError:
-            print('- upgrade %s: no old version found.' % module)
-except:
-    pass
-finally:
-    sys.path[:] = orig_path
-
-
 NAME = 'celery'
 entrypoints = {}
 extra = {}

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



More information about the Python-modules-commits mailing list