~ubuntu-branches/ubuntu/natty/python-distutils-extra/natty-proposed

« back to all changes in this revision

Viewing changes to debian/patches/ignore-relative-imports.patch

  • Committer: Bazaar Package Importer
  • Author(s): Michael Terry
  • Date: 2011-08-18 14:27:05 UTC
  • Revision ID: james.westby@ubuntu.com-20110818142705-i0e4oj3udoi2d1dv
Tags: 2.26-2ubuntu0.2
* debian/patches/ignore-relative-imports.patch:
  - Update with a further fix from trunk to fix a couple regressions

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
=== modified file 'DistUtilsExtra/auto.py'
2
2
Index: python-distutils-extra-2.26/DistUtilsExtra/auto.py
3
3
===================================================================
4
 
--- python-distutils-extra-2.26.orig/DistUtilsExtra/auto.py     2011-05-19 13:43:10.000000000 -0400
5
 
+++ python-distutils-extra-2.26/DistUtilsExtra/auto.py  2011-05-19 14:48:37.233314836 -0400
6
 
@@ -308,42 +308,55 @@
 
4
--- python-distutils-extra-2.26.orig/DistUtilsExtra/auto.py     2011-03-15 06:47:28.000000000 -0400
 
5
+++ python-distutils-extra-2.26/DistUtilsExtra/auto.py  2011-08-18 14:24:14.079110886 -0400
 
6
@@ -308,7 +308,7 @@
7
7
     for section, files in mans.items():
8
8
         v.append((os.path.join('share', 'man', 'man' + section), files))
9
9
 
11
11
+def __external_mod(cur_module, module, attrs):
12
12
     '''Check if given Python module is not included in Python or locally'''
13
13
 
14
 
-    # filter out locally provided modules
15
 
-    if module in attrs['provides']:
16
 
-        return False
17
 
-    for m in _module_parents(module):
18
 
-        if m in attrs['provides']:
19
 
-            return False
20
 
-
 
14
     # filter out locally provided modules
 
15
@@ -319,31 +319,51 @@
 
16
             return False
 
17
 
21
18
     try:
22
19
-        path = __import__(module).__file__
23
20
+        mod = __import__(module)
77
74
Index: python-distutils-extra-2.26/test/auto.py
78
75
===================================================================
79
76
--- python-distutils-extra-2.26.orig/test/auto.py       2011-03-15 06:44:37.000000000 -0400
80
 
+++ python-distutils-extra-2.26/test/auto.py    2011-05-19 14:47:02.785314838 -0400
81
 
@@ -671,6 +671,8 @@
 
77
+++ python-distutils-extra-2.26/test/auto.py    2011-08-18 14:26:12.339112138 -0400
 
78
@@ -671,12 +671,20 @@
82
79
 import os, os.path, email.mime, distutils.command.register
83
80
 from email import header as h
84
81
 import httplib2.iri2uri, unknown
85
82
+from . bar import poke
86
83
+from bar.poke import x
 
84
+import grab_cli
 
85
+import broken
87
86
 ''')
88
87
 
89
88
         self._mksrc('foo/bar/__init__.py', '')
90
 
@@ -693,7 +695,7 @@
 
89
         self._mksrc('foo/bar/poke.py', 'def x(): pass')
 
90
 
 
91
         self._mksrc('mymod.py', 'import foo\nfrom foo.bar.poke import x')
 
92
+        # trying to import this will cause setup.py to not process any args any more
 
93
+        self._mksrc('grab_cli.py', 'from optparse import OptionParser\nOptionParser().parse_args()')
 
94
+        # trying to import this will break setup.py
 
95
+        self._mksrc('broken.py', 'raise SystemError("cannot initialize system")')
 
96
 
 
97
         self._mksrc('bin/foo-cli', '''#!/usr/bin/python
 
98
 import sys
 
99
@@ -693,7 +701,7 @@
91
100
         self._mksrc('data/example-code/mymod/shiny.py', 'import example.othermod')
92
101
 
93
102
         (o, e, s) = self.do_install()
96
105
         self.assertEqual(e, 'ERROR: Python module unknown not found\n')
97
106
         self.assertFalse('following files are not recognized' in o)
98
107
 
99
 
@@ -864,10 +866,11 @@
 
108
@@ -712,7 +720,7 @@
 
109
 
 
110
         # check provides
 
111
         prov = [prop.split(' ', 1)[1] for prop in egg if prop.startswith('Provides: ')]
 
112
-        self.assertEqual(set(prov), set(['foo', 'mymod']))
 
113
+        self.assertEqual(set(prov), set(['foo', 'mymod', 'broken', 'grab_cli']))
 
114
 
 
115
         # check requires
 
116
         req = [prop.split(' ', 1)[1] for prop in egg if prop.startswith('Requires: ')]
 
117
@@ -864,10 +872,11 @@
100
118
         Return diff -Nur output.
101
119
         '''
102
120
         assert self.snapshot, 'no snapshot taken'