~ubuntu-branches/ubuntu/quantal/nova/quantal-proposed

« back to all changes in this revision

Viewing changes to debian/patches/0001-Update-tools-hacking-for-pep8-1.2-and-beyond.patch

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman, Adam Gandelman, Chuck Short
  • Date: 2012-08-27 15:37:18 UTC
  • mfrom: (1.1.60)
  • Revision ID: package-import@ubuntu.com-20120827153718-lj8er44eqqz1gsrj
Tags: 2012.2~rc1~20120827.15815-0ubuntu1
[ Adam Gandelman ]
* New upstream release.

[ Chuck Short ]
* debian/patches/0001-Update-tools-hacking-for-pep8-1.2-and-
  beyond.patch: Dropped we dont run pep8 tests anymore.
* debian/control: Drop pep8 build depends
* debian/*.upstart.in: Make sure we transition correctly from runlevel
  1 to 2. (LP: #820694)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From 54ad73dd9a9cf429e36d4a5288206adb308aa367 Mon Sep 17 00:00:00 2001
2
 
From: Joe Gordon <jogo@cloudscaling.com>
3
 
Date: Mon, 9 Jul 2012 16:03:14 -0700
4
 
Subject: [PATCH] Update tools hacking for pep8 1.2 and beyond
5
 
 
6
 
Based on https://github.com/jcrocholl/pep8/commit/b9f72b16011aac981ce9e3a47fd0ffb1d3d2e085
7
 
 
8
 
Change-Id: Icd776edd1d7b9987833167dcf04015109ffc7c17
9
 
---
10
 
 tools/hacking.py    |   12 +++++++-----
11
 
 tools/test-requires |    2 +-
12
 
 tox.ini             |    4 ++--
13
 
 3 files changed, 10 insertions(+), 8 deletions(-)
14
 
 
15
 
Index: nova-2012.2/tools/hacking.py
16
 
===================================================================
17
 
--- nova-2012.2.orig/tools/hacking.py   2012-08-06 12:23:06.000000000 -0700
18
 
+++ nova-2012.2/tools/hacking.py        2012-08-06 12:23:40.621307381 -0700
19
 
@@ -137,7 +137,7 @@
20
 
     N201
21
 
     """
22
 
     if logical_line.startswith("except:"):
23
 
-        return 6, "NOVA N201: no 'except:' at least use 'except Exception:'"
24
 
+        yield 6, "NOVA N201: no 'except:' at least use 'except Exception:'"
25
 
 
26
 
 
27
 
 def nova_except_format_assert(logical_line):
28
 
@@ -148,7 +148,7 @@
29
 
     N202
30
 
     """
31
 
     if logical_line.startswith("self.assertRaises(Exception"):
32
 
-        return 1, "NOVA N202: assertRaises Exception too broad"
33
 
+        yield 1, "NOVA N202: assertRaises Exception too broad"
34
 
 
35
 
 
36
 
 def nova_one_import_per_line(logical_line):
37
 
@@ -166,7 +166,7 @@
38
 
     if (pos > -1 and (parts[0] == "import" or
39
 
                       parts[0] == "from" and parts[2] == "import") and
40
 
         not is_import_exception(parts[1])):
41
 
-        return pos, "NOVA N301: one import per line"
42
 
+        yield pos, "NOVA N301: one import per line"
43
 
 
44
 
 _missingImport = set([])
45
 
 
46
 
@@ -240,7 +240,9 @@
47
 
             (len(split_line) == 2 or
48
 
             (len(split_line) == 4 and split_line[2] == "as"))):
49
 
         mod = split_line[1]
50
 
-        return importModuleCheck(mod)
51
 
+        rval = importModuleCheck(mod)
52
 
+        if rval != None:
53
 
+            yield rval
54
 
 
55
 
     # TODO(jogo) handle "from x import *"
56
 
 
57
 
@@ -397,7 +399,7 @@
58
 
         map(gen.send, tokens)
59
 
         gen.close()
60
 
     except LocalizationError as e:
61
 
-        return e.args
62
 
+        yield e.args
63
 
 
64
 
 #TODO(jogo) Dict and list objects
65
 
 
66
 
Index: nova-2012.2/tools/test-requires
67
 
===================================================================
68
 
--- nova-2012.2.orig/tools/test-requires        2012-08-06 12:23:06.000000000 -0700
69
 
+++ nova-2012.2/tools/test-requires     2012-08-06 12:23:40.621307381 -0700
70
 
@@ -5,5 +5,5 @@
71
 
 mox==0.5.3
72
 
 nose
73
 
 openstack.nose_plugin>=0.7
74
 
-pep8==1.1
75
 
+pep8==1.2
76
 
 sphinx>=1.1.2
77
 
Index: nova-2012.2/tox.ini
78
 
===================================================================
79
 
--- nova-2012.2.orig/tox.ini    2012-08-06 12:23:06.000000000 -0700
80
 
+++ nova-2012.2/tox.ini 2012-08-06 12:24:27.929305640 -0700
81
 
@@ -17,9 +17,9 @@
82
 
 downloadcache = ~/cache/pip
83
 
 
84
 
 [testenv:pep8]
85
 
-deps=pep8==1.0.1
86
 
+deps = pep8==1.2
87
 
 commands =
88
 
-  python tools/hacking.py --ignore=N4 --repeat --show-source \
89
 
+  python tools/hacking.py --ignore=N4,E12 --repeat --show-source \
90
 
     --exclude=.venv,.tox,dist,doc,*openstack/common*,*lib/python*,*egg .
91
 
 
92
 
 [testenv:cover]